voltmeter 2.0.0.0
Public function

Functions

void voltmeter_cfg_setup (voltmeter_cfg_t *cfg)
 Config Object Initialization function.
 
err_t voltmeter_init (voltmeter_t *ctx, voltmeter_cfg_t *cfg)
 Initialization function.
 
int16_t voltmeter_read_raw_data (voltmeter_t *ctx)
 Read raw ADC value function.
 
float voltmeter_calculate_voltage (voltmeter_t *ctx, int16_t raw_adc, uint8_t iso_gnd)
 Voltage calculation function.
 

Detailed Description

Function Documentation

◆ voltmeter_calculate_voltage()

float voltmeter_calculate_voltage ( voltmeter_t * ctx,
int16_t raw_adc,
uint8_t iso_gnd )

Voltage calculation function.

Parameters
ctxClick object.
raw_adcRaw ADC value.
iso_gnd1 - Isolated GND (+-17.05V), 0 - Shared GND (+-8.525V).

This function converts the raw ADC value to proportional voltage level.

◆ voltmeter_cfg_setup()

void voltmeter_cfg_setup ( voltmeter_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ voltmeter_init()

err_t voltmeter_init ( voltmeter_t * ctx,
voltmeter_cfg_t * cfg )

Initialization function.

Parameters
voltmeterClick object.
cfgClick configuration structure.

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

◆ voltmeter_read_raw_data()

int16_t voltmeter_read_raw_data ( voltmeter_t * ctx)

Read raw ADC value function.

Parameters
ctxClick object.

This function reads raw ADC value.