Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_analog_in.h"
48 #include "drv_i2c_master.h"
70 #define POT5_PERCENTS 100
71 #define POT5_ROUND_TO_NEAREST_INT 0.5
77 #define POT5_ADC_RESOLUTION 0x0FFF
78 #define POT5_VREF_3V3 3.3
79 #define POT5_VREF_5V 5.0
86 #define POT5_SET_DEV_ADDR 0x4D
104 #define POT5_MAP_MIKROBUS( cfg, mikrobus ) \
105 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
106 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
107 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
void pot5_cfg_setup(pot5_cfg_t *cfg)
POT 5 configuration object setup function.
uint8_t slave_address
Definition: pot5.h:132
err_t pot5_init(pot5_t *ctx, pot5_cfg_t *cfg)
POT 5 initialization function.
pot5_drv_t drv_sel
Definition: pot5.h:155
@ POT5_OK
Definition: pot5.h:165
float vref
Definition: pot5.h:134
err_t pot5_read_raw_adc(pot5_t *ctx, uint16_t *raw_adc)
POT 5 read raw ADC value function.
uint8_t i2c_address
Definition: pot5.h:153
@ POT5_DRV_SEL_ADC
Definition: pot5.h:118
pot5_drv_t drv_sel
Definition: pot5.h:135
uint8_t pot5_convert_voltage_to_percents(pot5_t *ctx, float voltage)
POT 5 convert voltage to percents function.
@ POT5_DRV_SEL_I2C
Definition: pot5.h:119
POT 5 Click configuration object.
Definition: pot5.h:144
analog_in_resolution_t resolution
Definition: pot5.h:149
pin_name_t scl
Definition: pot5.h:146
@ POT5_ERROR
Definition: pot5.h:166
POT 5 Click context object.
Definition: pot5.h:128
pin_name_t sda
Definition: pot5.h:147
i2c_master_t i2c
Definition: pot5.h:130
analog_in_t adc
Definition: pot5.h:129
pin_name_t chip_select
Definition: pot5.h:133
float vref
Definition: pot5.h:150
pot5_return_value_t
POT 5 Click return value data.
Definition: pot5.h:164
err_t pot5_read_voltage(pot5_t *ctx, float *voltage)
POT 5 read voltage level function.
pin_name_t an
Definition: pot5.h:145
void pot5_drv_interface_selection(pot5_cfg_t *cfg, pot5_drv_t drv_sel)
POT 5 driver interface setup function.
err_t pot5_set_vref(pot5_t *ctx, float vref)
POT 5 set vref function.
pot5_drv_t
POT 5 Click driver selector.
Definition: pot5.h:117
uint32_t i2c_speed
Definition: pot5.h:152