191 time_in.
year = rand() % 100 + 2000;
192 time_in.
month = rand() % 12 + 1;
193 time_in.
date = rand() % 20 + 1;
194 time_in.
date = rand() % 20 + 1;
195 time_in.
week = rand() % 7 + 1;
196 time_in.
hour = rand() % 11 + 1;
197 time_in.
minute = rand() % 60;
198 time_in.
second = rand() % 60;
211 for (i = 0; i < times; i++)
231 time_in.
year = rand() % 100 + 2090;
232 time_in.
month = rand() % 12 + 1;
233 time_in.
date = rand() % 20 + 1;
234 time_in.
week = rand() % 7 + 1;
235 time_in.
hour = rand() % 12 + 12;
236 time_in.
minute = rand() % 60;
237 time_in.
second = rand() % 60;
250 for (i = 0; i < times; i++)
267 for (i = 0; i < times; i++)
driver ds3231 readwrite test header file
uint8_t ds3231_set_aging_offset(ds3231_handle_t *handle, int8_t offset)
set the chip aging offset
uint8_t ds3231_get_temperature(ds3231_handle_t *handle, int16_t *raw, float *s)
get the chip temperature
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_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_set_alarm_interrupt(ds3231_handle_t *handle, ds3231_alarm_t alarm, ds3231_bool_t enable)
enable or disable the alarm interrupt
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
struct ds3231_time_s ds3231_time_t
ds3231 time structure 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
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_readwrite_test(uint32_t times)
readwrite test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v