charger8 2.0.0.0
Public function

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].
 

Detailed Description

Function Documentation

◆ charger8_cfg_setup()

void charger8_cfg_setup ( charger8_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ charger8_default_cfg()

void charger8_default_cfg ( charger8_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Charger8 click.

◆ charger8_enable()

void charger8_enable ( charger8_t * ctx,
uint8_t enable )

Functions for enable or disable device.

Parameters
ctxClick object.
[in]enableEnable or Disable device

@description Use this function when enable or disable device.

◆ charger8_generic_read()

uint16_t charger8_generic_read ( charger8_t * ctx,
uint8_t reg )

Generic read function.

Parameters
ctxClick object.
regRegister address.
Return values
readdata

@description This function reads data from the desired register.

◆ charger8_generic_write()

void charger8_generic_write ( charger8_t * ctx,
uint8_t reg,
uint16_t data_wr )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_wrData to be written.

@description This function writes data to the desired register.

◆ charger8_get_capacity()

uint16_t charger8_get_capacity ( charger8_t * ctx)

Function for reads the current capacity of the battery.

Return values
Currentcapacity of the battery in [mAh]
Parameters
ctxClick object.

@description To get the correct current battery capacity, it is necessary to set the maximum capacity of the battery beforehand.

◆ charger8_get_current()

float charger8_get_current ( charger8_t * ctx)

Functions for reading the current charging battery.

Return values
Currentdata in [mA]
Parameters
ctxClick object.

@description Use this function when read current.

◆ charger8_get_dc_power_ok()

uint8_t charger8_get_dc_power_ok ( charger8_t * ctx)

Function for reads DC power pin state.

Return values
DCPower OK pin state
Parameters
ctxClick object.

@description Use this function to read DC power pin state.

◆ charger8_get_fault_output()

uint8_t charger8_get_fault_output ( charger8_t * ctx)

Function for reads FAULT pin state.

Return values
FAULTpin state
Parameters
ctxClick object.

@description Use this function to read FAULT pin state.

◆ charger8_get_soc()

uint8_t charger8_get_soc ( charger8_t * ctx)

Function for reads the percentage of the battery charge.

Return values
Percentageof battery charge
Parameters
ctxClick object.

@description Use this function when reading pecentage of the battery charge.

◆ charger8_get_status()

uint16_t charger8_get_status ( charger8_t * ctx)

Function for reads the Status register.

Return values
dataread from the status register
Parameters
ctxClick object.

@description Use this function to read the Status register.

◆ charger8_get_temperature()

float charger8_get_temperature ( charger8_t * ctx)

Functions for read Temperature of the chip.

Return values
Temperatureof the chip (data in [C])
Parameters
ctxClick object.

@description Use this function when read temperature of the chip.

◆ charger8_get_time_to_empty()

float charger8_get_time_to_empty ( charger8_t * ctx)

Function for reads the Time to Empty data.

Return values
Timeto empty data in [s]
Parameters
ctxClick object.

@descritpion Use this function to read Time until empty data.

◆ charger8_get_time_to_full()

float charger8_get_time_to_full ( charger8_t * ctx)

Function for reads the Time to Full data.

Return values
Timeto full data im [s]
Parameters
ctxClick object.

@descritpion Use this function to read Time until Full data.

◆ charger8_get_voltage()

float charger8_get_voltage ( charger8_t * ctx)

Functions for reading the voltage of the battery.

Return values
Voltageof the battery in [mV]
Parameters
ctxClick object.

@description Use this function when read voltage of the battery.

◆ charger8_init()

CHARGER8_RETVAL charger8_init ( charger8_t * ctx,
charger8_cfg_t * cfg )

Initialization function.

Parameters
charger8Click object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ charger8_reset()

void charger8_reset ( charger8_t * ctx)

General reset procedure.

Parameters
ctxClick object.

@description Use this function for general reset.

◆ charger8_set_alert()

void charger8_set_alert ( charger8_t * ctx,
uint8_t state )

Function for set Alert pin state.

Parameters
[in]stateAlert mode (enable or disable)
ctxClick object.

@description Use this function to set Alert pin state.

◆ charger8_set_max_battery_capacity()

void charger8_set_max_battery_capacity ( charger8_t * ctx,
uint16_t capacity )

Function for set Max battery capacity in [mAh].

Parameters
ctxClick object.
capacityMax battery capacity in [mAh]

@description Use this function to set Max battery capacity in [mAh]

◆ charger8_set_usb_suspend()

void charger8_set_usb_suspend ( charger8_t * ctx,
uint8_t mode )

Function for set USB Suspand pin.

Parameters
[in]modeUSB Suspand mode (enable or disable)
ctxClick object.

@description Use this function to set USB Suspand pin.