ammeter 2.0.0.0
Public function

Functions

void ammeter_cfg_setup (ammeter_cfg_t *cfg)
 Config Object Initialization function.
 
AMMETER_RETVAL ammeter_init (ammeter_t *ctx, ammeter_cfg_t *cfg)
 Initialization function.
 
uint16_t ammeter_data_read (ammeter_t *ctx)
 Data read function.
 
uint16_t ammeter_get_raw_data (ammeter_t *ctx)
 Get raw data function.
 
float ammeter_get_avg_data (ammeter_t *ctx)
 Get average average data function.
 
float ammeter_amperage (ammeter_t *ctx)
 Get amperage function.
 

Detailed Description

Function Documentation

◆ ammeter_amperage()

float ammeter_amperage ( ammeter_t * ctx)

Get amperage function.

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

Function is used to measure amperage of a power consumer connected to the click board.

Note
Ammeter click board can be used to saftly measure current up to 1A.

◆ ammeter_cfg_setup()

void ammeter_cfg_setup ( ammeter_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.

◆ ammeter_data_read()

uint16_t ammeter_data_read ( ammeter_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.

◆ ammeter_get_avg_data()

float ammeter_get_avg_data ( ammeter_t * ctx)

Get average average data function.

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

Function is used to calculate average data value.

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

◆ ammeter_get_raw_data()

uint16_t ammeter_get_raw_data ( ammeter_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.

◆ ammeter_init()

AMMETER_RETVAL ammeter_init ( ammeter_t * ctx,
ammeter_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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