balancer2 2.0.0.0

Functions

void balancer2_cfg_setup (balancer2_cfg_t *cfg)
 Config Object Initialization function.
 
BALANCER2_RETVAL balancer2_init (balancer2_t *ctx, balancer2_cfg_t *cfg)
 Initialization function.
 
void balancer2_default_cfg (balancer2_t *ctx)
 Click Default Configuration function.
 
void balancer2_cell_1_state (balancer2_t *ctx, uint8_t state)
 Generic function for setting cell 1 pin status.
 
void balancer2_cell_2_state (balancer2_t *ctx, uint8_t state)
 Generic function for setting cell 2 pin status.
 
void balancer2_supply_state (balancer2_t *ctx, uint8_t state)
 Generic function for setting supply pin status.
 
void balancer2_status_led_state (balancer2_t *ctx, uint8_t state)
 Generic function for setting status led pin status.
 
uint16_t balancer2_read_adc (balancer2_t *ctx, uint8_t cmd_byte)
 Function for reading adc value.
 
void balancer2_set_vref (balancer2_t *ctx, uint16_t vref)
 Function for setting reference value.
 
float balancer2_get_batttery_lvl (balancer2_t *ctx, uint8_t bat_num)
 Function for getting real battery lvl.
 
float balancer2_adc_to_mv (balancer2_t *ctx, uint16_t adc_val)
 Function for converting adc value to mV.
 

Detailed Description

Function Documentation

◆ balancer2_adc_to_mv()

float balancer2_adc_to_mv ( balancer2_t * ctx,
uint16_t adc_val )

Function for converting adc value to mV.

Parameters
ctxClick object.
adc_valAdc value.
Returns
Return converted data

@description This function converting adc value to mV.

◆ balancer2_cell_1_state()

void balancer2_cell_1_state ( balancer2_t * ctx,
uint8_t state )

Generic function for setting cell 1 pin status.

Parameters
ctxClick object.
stateState of the pin.

@description This function setting cell 1 pin status.

◆ balancer2_cell_2_state()

void balancer2_cell_2_state ( balancer2_t * ctx,
uint8_t state )

Generic function for setting cell 2 pin status.

Parameters
ctxClick object.
stateState of the pin.

@description This function setting cell 2 pin status.

◆ balancer2_cfg_setup()

void balancer2_cfg_setup ( balancer2_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.

◆ balancer2_default_cfg()

void balancer2_default_cfg ( balancer2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for BALANCER 2 click.

◆ balancer2_get_batttery_lvl()

float balancer2_get_batttery_lvl ( balancer2_t * ctx,
uint8_t bat_num )

Function for getting real battery lvl.

Parameters
ctxClick object.
bat_numBattery macro.
Returns
Return lvl of selected battery

@description This function getting real battery lvl.

◆ balancer2_init()

BALANCER2_RETVAL balancer2_init ( balancer2_t * ctx,
balancer2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ balancer2_read_adc()

uint16_t balancer2_read_adc ( balancer2_t * ctx,
uint8_t cmd_byte )

Function for reading adc value.

Parameters
ctxClick object.
cmd_byteCommand byte.
Returns
Return read adc value

@description This function setting status led pin status.

◆ balancer2_set_vref()

void balancer2_set_vref ( balancer2_t * ctx,
uint16_t vref )

Function for setting reference value.

Parameters
ctxClick object.
vrefReference value.

◆ balancer2_status_led_state()

void balancer2_status_led_state ( balancer2_t * ctx,
uint8_t state )

Generic function for setting status led pin status.

Parameters
ctxClick object.
stateState of the pin.

@description This function setting status led pin status.

◆ balancer2_supply_state()

void balancer2_supply_state ( balancer2_t * ctx,
uint8_t state )

Generic function for setting supply pin status.

Parameters
ctxClick object.
stateState of the pin.

@description This function setting supply pin status.