ups3 2.0.0.0
|
API for configuring and manipulating UPS 3 Click driver. More...
Topics | |
UPS 3 MikroBUS Map | |
MikroBUS pin mapping of UPS 3 Click driver. | |
Dir_mode | |
Enable | |
Get_error | |
Get_cap_ok | |
Get_chrg | |
Status | |
Functions | |
void | ups3_cfg_setup (ups3_cfg_t *cfg) |
UPS 3 configuration object setup function. | |
err_t | ups3_init (ups3_t *ctx, ups3_cfg_t *cfg) |
UPS 3 initialization function. | |
err_t | ups3_default_cfg (ups3_t *ctx) |
UPS 3 default configuration function. | |
uint8_t | ups3_get_error (ups3_t *ctx) |
UPS 3 get error function. | |
uint8_t | ups3_get_cap_ok (ups3_t *ctx) |
UPS 3 pin get capacitor ok function. | |
uint8_t | ups3_get_chrg (ups3_t *ctx) |
UPS 3 get charge/backup mode function. | |
err_t | ups3_select_dir_mode (ups3_t *ctx, uint8_t dir_mode) |
UPS 3 pin select direction of the operation modes function. | |
err_t | ups3_set_enable (ups3_t *ctx, uint8_t enable) |
UPS 3 enable device function. | |
err_t | ups3_hw_reset (ups3_t *ctx) |
UPS 3 reset the device function. | |
API for configuring and manipulating UPS 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ups3_cfg_setup | ( | ups3_cfg_t * | cfg | ) |
UPS 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ups3_cfg_t object definition for detailed explanation. |
err_t ups3_default_cfg | ( | ups3_t * | ctx | ) |
UPS 3 default configuration function.
This function executes a default configuration of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t ups3_get_cap_ok | ( | ups3_t * | ctx | ) |
UPS 3 pin get capacitor ok function.
This function reads the state of the COK ( RST ) pin of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
0
- FBVcap voltage is lower than falling threshold, 1
- FBVcap is higher than the rising threshold.uint8_t ups3_get_chrg | ( | ups3_t * | ctx | ) |
UPS 3 get charge/backup mode function.
This function reads the state of the INT pin of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
0
- Regulator is in charge mode, 1
- Regulator is in backup mode.uint8_t ups3_get_error | ( | ups3_t * | ctx | ) |
UPS 3 get error function.
This function reads the state of the ERR ( AN ) pin of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
0
- CMPIN pin voltage is above the comparator rising threshold, 1
- CMPIN is below the falling threshold.err_t ups3_hw_reset | ( | ups3_t * | ctx | ) |
UPS 3 reset the device function.
This function executes a hardware reset of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ups3_init | ( | ups3_t * | ctx, |
ups3_cfg_t * | cfg ) |
UPS 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ups3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ups3_select_dir_mode | ( | ups3_t * | ctx, |
uint8_t | dir_mode ) |
UPS 3 pin select direction of the operation modes function.
This function sets the DIR ( CS ) pin on the low or high level of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
[in] | dir_mode | : Direction of the operation modes.
|
0
- Success, -1
- Error.err_t ups3_set_enable | ( | ups3_t * | ctx, |
uint8_t | enable ) |
UPS 3 enable device function.
This function sets the EN ( PWM ) pin on the low or high level of UPS 3 click board.
[in] | ctx | : Click context object. See ups3_t object definition for detailed explanation. |
[in] | enable | : Logic-Controlled Shutdown.
|
0
- Success, -1
- Error.