ts-7000
[Top] [All Lists]

RE: [ts-7000] I need Memory Map for RTC TS-5620

To: <>
Subject: RE: [ts-7000] I need Memory Map for RTC TS-5620
From: "Daniel Perron" <>
Date: Tue, 18 Apr 2006 15:01:43 -0400
This is a little code I wrote long time ago to get the rtc memory on the TS7200.
 
 
 

#include<unistd.h>

#include<sys/types.h>

#include<sys/mman.h>

#include<stdio.h>

#include<fcntl.h>

#include<assert.h>

#include "peekpoke.h"

#include "rtc.h"

 

volatile unsigned char * RtcAddress=NULL;

volatile unsigned char * RtcData=NULL;

int RtcHandle=-1;

 

int InitRtc(void)

{

RtcHandle = open("/dev/mem",O_RDWR);

if(RtcHandle<0) return(0);

 

 

 

RtcAddress= (unsigned char *) mmap(0,getpagesize(),PROT_WRITE|PROT_READ,MAP_SHARED,RtcHandle,0x10800000UL);

if(RtcAddress == NULL)

{

CloseRtc();

return(0);

}

RtcData = (unsigned char *) mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, RtcHandle, 0x11700000UL);

if(RtcData == NULL)

{

CloseRtc();

return(0);

}

return(1);

}

 

 

void CloseRtc(void)

{

if(RtcAddress)

{

munmap((void *)RtcAddress,getpagesize());

RtcAddress=NULL;

}

if(RtcData)

{

munmap((void *)RtcData,getpagesize());

RtcData=NULL;

}

if(RtcHandle>=0)

{

close(RtcHandle);

RtcHandle=-1;

}

}

 

unsigned char ReadRtc(unsigned char address)

{

*RtcAddress= address;

return(*RtcData);

}

 

void WriteRtc(unsigned char address, unsigned char value)

{

*RtcAddress= address;

*RtcData = value;

}

 

 

int ReadRtcBlock(unsigned char address,unsigned char size,unsigned char * block)

{

short loop;

short endp= (short) address + (short) size;

if(endp>128) //can we change that to a bigger value?

{

endp=128;

size= endp - address;

}

for(loop=address;loop<endp;loop++)

*(block++)= ReadRtc(loop);

return(size);

}

int WriteRtcBlock(unsigned char address,unsigned char size,unsigned char * block)

{

short loop;

short endp= (short) address + (short) size;

if(endp>128)

{

endp=128;

size= endp - address;

}

for(loop=address;loop<endp;loop++)

WriteRtc(loop,*(block++));

return(size);

}

 

 

 

 

 

-----Original Message-----
From: [On Behalf Of parayam2006
Sent: Tuesday, April 18, 2006 11:37 AM
To:
Subject: [ts-7000] I need Memory Map for RTC TS-5620

I Use real Time Clock TS-5620 in TS-7200. I need Memory Address of Non
Volatile RAM.

Urgent... please

/*******/
Only for Spanish People..
Para los Hipanos.
Necesito usar la memoria no volatil del Reloj de Tiempo Real del TS-
5600, lo instalé en un 7200 y solo tengo la dirección para un pc
standard (070 y 071), la necsito para el 7200 arm

Gracias








YAHOO! GROUPS LINKS

  •  Visit your group "ts-7000" on the web.
     
  •  To unsubscribe from this group, send an email to:
     =Unsubscribe
     
  •  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU