119 time_in.
year = rand() % 100 + 2000;
120 time_in.
month = rand() % 12 + 1;
121 time_in.
date = rand() % 20 + 1;
122 time_in.
week = rand() % 7 + 1;
123 time_in.
hour = rand() % 11 + 1;
124 time_in.
minute = rand() % 60;
125 time_in.
second = rand() % 60;
151 time_in.
year = rand() % 100 + 2000;
152 time_in.
month = rand() % 12 + 1;
153 time_in.
date = rand() % 20 + 1;
154 time_in.
week = rand() % 7 + 1;
155 time_in.
hour = rand() % 24;
156 time_in.
minute = rand() % 60;
157 time_in.
second = rand() % 60;
driver ds1307 register test header file
uint8_t ds1307_info(ds1307_info_t *info)
get chip's information
struct ds1307_info_s ds1307_info_t
ds1307 information structure definition
uint8_t ds1307_get_output_level(ds1307_handle_t *handle, ds1307_output_level_t *level)
get the output level
struct ds1307_handle_s ds1307_handle_t
ds1307 handle structure definition
ds1307_square_wave_frequency_t
ds1307 square wave frequency enumeration definition
uint8_t ds1307_get_square_wave_frequency(ds1307_handle_t *handle, ds1307_square_wave_frequency_t *freq)
get the square wave frequency
uint8_t ds1307_get_oscillator(ds1307_handle_t *handle, ds1307_bool_t *enable)
get the chip oscillator status
uint8_t ds1307_set_output_mode(ds1307_handle_t *handle, ds1307_output_mode_t mode)
set the output mode
struct ds1307_time_s ds1307_time_t
ds1307 time structure definition
uint8_t ds1307_get_output_mode(ds1307_handle_t *handle, ds1307_output_mode_t *mode)
get the output mode
uint8_t ds1307_set_oscillator(ds1307_handle_t *handle, ds1307_bool_t enable)
enable or disable the oscillator
uint8_t ds1307_init(ds1307_handle_t *handle)
initialize the chip
uint8_t ds1307_set_time(ds1307_handle_t *handle, ds1307_time_t *t)
set the current time
ds1307_output_level_t
ds1307 output level enumeration definition
uint8_t ds1307_set_output_level(ds1307_handle_t *handle, ds1307_output_level_t level)
set the output level
uint8_t ds1307_set_square_wave_frequency(ds1307_handle_t *handle, ds1307_square_wave_frequency_t freq)
set the square wave frequency
ds1307_bool_t
ds1307 bool enumeration definition
uint8_t ds1307_deinit(ds1307_handle_t *handle)
close the chip
uint8_t ds1307_get_time(ds1307_handle_t *handle, ds1307_time_t *t)
get the current time
ds1307_output_mode_t
ds1307 output mode enumeration definition
@ DS1307_SQUARE_WAVE_FREQUENCY_4096_HZ
@ DS1307_SQUARE_WAVE_FREQUENCY_8192_HZ
@ DS1307_SQUARE_WAVE_FREQUENCY_32768_HZ
@ DS1307_SQUARE_WAVE_FREQUENCY_1_HZ
@ DS1307_OUTPUT_LEVEL_HIGH
@ DS1307_OUTPUT_LEVEL_LOW
@ DS1307_OUTPUT_MODE_SQUARE_WAVE
@ DS1307_OUTPUT_MODE_LEVEL
void ds1307_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ds1307_interface_iic_deinit(void)
interface iic bus deinit
uint8_t ds1307_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t ds1307_interface_iic_init(void)
interface iic bus init
uint8_t ds1307_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
void ds1307_interface_delay_ms(uint32_t ms)
interface delay ms
#define DRIVER_DS1307_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_DS1307_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_DS1307_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_DS1307_LINK_INIT(HANDLE, STRUCTURE)
initialize ds1307_handle_t structure
#define DRIVER_DS1307_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_DS1307_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_DS1307_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
uint8_t ds1307_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v