LibDriver DS3231
Loading...
Searching...
No Matches
ds3231 advance driver function

ds3231 advance driver modules More...

Collaboration diagram for ds3231 advance driver function:

Functions

uint8_t ds3231_set_pin (ds3231_handle_t *handle, ds3231_pin_t pin)
 set the chip pin function
uint8_t ds3231_get_pin (ds3231_handle_t *handle, ds3231_pin_t *pin)
 get the chip pin function
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_set_32khz_output (ds3231_handle_t *handle, ds3231_bool_t enable)
 enable or disable the 32KHz output
uint8_t ds3231_get_32khz_output (ds3231_handle_t *handle, ds3231_bool_t *enable)
 get the 32KHz output status
uint8_t ds3231_get_temperature (ds3231_handle_t *handle, int16_t *raw, float *s)
 get the chip temperature
uint8_t ds3231_set_aging_offset (ds3231_handle_t *handle, int8_t offset)
 set the chip aging offset
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_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

Detailed Description

ds3231 advance driver modules

Function Documentation

◆ ds3231_aging_offset_convert_to_data()

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

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]regregister raw data
[out]*offsetpointer to a converted aging offset buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1404 of file driver_ds3231.c.

◆ ds3231_aging_offset_convert_to_register()

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

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]offsetconverted aging offset value
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1377 of file driver_ds3231.c.

◆ ds3231_get_32khz_output()

uint8_t ds3231_get_32khz_output ( ds3231_handle_t * handle,
ds3231_bool_t * enable )

get the 32KHz output status

Parameters
[in]*handlepointer to a ds3231 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get 32khz output failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1688 of file driver_ds3231.c.

◆ ds3231_get_aging_offset()

uint8_t ds3231_get_aging_offset ( ds3231_handle_t * handle,
int8_t * offset )

get the chip aging offset

Parameters
[in]*handlepointer to a ds3231 handle structure
[out]*offsetpointer to a time aging offset buffer
Returns
status code
  • 0 success
  • 1 get aging offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1342 of file driver_ds3231.c.

◆ ds3231_get_pin()

uint8_t ds3231_get_pin ( ds3231_handle_t * handle,
ds3231_pin_t * pin )

get the chip pin function

Parameters
[in]*handlepointer to a ds3231 handle structure
[out]*pinpointer to a pin's function buffer
Returns
status code
  • 0 success
  • 1 get pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1067 of file driver_ds3231.c.

◆ ds3231_get_square_wave()

uint8_t ds3231_get_square_wave ( ds3231_handle_t * handle,
ds3231_bool_t * enable )

get the square wave output status

Parameters
[in]*handlepointer to a ds3231 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get square wave failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1149 of file driver_ds3231.c.

◆ ds3231_get_temperature()

uint8_t ds3231_get_temperature ( ds3231_handle_t * handle,
int16_t * raw,
float * s )

get the chip temperature

Parameters
[in]*handlepointer to a ds3231 handle structure
[out]*rawpointer to a raw temperature buffer
[out]*spointer to a converted temperature buffer
Returns
status code
  • 0 success
  • 1 get temperature failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1187 of file driver_ds3231.c.

◆ ds3231_set_32khz_output()

uint8_t ds3231_set_32khz_output ( ds3231_handle_t * handle,
ds3231_bool_t enable )

enable or disable the 32KHz output

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set 32khz output failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1643 of file driver_ds3231.c.

◆ ds3231_set_aging_offset()

uint8_t ds3231_set_aging_offset ( ds3231_handle_t * handle,
int8_t offset )

set the chip aging offset

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]offsettime aging offset
Returns
status code
  • 0 success
  • 1 set aging offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1307 of file driver_ds3231.c.

◆ ds3231_set_pin()

uint8_t ds3231_set_pin ( ds3231_handle_t * handle,
ds3231_pin_t pin )

set the chip pin function

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]pinpin function
Returns
status code
  • 0 success
  • 1 set pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1022 of file driver_ds3231.c.

◆ ds3231_set_square_wave()

uint8_t ds3231_set_square_wave ( ds3231_handle_t * handle,
ds3231_bool_t enable )

enable or disable the square wave output

Parameters
[in]*handlepointer to a ds3231 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set square wave failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1104 of file driver_ds3231.c.