#include <stdint.h>Go to the source code of this file.
Data Structures | |
| union | ds1338DateTimeControl |
Defines | |
| #define | DEVICE 0xD0 |
| DS1338 7 bit Address (aligned to left). | |
| #define | WRITE 0x00 |
| I2C write command. | |
| #define | READ 0x01 |
| I2C read command. | |
| #define | TWI_BITRATE 25000 |
| TWI bitrate. | |
Typedefs | |
| typedef union ds1338DateTimeControl | ds1338TDC |
Enumerations | |
| enum | ds1338_status { NO_ERROR, LOCATION_OUTOFBOUNDS, RANGE_OUTOFBOUNDS, NO_DEVICE, DEVICE_BUSY, BUS_ERROR } |
Functions | |
| void | ds1338_setup () |
| ds1338_status | ds1338_readTimeDateControl (ds1338TDC *data) |
| ds1338_status | ds1338_writeTimeDateControl (ds1338TDC *data) |
| ds1338_status | ds1338_writeBufferToNVRAM (uint8_t start, uint8_t lenght, uint8_t *data) |
| ds1338_status | ds1338_readBufferFromNVRAM (uint8_t start, 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) |
Definition in file ds1338.h.
| typedef union ds1338DateTimeControl ds1338TDC |
Union storing Date/Time data, compiler dependant, tested only with AVR-GCC
| enum ds1338_status |
| ds1338_status ds1338_readBufferFromNVRAM | ( | uint8_t | location, | |
| uint8_t | lenght, | |||
| uint8_t * | data | |||
| ) |
Read data from RTC NVRAM
| location | Starting location of readed data | |
| lenght | Lenght of read data | |
| data | Pointer where data we'll be stored |
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
| location | location of data in RTC | |
| data | Pointer where data we'll be stored |
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
| data | Pointer to target memory buffer |
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
| location | Target starting location | |
| lenght | Data lenght | |
| data | Pointer to data |
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
| location | Target location | |
| data | Data to be stored |
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
| data | Pointer to ds1338TDC structure |
Definition at line 102 of file ds1338.c.
References ds1338_writeBufferToNVRAM().
1.6.1