53 int8_t offset, offset_check;
113 time_in.
year = rand() % 100 + 2000;
114 time_in.
month = rand() % 12 + 1;
115 time_in.
date = rand() % 20 + 1;
116 time_in.
date = rand() % 20 + 1;
117 time_in.
week = rand() % 7 + 1;
118 time_in.
hour = rand() % 11 + 1;
119 time_in.
minute = rand() % 60;
120 time_in.
second = rand() % 60;
146 time_in.
year = rand() % 100 + 2090;
147 time_in.
month = rand() % 12 + 1;
148 time_in.
date = rand() % 20 + 1;
149 time_in.
week = rand() % 7 + 1;
150 time_in.
hour = rand() % 24;
151 time_in.
minute = rand() % 60;
152 time_in.
second = rand() % 60;
183 time_in.
week = rand() % 7 + 1;
185 time_in.
hour = rand() % 11 + 1;
186 time_in.
minute = rand() % 60;
187 time_in.
second = rand() % 60;
216 time_in.
week = rand() % 7 + 1;
218 time_in.
hour = rand() % 24;
219 time_in.
minute = rand() % 60;
220 time_in.
second = rand() % 60;
249 time_in.
week = rand() % 7 + 1;
250 time_in.
date = rand() % 20 + 1;
251 time_in.
hour = rand() % 24;
252 time_in.
minute = rand() % 60;
253 time_in.
second = rand() % 60;
282 time_in.
week = rand() % 7 + 1;
283 time_in.
date = rand() % 20 + 1;
284 time_in.
hour = rand() % 24;
285 time_in.
minute = rand() % 60;
286 time_in.
second = rand() % 60;
315 time_in.
week = rand() % 7 + 1;
316 time_in.
date = rand() % 20 + 1;
317 time_in.
hour = rand() % 24;
318 time_in.
minute = rand() % 60;
319 time_in.
second = rand() % 60;
348 time_in.
week = rand() % 7 + 1;
349 time_in.
date = rand() % 20 + 1;
350 time_in.
hour = rand() % 24;
351 time_in.
minute = rand() % 60;
352 time_in.
second = rand() % 60;
381 time_in.
week = rand() % 7 + 1;
382 time_in.
date = rand() % 20 + 1;
383 time_in.
hour = rand() % 24;
384 time_in.
minute = rand() % 60;
385 time_in.
second = rand() % 60;
414 time_in.
week = rand() % 7 + 1;
415 time_in.
date = rand() % 20 + 1;
416 time_in.
hour = rand() % 24;
417 time_in.
minute = rand() % 60;
418 time_in.
second = rand() % 60;
450 time_in.
week = rand() % 7 + 1;
451 time_in.
date = rand() % 20 + 1;
452 time_in.
hour = rand() % 11 + 1;
453 time_in.
minute = rand() % 60;
483 time_in.
week = rand() % 7 + 1;
484 time_in.
date = rand() % 20 + 1;
485 time_in.
hour = rand() % 24;
486 time_in.
minute = rand() % 60;
516 time_in.
week = rand() % 7 + 1;
517 time_in.
date = rand() % 20 + 1;
518 time_in.
hour = rand() % 24;
519 time_in.
minute = rand() % 60;
549 time_in.
week = rand() % 7 + 1;
550 time_in.
date = rand() % 20 + 1;
551 time_in.
hour = rand() % 24;
552 time_in.
minute = rand() % 60;
582 time_in.
week = rand() % 7 + 1;
583 time_in.
date = rand() % 20 + 1;
584 time_in.
hour = rand() % 24;
585 time_in.
minute = rand() % 60;
615 time_in.
week = rand() % 7 + 1;
616 time_in.
date = rand() % 20 + 1;
617 time_in.
hour = rand() % 24;
618 time_in.
minute = rand() % 60;
648 time_in.
week = rand() % 7 + 1;
649 time_in.
date = rand() % 20 + 1;
650 time_in.
hour = rand() % 24;
651 time_in.
minute = rand() % 60;
933 offset = -(rand() % 128);
967 o = (float)(rand() % 100) /100.0f;
driver ds3231 register test header file
uint8_t ds3231_get_32khz_output(ds3231_handle_t *handle, ds3231_bool_t *enable)
get the 32KHz output status
uint8_t ds3231_get_pin(ds3231_handle_t *handle, ds3231_pin_t *pin)
get the chip pin function
uint8_t ds3231_set_aging_offset(ds3231_handle_t *handle, int8_t offset)
set the chip aging offset
uint8_t ds3231_set_pin(ds3231_handle_t *handle, ds3231_pin_t pin)
set the chip pin function
uint8_t ds3231_aging_offset_convert_to_data(ds3231_handle_t *handle, int8_t reg, float *offset)
convert a register raw data to a converted aging offset data
uint8_t ds3231_get_aging_offset(ds3231_handle_t *handle, int8_t *offset)
get the chip aging offset
uint8_t ds3231_aging_offset_convert_to_register(ds3231_handle_t *handle, float offset, int8_t *reg)
convert a aging offset value to a register raw data
uint8_t ds3231_set_32khz_output(ds3231_handle_t *handle, ds3231_bool_t enable)
enable or disable the 32KHz output
uint8_t ds3231_set_square_wave(ds3231_handle_t *handle, ds3231_bool_t enable)
enable or disable the square wave output
uint8_t ds3231_get_square_wave(ds3231_handle_t *handle, ds3231_bool_t *enable)
get the square wave output status
uint8_t ds3231_get_alarm_interrupt(ds3231_handle_t *handle, ds3231_alarm_t alarm, ds3231_bool_t *enable)
get the alarm interrupt status
uint8_t ds3231_set_alarm_interrupt(ds3231_handle_t *handle, ds3231_alarm_t alarm, ds3231_bool_t enable)
enable or disable the alarm interrupt
ds3231_alarm2_mode_t
ds3231 alarm2 enumeration definition
uint8_t ds3231_get_alarm1(ds3231_handle_t *handle, ds3231_time_t *t, ds3231_alarm1_mode_t *mode)
get the alarm1 time
ds3231_alarm1_mode_t
ds3231 alarm1 enumeration definition
uint8_t ds3231_set_alarm2(ds3231_handle_t *handle, ds3231_time_t *t, ds3231_alarm2_mode_t mode)
set the alarm2 time
uint8_t ds3231_set_alarm1(ds3231_handle_t *handle, ds3231_time_t *t, ds3231_alarm1_mode_t mode)
set the alarm1 time
uint8_t ds3231_get_alarm2(ds3231_handle_t *handle, ds3231_time_t *t, ds3231_alarm2_mode_t *mode)
get the alarm2 time
@ DS3231_ALARM2_MODE_ONCE_A_MINUTE
@ DS3231_ALARM2_MODE_WEEK_HOUR_MINUTE_MATCH
@ DS3231_ALARM2_MODE_HOUR_MINUTE_MATCH
@ DS3231_ALARM2_MODE_MINUTE_MATCH
@ DS3231_ALARM2_MODE_DATE_HOUR_MINUTE_MATCH
@ DS3231_ALARM1_MODE_WEEK_HOUR_MINUTE_SECOND_MATCH
@ DS3231_ALARM1_MODE_ONCE_A_SECOND
@ DS3231_ALARM1_MODE_MINUTE_SECOND_MATCH
@ DS3231_ALARM1_MODE_SECOND_MATCH
@ DS3231_ALARM1_MODE_HOUR_MINUTE_SECOND_MATCH
@ DS3231_ALARM1_MODE_DATE_HOUR_MINUTE_SECOND_MATCH
uint8_t ds3231_set_oscillator(ds3231_handle_t *handle, ds3231_bool_t enable)
enable or disable the oscillator
uint8_t ds3231_set_time(ds3231_handle_t *handle, ds3231_time_t *t)
set the current time
uint8_t ds3231_get_oscillator(ds3231_handle_t *handle, ds3231_bool_t *enable)
get the chip oscillator status
struct ds3231_time_s ds3231_time_t
ds3231 time structure definition
ds3231_pin_t
ds3231 pin enumeration definition
uint8_t ds3231_info(ds3231_info_t *info)
get chip's information
struct ds3231_handle_s ds3231_handle_t
ds3231 handle structure definition
uint8_t ds3231_init(ds3231_handle_t *handle)
initialize the chip
struct ds3231_info_s ds3231_info_t
ds3231 information structure definition
uint8_t ds3231_get_time(ds3231_handle_t *handle, ds3231_time_t *t)
get the current time
uint8_t ds3231_deinit(ds3231_handle_t *handle)
close the chip
ds3231_bool_t
ds3231 bool enumeration definition
uint8_t ds3231_get_status(ds3231_handle_t *handle, uint8_t *status)
get the chip status
uint8_t ds3231_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t ds3231_interface_iic_init(void)
interface iic bus init
uint8_t ds3231_interface_iic_deinit(void)
interface iic bus deinit
void ds3231_interface_delay_ms(uint32_t ms)
interface delay ms
void ds3231_interface_debug_print(const char *const fmt,...)
interface print format data
void ds3231_interface_receive_callback(uint8_t type)
interface receive callback
uint8_t ds3231_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
#define DRIVER_DS3231_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_DS3231_LINK_INIT(HANDLE, STRUCTURE)
initialize ds3231_handle_t structure
#define DRIVER_DS3231_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_DS3231_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_DS3231_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_DS3231_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_DS3231_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_DS3231_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
uint8_t ds3231_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v