rmeter 2.0.0.0
Public function

Functions

void rmeter_cfg_setup (rmeter_cfg_t *cfg)
 Config Object Setup function.
 
err_t rmeter_init (rmeter_t *ctx, rmeter_cfg_t *cfg)
 Initialization function.
 
void rmeter_set_callback_handler (rmeter_t *ctx, rmeter_callback_t handler)
 Callback Handler Setup function.
 
void rmeter_set_range_up_to_1k9_ohms (rmeter_t *ctx)
 Range Setup Up To 1k9 Ohms function.
 
void rmeter_set_range_up_to_17k_ohms (rmeter_t *ctx)
 Range Setup Up To 17k Ohms function.
 
void rmeter_set_range_up_to_1M9_ohms (rmeter_t *ctx)
 Range Setup Up To 1M9 Ohms function.
 
err_t rmeter_read_measurement (rmeter_t *ctx, uint16_t *data_out)
 Measurement Reading function.
 
err_t rmeter_calculate_resistance (rmeter_t *ctx, float *data_out, uint16_t data_in)
 Resistance Calculation function.
 
uint16_t rmeter_auto_scale_range_execution (rmeter_t *ctx)
 Auto Scale Range Execution function.
 
err_t rmeter_read_an (rmeter_t *ctx, uint16_t *data_out)
 AN Pin Reading function.
 
err_t rmeter_read_an_voltage (rmeter_t *ctx, float *data_out)
 AN Voltage Level Reading function.
 

Detailed Description

Function Documentation

◆ rmeter_auto_scale_range_execution()

uint16_t rmeter_auto_scale_range_execution ( rmeter_t * ctx)

Auto Scale Range Execution function.

Parameters
ctxClick object.
Returns
12-bit measured data results.

@description This function is able to recognize and set the necessary range of measurement of the target resistance.

◆ rmeter_calculate_resistance()

err_t rmeter_calculate_resistance ( rmeter_t * ctx,
float * data_out,
uint16_t data_in )

Resistance Calculation function.

Parameters
ctxClick object.
data_outFloating value of calculated resistance [ohm].
data_in12-bit measurement data.
Returns
0 - Ok, (-1) - Error.

@description This function performs the all necessary calculations to get the target resistance value depending on the measured data.

Note
Before execution of this function need to set measurement range by calling functions for range setting or auto scalling function.

◆ rmeter_cfg_setup()

void rmeter_cfg_setup ( rmeter_cfg_t * cfg)

Config Object Setup 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.

◆ rmeter_init()

err_t rmeter_init ( rmeter_t * ctx,
rmeter_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0 - Ok, (-1) - Error.

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

◆ rmeter_read_an()

err_t rmeter_read_an ( rmeter_t * ctx,
uint16_t * data_out )

AN Pin Reading function.

Parameters
ctxClick object.
data_outAnalog pin converted value.
Returns
0 - Ok, (-1) - Error.

@description This function reads the analog input pin (AN) value depending on the selected ADC resolution.

◆ rmeter_read_an_voltage()

err_t rmeter_read_an_voltage ( rmeter_t * ctx,
float * data_out )

AN Voltage Level Reading function.

Parameters
ctxClick object.
data_outAnalog pin voltage level [V].
Returns
0 - Ok, (-1) - Error.

@description This function reads the analog input pin (AN) voltage level depending on the selected ADC resolution and ADC reference voltage.

◆ rmeter_read_measurement()

err_t rmeter_read_measurement ( rmeter_t * ctx,
uint16_t * data_out )

Measurement Reading function.

Parameters
ctxClick object.
data_out12-bit measurement results.
Returns
0 - Ok, (-1) - Error.

@description This function reads the converted measurement results.

◆ rmeter_set_callback_handler()

void rmeter_set_callback_handler ( rmeter_t * ctx,
rmeter_callback_t handler )

Callback Handler Setup function.

Parameters
ctxClick object.
handlerCallback handler which will be set.

@description This function sets a callback handler for message logging.

◆ rmeter_set_range_up_to_17k_ohms()

void rmeter_set_range_up_to_17k_ohms ( rmeter_t * ctx)

Range Setup Up To 17k Ohms function.

Parameters
ctxClick object.

@description This function sets the scale range up to 17k ohms for better sensitivity of resistance in that range.

◆ rmeter_set_range_up_to_1k9_ohms()

void rmeter_set_range_up_to_1k9_ohms ( rmeter_t * ctx)

Range Setup Up To 1k9 Ohms function.

Parameters
ctxClick object.

@description This function sets the scale range up to 1k9 ohms for better sensitivity of small resistance.

◆ rmeter_set_range_up_to_1M9_ohms()

void rmeter_set_range_up_to_1M9_ohms ( rmeter_t * ctx)

Range Setup Up To 1M9 Ohms function.

Parameters
ctxClick object.

@description This function sets the scale range up to 1M9 ohms for large range of resistance.