charger8 2.0.0.0
|
Functions | |
void | charger8_cfg_setup (charger8_cfg_t *cfg) |
Config Object Initialization function. | |
CHARGER8_RETVAL | charger8_init (charger8_t *ctx, charger8_cfg_t *cfg) |
Initialization function. | |
void | charger8_default_cfg (charger8_t *ctx) |
Click Default Configuration function. | |
void | charger8_generic_write (charger8_t *ctx, uint8_t reg, uint16_t data_wr) |
Generic write function. | |
uint16_t | charger8_generic_read (charger8_t *ctx, uint8_t reg) |
Generic read function. | |
void | charger8_enable (charger8_t *ctx, uint8_t enable) |
Functions for enable or disable device. | |
float | charger8_get_temperature (charger8_t *ctx) |
Functions for read Temperature of the chip. | |
float | charger8_get_current (charger8_t *ctx) |
Functions for reading the current charging battery. | |
float | charger8_get_voltage (charger8_t *ctx) |
Functions for reading the voltage of the battery. | |
uint8_t | charger8_get_soc (charger8_t *ctx) |
Function for reads the percentage of the battery charge. | |
uint16_t | charger8_get_capacity (charger8_t *ctx) |
Function for reads the current capacity of the battery. | |
float | charger8_get_time_to_empty (charger8_t *ctx) |
Function for reads the Time to Empty data. | |
float | charger8_get_time_to_full (charger8_t *ctx) |
Function for reads the Time to Full data. | |
uint16_t | charger8_get_status (charger8_t *ctx) |
Function for reads the Status register. | |
void | charger8_reset (charger8_t *ctx) |
General reset procedure. | |
uint8_t | charger8_get_fault_output (charger8_t *ctx) |
Function for reads FAULT pin state. | |
void | charger8_set_usb_suspend (charger8_t *ctx, uint8_t mode) |
Function for set USB Suspand pin. | |
void | charger8_set_alert (charger8_t *ctx, uint8_t state) |
Function for set Alert pin state. | |
uint8_t | charger8_get_dc_power_ok (charger8_t *ctx) |
Function for reads DC power pin state. | |
void | charger8_set_max_battery_capacity (charger8_t *ctx, uint16_t capacity) |
Function for set Max battery capacity in [mAh]. | |
void charger8_cfg_setup | ( | charger8_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void charger8_default_cfg | ( | charger8_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Charger8 click.
void charger8_enable | ( | charger8_t * | ctx, |
uint8_t | enable ) |
Functions for enable or disable device.
ctx | Click object. | |
[in] | enable | Enable or Disable device |
@description Use this function when enable or disable device.
uint16_t charger8_generic_read | ( | charger8_t * | ctx, |
uint8_t | reg ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
read | data |
@description This function reads data from the desired register.
void charger8_generic_write | ( | charger8_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_wr ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_wr | Data to be written. |
@description This function writes data to the desired register.
uint16_t charger8_get_capacity | ( | charger8_t * | ctx | ) |
Function for reads the current capacity of the battery.
Current | capacity of the battery in [mAh] |
ctx | Click object. |
@description To get the correct current battery capacity, it is necessary to set the maximum capacity of the battery beforehand.
float charger8_get_current | ( | charger8_t * | ctx | ) |
Functions for reading the current charging battery.
Current | data in [mA] |
ctx | Click object. |
@description Use this function when read current.
uint8_t charger8_get_dc_power_ok | ( | charger8_t * | ctx | ) |
Function for reads DC power pin state.
DC | Power OK pin state |
ctx | Click object. |
@description Use this function to read DC power pin state.
uint8_t charger8_get_fault_output | ( | charger8_t * | ctx | ) |
Function for reads FAULT pin state.
FAULT | pin state |
ctx | Click object. |
@description Use this function to read FAULT pin state.
uint8_t charger8_get_soc | ( | charger8_t * | ctx | ) |
Function for reads the percentage of the battery charge.
Percentage | of battery charge |
ctx | Click object. |
@description Use this function when reading pecentage of the battery charge.
uint16_t charger8_get_status | ( | charger8_t * | ctx | ) |
Function for reads the Status register.
data | read from the status register |
ctx | Click object. |
@description Use this function to read the Status register.
float charger8_get_temperature | ( | charger8_t * | ctx | ) |
Functions for read Temperature of the chip.
Temperature | of the chip (data in [C]) |
ctx | Click object. |
@description Use this function when read temperature of the chip.
float charger8_get_time_to_empty | ( | charger8_t * | ctx | ) |
Function for reads the Time to Empty data.
Time | to empty data in [s] |
ctx | Click object. |
@descritpion Use this function to read Time until empty data.
float charger8_get_time_to_full | ( | charger8_t * | ctx | ) |
Function for reads the Time to Full data.
Time | to full data im [s] |
ctx | Click object. |
@descritpion Use this function to read Time until Full data.
float charger8_get_voltage | ( | charger8_t * | ctx | ) |
Functions for reading the voltage of the battery.
Voltage | of the battery in [mV] |
ctx | Click object. |
@description Use this function when read voltage of the battery.
CHARGER8_RETVAL charger8_init | ( | charger8_t * | ctx, |
charger8_cfg_t * | cfg ) |
Initialization function.
charger8 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void charger8_reset | ( | charger8_t * | ctx | ) |
General reset procedure.
ctx | Click object. |
@description Use this function for general reset.
void charger8_set_alert | ( | charger8_t * | ctx, |
uint8_t | state ) |
Function for set Alert pin state.
[in] | state | Alert mode (enable or disable) |
ctx | Click object. |
@description Use this function to set Alert pin state.
void charger8_set_max_battery_capacity | ( | charger8_t * | ctx, |
uint16_t | capacity ) |
Function for set Max battery capacity in [mAh].
ctx | Click object. |
capacity | Max battery capacity in [mAh] |
@description Use this function to set Max battery capacity in [mAh]
void charger8_set_usb_suspend | ( | charger8_t * | ctx, |
uint8_t | mode ) |
Function for set USB Suspand pin.
[in] | mode | USB Suspand mode (enable or disable) |
ctx | Click object. |
@description Use this function to set USB Suspand pin.