pot4 2.1.0.0
|
API for configuring and manipulating POT 4 Click driver. More...
Topics | |
POT 4 Registers Settings | |
Settings for registers of POT 4 Click driver. | |
POT 4 MikroBUS Map | |
MikroBUS pin mapping of POT 4 Click driver. | |
Functions | |
void | pot4_cfg_setup (pot4_cfg_t *cfg) |
POT 4 configuration object setup function. | |
void | pot4_drv_interface_selection (pot4_cfg_t *cfg, pot4_drv_t drv_sel) |
POT 4 driver interface setup function. | |
err_t | pot4_init (pot4_t *ctx, pot4_cfg_t *cfg) |
POT 4 initialization function. | |
err_t | pot4_read_raw_adc (pot4_t *ctx, uint16_t *raw_adc) |
POT 4 read raw ADC value function. | |
err_t | pot4_read_voltage (pot4_t *ctx, float *voltage) |
POT 4 read voltage level function. | |
err_t | pot4_set_vref (pot4_t *ctx, float vref) |
POT 4 set vref function. | |
uint8_t | pot4_get_switch_pin (pot4_t *ctx) |
POT 4 get switch pin function. | |
uint8_t | pot4_convert_voltage_to_percents (pot4_t *ctx, float voltage) |
POT 4 convert voltage to percents function. | |
API for configuring and manipulating POT 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void pot4_cfg_setup | ( | pot4_cfg_t * | cfg | ) |
POT 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See pot4_cfg_t object definition for detailed explanation. |
uint8_t pot4_convert_voltage_to_percents | ( | pot4_t * | ctx, |
float | voltage ) |
POT 4 convert voltage to percents function.
This function converts analog voltage to potentiometer position in percents.
[in] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
void pot4_drv_interface_selection | ( | pot4_cfg_t * | cfg, |
pot4_drv_t | drv_sel ) |
POT 4 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See pot4_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See pot4_drv_t object definition for detailed explanation. |
uint8_t pot4_get_switch_pin | ( | pot4_t * | ctx | ) |
POT 4 get switch pin function.
This function returns the switch (SW) pin logic state.
[in] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
err_t pot4_init | ( | pot4_t * | ctx, |
pot4_cfg_t * | cfg ) |
POT 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See pot4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pot4_read_raw_adc | ( | pot4_t * | ctx, |
uint16_t * | raw_adc ) |
POT 4 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pot4_read_voltage | ( | pot4_t * | ctx, |
float * | voltage ) |
POT 4 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pot4_set_vref | ( | pot4_t * | ctx, |
float | vref ) |
POT 4 set vref function.
This function sets the voltage reference for POT 4 click driver.
[in] | ctx | : Click context object. See pot4_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.