pot5 2.1.0.0
|
API for configuring and manipulating POT 5 Click driver. More...
Topics | |
POT 5 Registers Settings | |
Settings for registers of POT 5 Click driver. | |
POT 5 MikroBUS Map | |
MikroBUS pin mapping of POT 5 Click driver. | |
Functions | |
void | pot5_cfg_setup (pot5_cfg_t *cfg) |
POT 5 configuration object setup function. | |
void | pot5_drv_interface_selection (pot5_cfg_t *cfg, pot5_drv_t drv_sel) |
POT 5 driver interface setup function. | |
err_t | pot5_init (pot5_t *ctx, pot5_cfg_t *cfg) |
POT 5 initialization function. | |
err_t | pot5_read_raw_adc (pot5_t *ctx, uint16_t *raw_adc) |
POT 5 read raw ADC value function. | |
err_t | pot5_read_voltage (pot5_t *ctx, float *voltage) |
POT 5 read voltage level function. | |
err_t | pot5_set_vref (pot5_t *ctx, float vref) |
POT 5 set vref function. | |
uint8_t | pot5_convert_voltage_to_percents (pot5_t *ctx, float voltage) |
POT 5 convert voltage to percents function. | |
API for configuring and manipulating POT 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void pot5_cfg_setup | ( | pot5_cfg_t * | cfg | ) |
POT 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See pot5_cfg_t object definition for detailed explanation. |
uint8_t pot5_convert_voltage_to_percents | ( | pot5_t * | ctx, |
float | voltage ) |
POT 5 convert voltage to percents function.
This function converts analog voltage to potentiometer position in percents.
[in] | ctx | : Click context object. See pot5_t object definition for detailed explanation. |
void pot5_drv_interface_selection | ( | pot5_cfg_t * | cfg, |
pot5_drv_t | drv_sel ) |
POT 5 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 pot5_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See pot5_drv_t object definition for detailed explanation. |
err_t pot5_init | ( | pot5_t * | ctx, |
pot5_cfg_t * | cfg ) |
POT 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See pot5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See pot5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t pot5_read_raw_adc | ( | pot5_t * | ctx, |
uint16_t * | raw_adc ) |
POT 5 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See pot5_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 pot5_read_voltage | ( | pot5_t * | ctx, |
float * | voltage ) |
POT 5 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See pot5_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 pot5_set_vref | ( | pot5_t * | ctx, |
float | vref ) |
POT 5 set vref function.
This function sets the voltage reference for POT 5 click driver.
[in] | ctx | : Click context object. See pot5_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.