pot 2.0.0.0
Public function

Functions

void pot_cfg_setup (pot_cfg_t *cfg)
 POT configuration object setup function.
 
err_t pot_init (pot_t *ctx, pot_cfg_t *cfg)
 POT initialization function.
 
err_t pot_read_an_pin_value (pot_t *ctx, uint16_t *data_out)
 POT read AN pin value function.
 
err_t pot_read_an_pin_voltage (pot_t *ctx, float *data_out)
 POT read AN pin voltage level function.
 

Detailed Description

Function Documentation

◆ pot_cfg_setup()

void pot_cfg_setup ( pot_cfg_t * cfg)

POT configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See pot_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ pot_init()

err_t pot_init ( pot_t * ctx,
pot_cfg_t * cfg )

POT initialization function.

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

Parameters
[out]ctx: Click context object. See pot_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See pot_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pot_read_an_pin_value()

err_t pot_read_an_pin_value ( pot_t * ctx,
uint16_t * data_out )

POT read AN pin value function.

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

Parameters
[in]ctx: Click context object. See pot_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.

◆ pot_read_an_pin_voltage()

err_t pot_read_an_pin_voltage ( pot_t * ctx,
float * data_out )

POT 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 pot_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).