File nut/dev/x12rtc.c


Included Files


Preprocessor definitions

#define I2C_SLA_RTC 0x6F

#define I2C_SLA_EEPROM 0x57

#define EEPROM_PAGE_SIZE 64


Local Variables

rtc_status
static u_long rtc_status
Used in: X12RtcClearStatus()  
  X12RtcGetStatus()  

Global Function X12EepromRead()

int X12EepromRead ( u_int addr, void* buff, size_t len )
Prototyped in: nut/include/dev/x12rtc.h
Calls: TwMasterTransact() nut/arch/avr/dev/twif.c

Global Function X12EepromWrite()

int X12EepromWrite ( u_int addr, const void* buff, size_t len )
Prototyped in: nut/include/dev/x12rtc.h
Calls: TwMasterTransact() nut/arch/avr/dev/twif.c
  X12WaitReady() nut/dev/x12rtc.c
  X12WriteEnable() nut/dev/x12rtc.c
  free() nut/crt/malloc.c
  malloc() nut/crt/malloc.c
  memcpy()

Global Function X12Init()

int X12Init ( void )
Prototyped in: nut/include/dev/x12rtc.h
Calls: TwInit() nut/arch/avr/dev/twif.c
  X12RtcGetStatus() nut/dev/x12rtc.c

Global Function X12RtcClearStatus()

int X12RtcClearStatus ( u_long sflgs )
Prototyped in: nut/include/dev/x12rtc.h
References Variables: rtc_status nut/dev/x12rtc.c

Global Function X12RtcGetAlarm()

int X12RtcGetAlarm ( int idx, struct _tm* tm, int* aflgs )
Prototyped in: nut/include/dev/x12rtc.h
Calls: X12RtcReadRegs() nut/dev/x12rtc.c
  memset()

Global Function X12RtcGetClock()

int X12RtcGetClock ( struct _tm* tm )
Prototyped in: nut/include/dev/x12rtc.h
Calls: X12RtcReadRegs() nut/dev/x12rtc.c

Global Function X12RtcGetStatus()

int X12RtcGetStatus ( u_long* sflgs )
Prototyped in: nut/include/dev/x12rtc.h
Calls: X12RtcReadRegs() nut/dev/x12rtc.c
Called by: X12Init() nut/dev/x12rtc.c
References Variables: rtc_status nut/dev/x12rtc.c

Global Function X12RtcReadRegs()

int X12RtcReadRegs ( u_char reg, u_char* buff, size_t cnt )
Prototyped in: nut/include/dev/x12rtc.h
Calls: TwMasterTransact() nut/arch/avr/dev/twif.c
Called by: X12RtcGetAlarm() nut/dev/x12rtc.c
  X12RtcGetClock() nut/dev/x12rtc.c
  X12RtcGetStatus() nut/dev/x12rtc.c

Global Function X12RtcSetAlarm()

int X12RtcSetAlarm ( int idx, struct _tm* tm, int aflgs )
Prototyped in: nut/include/dev/x12rtc.h
Calls: X12RtcWrite() nut/dev/x12rtc.c
  memset()

Global Function X12RtcSetClock()

int X12RtcSetClock ( const struct _tm* tm )
Prototyped in: nut/include/dev/x12rtc.h
Calls: X12RtcWrite() nut/dev/x12rtc.c
  memset()

Global Function X12RtcWrite()

int X12RtcWrite ( int nv, const u_char* buff, size_t cnt )
Prototyped in: nut/include/dev/x12rtc.h
Calls: TwMasterTransact() nut/arch/avr/dev/twif.c
  X12WaitReady() nut/dev/x12rtc.c
  X12WriteEnable() nut/dev/x12rtc.c
Called by: X12RtcSetAlarm() nut/dev/x12rtc.c
  X12RtcSetClock() nut/dev/x12rtc.c

Local Function X12WaitReady()

static int X12WaitReady ( void )
Calls: NutSleep() nut/os/timer.c
  TwMasterTransact() nut/arch/avr/dev/twif.c
Called by: X12EepromWrite() nut/dev/x12rtc.c
  X12RtcWrite() nut/dev/x12rtc.c

Local Function X12WriteEnable()

static int X12WriteEnable ( int on )
Calls: TwMasterTransact() nut/arch/avr/dev/twif.c
Called by: X12EepromWrite() nut/dev/x12rtc.c
  X12RtcWrite() nut/dev/x12rtc.c