current 2.0.0.0
Public function

Functions

void current_cfg_setup (current_cfg_t *cfg)
 Config Object Initialization function.
 
CURRENT_RETVAL current_init (current_t *ctx, current_cfg_t *cfg)
 Initialization function.
 
uint16_t current_data_read (current_t *ctx)
 Data read function.
 
uint16_t current_get_raw_data (current_t *ctx)
 Get raw data function.
 
float current_avg_rata (current_t *ctx)
 Calculate average data function.
 
float current_get_current_data (current_t *ctx, float r_hunt)
 Get current value function.
 

Detailed Description

Function Documentation

◆ current_avg_rata()

float current_avg_rata ( current_t * ctx)

Calculate average data function.

Parameters
ctxClick object.
Returns
result 12-bit value that represents average raw data value.

Function is used to calculate average raw data value.

Note
Function calculates average value from 10 raw values and holds small 100 miliseconds delay.

◆ current_cfg_setup()

void current_cfg_setup ( current_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.

◆ current_data_read()

uint16_t current_data_read ( current_t * ctx)

Data read function.

Parameters
ctxClick object.
Returns
result 16-bit value that represents readings from output register.

Function is used to read data from output register.

◆ current_get_current_data()

float current_get_current_data ( current_t * ctx,
float r_hunt )

Get current value function.

Parameters
ctxClick object.
[in]rShuntfloat value representing shunt resistor.
Returns
result 12-bit value representing current in mA.

Function is used to calculate current in mA.

Note
In order to measure current values in various bands, you need to provide the shunt of the appropriate value.

◆ current_get_raw_data()

uint16_t current_get_raw_data ( current_t * ctx)

Get raw data function.

Parameters
ctxClick object.
Returns
result 12-bit value that represents raw data value.

Function is used to read raw data value from output register.

◆ current_init()

CURRENT_RETVAL current_init ( current_t * ctx,
current_cfg_t * cfg )

Initialization function.

Parameters
currentClick object.
cfgClick configuration structure.

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