ds1338/ds1338.c File Reference

#include <util/twi.h>
#include "../twi_basics/twi_basics.h"
#include "ds1338.h"

Go to the source code of this file.

Functions

void ds1338_setup ()
ds1338_status ds1338_readTimeDateControl (ds1338TDC *data)
ds1338_status ds1338_writeTimeDateControl (ds1338TDC *data)
ds1338_status ds1338_writeBufferToNVRAM (uint8_t location, uint8_t lenght, uint8_t *data)
ds1338_status ds1338_readBufferFromNVRAM (uint8_t location, uint8_t lenght, uint8_t *data)
ds1338_status ds1338_writeByteToNVRAM (uint8_t location, uint8_t data)
ds1338_status ds1338_readByteFromNVRAM (uint8_t location, uint8_t *data)

Detailed Description

Author:
Krzysztof Wesolowski
Date:
September 09, 2009

Definition in file ds1338.c.


Function Documentation

ds1338_status ds1338_readBufferFromNVRAM ( uint8_t  location,
uint8_t  lenght,
uint8_t *  data 
)

Read data from RTC NVRAM

Parameters:
location Starting location of readed data
lenght Lenght of read data
data Pointer where data we'll be stored
Returns:
DS1338 status code

Definition at line 138 of file ds1338.c.

References NO_ERROR, RANGE_OUTOFBOUNDS, twi_receive(), and twi_stop().

Referenced by ds1338_readTimeDateControl().

ds1338_status ds1338_readByteFromNVRAM ( uint8_t  location,
uint8_t *  data 
)

Read single byte from RTC NVRAM

Parameters:
location location of data in RTC
data Pointer where data we'll be stored
Returns:
DS1338 status code

Definition at line 184 of file ds1338.c.

References NO_ERROR, twi_receive(), and twi_stop().

ds1338_status ds1338_readTimeDateControl ( ds1338TDC data  ) 

Retrieves Time/Data data from RTC

Parameters:
data Pointer to target memory buffer
Returns:
DS1338 status code

Definition at line 92 of file ds1338.c.

References ds1338_readBufferFromNVRAM().

void ds1338_setup (  ) 

Initiates uC to work with DS1338 twi interface.

Definition at line 15 of file ds1338.c.

References TWI_BITRATE.

ds1338_status ds1338_writeBufferToNVRAM ( uint8_t  location,
uint8_t  lenght,
uint8_t *  data 
)

Writes specified data to RTC NVRAM

Parameters:
location Target starting location
lenght Data lenght
data Pointer to data
Returns:
DS1338 status code

Definition at line 114 of file ds1338.c.

References DEVICE_BUSY, NO_ERROR, RANGE_OUTOFBOUNDS, twi_send(), and twi_stop().

Referenced by ds1338_writeTimeDateControl().

ds1338_status ds1338_writeByteToNVRAM ( uint8_t  location,
uint8_t  data 
)

Writes signle byte to RTC NVRAM

Parameters:
location Target location
data Data to be stored
Returns:
DS1338 status code

Definition at line 165 of file ds1338.c.

References DEVICE_BUSY, NO_ERROR, twi_send(), and twi_stop().

ds1338_status ds1338_writeTimeDateControl ( ds1338TDC data  ) 

Stores data in RTC - sets Time/Date

Parameters:
data Pointer to ds1338TDC structure
Returns:
DS1338 status code

Definition at line 102 of file ds1338.c.

References ds1338_writeBufferToNVRAM().


Generated on Wed Sep 9 20:37:11 2009 for DS1338Library by  doxygen 1.6.1