![]() |
LibDriver DS1307
|
ds1307 base driver modules More...
Data Structures | |
| struct | ds1307_time_s |
| ds1307 time structure definition More... | |
| struct | ds1307_handle_s |
| ds1307 handle structure definition More... | |
| struct | ds1307_info_s |
| ds1307 information structure definition More... | |
Typedefs | |
| typedef struct ds1307_time_s | ds1307_time_t |
| ds1307 time structure definition | |
| typedef struct ds1307_handle_s | ds1307_handle_t |
| ds1307 handle structure definition | |
| typedef struct ds1307_info_s | ds1307_info_t |
| ds1307 information structure definition | |
Enumerations | |
| enum | ds1307_bool_t { DS1307_BOOL_FALSE = 0x00 , DS1307_BOOL_TRUE = 0x01 } |
| ds1307 bool enumeration definition More... | |
| enum | ds1307_am_pm_t { DS1307_AM = 0x00 , DS1307_PM = 0x01 } |
| ds1307 am pm enumeration definition More... | |
| enum | ds1307_format_t { DS1307_FORMAT_12H = 0x01 , DS1307_FORMAT_24H = 0x00 } |
| ds1307 format enumeration definition More... | |
| enum | ds1307_output_level_t { DS1307_OUTPUT_LEVEL_LOW = 0x00 , DS1307_OUTPUT_LEVEL_HIGH = 0x01 } |
| ds1307 output level enumeration definition More... | |
| enum | ds1307_output_mode_t { DS1307_OUTPUT_MODE_LEVEL = 0x00 , DS1307_OUTPUT_MODE_SQUARE_WAVE = 0x01 } |
| ds1307 output mode enumeration definition More... | |
| enum | ds1307_square_wave_frequency_t { DS1307_SQUARE_WAVE_FREQUENCY_1_HZ = 0x00 , DS1307_SQUARE_WAVE_FREQUENCY_4096_HZ = 0x01 , DS1307_SQUARE_WAVE_FREQUENCY_8192_HZ = 0x02 , DS1307_SQUARE_WAVE_FREQUENCY_32768_HZ = 0x03 } |
| ds1307 square wave frequency enumeration definition More... | |
Functions | |
| uint8_t | ds1307_info (ds1307_info_t *info) |
| get chip's information | |
| uint8_t | ds1307_init (ds1307_handle_t *handle) |
| initialize the chip | |
| uint8_t | ds1307_deinit (ds1307_handle_t *handle) |
| close the chip | |
| uint8_t | ds1307_set_time (ds1307_handle_t *handle, ds1307_time_t *t) |
| set the current time | |
| uint8_t | ds1307_get_time (ds1307_handle_t *handle, ds1307_time_t *t) |
| get the current time | |
| uint8_t | ds1307_read_ram (ds1307_handle_t *handle, uint8_t addr, uint8_t *buf, uint8_t len) |
| read ram | |
| uint8_t | ds1307_write_ram (ds1307_handle_t *handle, uint8_t addr, uint8_t *buf, uint8_t len) |
| write ram | |
| uint8_t | ds1307_set_oscillator (ds1307_handle_t *handle, ds1307_bool_t enable) |
| enable or disable the oscillator | |
| uint8_t | ds1307_get_oscillator (ds1307_handle_t *handle, ds1307_bool_t *enable) |
| get the chip oscillator status | |
| uint8_t | ds1307_set_output_level (ds1307_handle_t *handle, ds1307_output_level_t level) |
| set the output level | |
| uint8_t | ds1307_get_output_level (ds1307_handle_t *handle, ds1307_output_level_t *level) |
| get the output level | |
| uint8_t | ds1307_set_output_mode (ds1307_handle_t *handle, ds1307_output_mode_t mode) |
| set the output mode | |
| uint8_t | ds1307_get_output_mode (ds1307_handle_t *handle, ds1307_output_mode_t *mode) |
| get the output mode | |
| uint8_t | ds1307_set_square_wave_frequency (ds1307_handle_t *handle, ds1307_square_wave_frequency_t freq) |
| set the square wave frequency | |
| uint8_t | ds1307_get_square_wave_frequency (ds1307_handle_t *handle, ds1307_square_wave_frequency_t *freq) |
| get the square wave frequency | |
ds1307 base driver modules
| typedef struct ds1307_handle_s ds1307_handle_t |
ds1307 handle structure definition
| typedef struct ds1307_info_s ds1307_info_t |
ds1307 information structure definition
| typedef struct ds1307_time_s ds1307_time_t |
ds1307 time structure definition
| enum ds1307_am_pm_t |
ds1307 am pm enumeration definition
| Enumerator | |
|---|---|
| DS1307_AM | am |
| DS1307_PM | pm |
Definition at line 71 of file driver_ds1307.h.
| enum ds1307_bool_t |
ds1307 bool enumeration definition
| Enumerator | |
|---|---|
| DS1307_BOOL_FALSE | disable function |
| DS1307_BOOL_TRUE | enable function |
Definition at line 62 of file driver_ds1307.h.
| enum ds1307_format_t |
ds1307 format enumeration definition
| Enumerator | |
|---|---|
| DS1307_FORMAT_12H | 12h format |
| DS1307_FORMAT_24H | 24h format |
Definition at line 80 of file driver_ds1307.h.
ds1307 output level enumeration definition
| Enumerator | |
|---|---|
| DS1307_OUTPUT_LEVEL_LOW | low level |
| DS1307_OUTPUT_LEVEL_HIGH | high level |
Definition at line 89 of file driver_ds1307.h.
| enum ds1307_output_mode_t |
ds1307 output mode enumeration definition
| Enumerator | |
|---|---|
| DS1307_OUTPUT_MODE_LEVEL | level mode |
| DS1307_OUTPUT_MODE_SQUARE_WAVE | square wave mode |
Definition at line 98 of file driver_ds1307.h.
ds1307 square wave frequency enumeration definition
| Enumerator | |
|---|---|
| DS1307_SQUARE_WAVE_FREQUENCY_1_HZ | 1Hz |
| DS1307_SQUARE_WAVE_FREQUENCY_4096_HZ | 4.096kHz |
| DS1307_SQUARE_WAVE_FREQUENCY_8192_HZ | 8.192kHz |
| DS1307_SQUARE_WAVE_FREQUENCY_32768_HZ | 32.768kHz |
Definition at line 107 of file driver_ds1307.h.
| uint8_t ds1307_deinit | ( | ds1307_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to a ds1307 handle structure |
Definition at line 933 of file driver_ds1307.c.
| uint8_t ds1307_get_oscillator | ( | ds1307_handle_t * | handle, |
| ds1307_bool_t * | enable ) |
get the chip oscillator status
| [in] | *handle | pointer to a ds1307 handle structure |
| [out] | *enable | pointer to a bool value buffer |
Definition at line 485 of file driver_ds1307.c.
| uint8_t ds1307_get_output_level | ( | ds1307_handle_t * | handle, |
| ds1307_output_level_t * | level ) |
get the output level
| [in] | *handle | pointer to a ds1307 handle structure |
| [out] | *level | pointer to an output level buffer |
Definition at line 567 of file driver_ds1307.c.
| uint8_t ds1307_get_output_mode | ( | ds1307_handle_t * | handle, |
| ds1307_output_mode_t * | mode ) |
get the output mode
| [in] | *handle | pointer to a ds1307 handle structure |
| [out] | *mode | pointer to an output mode buffer |
Definition at line 649 of file driver_ds1307.c.
| uint8_t ds1307_get_square_wave_frequency | ( | ds1307_handle_t * | handle, |
| ds1307_square_wave_frequency_t * | freq ) |
get the square wave frequency
| [in] | *handle | pointer to a ds1307 handle structure |
| [out] | *freq | pointer to a square wave frequency buffer |
Definition at line 731 of file driver_ds1307.c.
| uint8_t ds1307_get_time | ( | ds1307_handle_t * | handle, |
| ds1307_time_t * | t ) |
get the current time
| [in] | *handle | pointer to a ds1307 handle structure |
| [out] | *t | pointer to a time structure |
Definition at line 381 of file driver_ds1307.c.
| uint8_t ds1307_info | ( | ds1307_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to a ds1307 info structure |
Definition at line 1031 of file driver_ds1307.c.
| uint8_t ds1307_init | ( | ds1307_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to a ds1307 handle structure |
Definition at line 871 of file driver_ds1307.c.
| uint8_t ds1307_read_ram | ( | ds1307_handle_t * | handle, |
| uint8_t | addr, | ||
| uint8_t * | buf, | ||
| uint8_t | len ) |
read ram
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | addr | ram address |
| [out] | *buf | pointer to a data buffer |
| [in] | len | buffer length |
Definition at line 772 of file driver_ds1307.c.
| uint8_t ds1307_set_oscillator | ( | ds1307_handle_t * | handle, |
| ds1307_bool_t | enable ) |
enable or disable the oscillator
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | enable | bool value |
Definition at line 440 of file driver_ds1307.c.
| uint8_t ds1307_set_output_level | ( | ds1307_handle_t * | handle, |
| ds1307_output_level_t | level ) |
set the output level
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | level | output level |
Definition at line 522 of file driver_ds1307.c.
| uint8_t ds1307_set_output_mode | ( | ds1307_handle_t * | handle, |
| ds1307_output_mode_t | mode ) |
set the output mode
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | mode | output mode |
Definition at line 604 of file driver_ds1307.c.
| uint8_t ds1307_set_square_wave_frequency | ( | ds1307_handle_t * | handle, |
| ds1307_square_wave_frequency_t | freq ) |
set the square wave frequency
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | freq | square wave frequency |
Definition at line 686 of file driver_ds1307.c.
| uint8_t ds1307_set_time | ( | ds1307_handle_t * | handle, |
| ds1307_time_t * | t ) |
set the current time
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | *t | pointer to a time structure |
Definition at line 184 of file driver_ds1307.c.
| uint8_t ds1307_write_ram | ( | ds1307_handle_t * | handle, |
| uint8_t | addr, | ||
| uint8_t * | buf, | ||
| uint8_t | len ) |
write ram
| [in] | *handle | pointer to a ds1307 handle structure |
| [in] | addr | ram address |
| [in] | *buf | pointer to a data buffer |
| [in] | len | buffer length |
Definition at line 824 of file driver_ds1307.c.