wheatstone 2.0.0.0

Functions

void wheatstone_cfg_setup (wheatstone_cfg_t *cfg)
 Config Object Initialization function.
 
err_t wheatstone_init (wheatstone_t *ctx, wheatstone_cfg_t *cfg)
 Initialization function.
 
void wheatstone_set_potentiometer (wheatstone_t *ctx, uint8_t pot_value)
 Set potentiometer ( 0 - 100k )
 
err_t wheatstone_read_an_pin_value (wheatstone_t *ctx, uint16_t *data_out)
 Wheatstone read AN pin value function.
 
err_t wheatstone_read_an_pin_voltage (wheatstone_t *ctx, float *data_out)
 Wheatstone read AN pin voltage level function.
 

Detailed Description

Function Documentation

◆ wheatstone_cfg_setup()

void wheatstone_cfg_setup ( wheatstone_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.

◆ wheatstone_init()

err_t wheatstone_init ( wheatstone_t * ctx,
wheatstone_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ wheatstone_read_an_pin_value()

err_t wheatstone_read_an_pin_value ( wheatstone_t * ctx,
uint16_t * data_out )

Wheatstone read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See wheatstone_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ wheatstone_read_an_pin_voltage()

err_t wheatstone_read_an_pin_voltage ( wheatstone_t * ctx,
float * data_out )

Wheatstone read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See wheatstone_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ wheatstone_set_potentiometer()

void wheatstone_set_potentiometer ( wheatstone_t * ctx,
uint8_t pot_value )

Set potentiometer ( 0 - 100k )

Parameters
ctxClick object.
pot_valueValue ( 0x00 - 0xFF )

This function set 8-bit wiper positions data via SPI on the TPL0501 chip register.