|
powerbank2
2.0.0.0
|
Functions | |
| void | powerbank2_cfg_setup (powerbank2_cfg_t *cfg) |
| Config Object Initialization function. More... | |
| POWERBANK2_RETVAL | powerbank2_init (powerbank2_t *ctx, powerbank2_cfg_t *cfg) |
| Initialization function. More... | |
| void | powerbank2_generic_write (powerbank2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
| Generic write function. More... | |
| void | powerbank2_read (powerbank2_t *ctx, uint16_t *result) |
| Read function. More... | |
| uint16_t | powerbank2_read_voltage (powerbank2_t *ctx, uint16_t v_ref) |
| Read voltage function. More... | |
| void powerbank2_cfg_setup | ( | powerbank2_cfg_t * | cfg | ) |
Config Object Initialization function.
| cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
| void powerbank2_generic_write | ( | powerbank2_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_buf, | ||
| uint8_t | len | ||
| ) |
Generic write function.
| ctx | Click object. |
| reg | Register address. |
| data_buf | Data buf to be written. |
| len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
| POWERBANK2_RETVAL powerbank2_init | ( | powerbank2_t * | ctx, |
| powerbank2_cfg_t * | cfg | ||
| ) |
Initialization function.
| powerbank2 | Click object. |
| cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
| void powerbank2_read | ( | powerbank2_t * | ctx, |
| uint16_t * | result | ||
| ) |
Read function.
| ctx | Click object. |
| result | Result. |
@description This function reads data from the desired register.
| uint16_t powerbank2_read_voltage | ( | powerbank2_t * | ctx, |
| uint16_t | v_ref | ||
| ) |
Read voltage function.
| ctx | Click object. |
| v_ref | 16-bit value representing power supply voltage. |
@description This function is used to calculate voltage of the connected battery.