Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define ADC17_REG_SETUP 0x80
60 #define ADC17_SETUP_VREF_VDD_REF_NC_OFF 0x00
61 #define ADC17_SETUP_VREF_EXT_REF_IN_OFF 0x20
62 #define ADC17_SETUP_VREF_INT_REF_NC_OFF 0x40
63 #define ADC17_SETUP_VREF_INT_REF_NC_ON 0x50
64 #define ADC17_SETUP_VREF_INT_REF_OUT_OFF 0x60
65 #define ADC17_SETUP_VREF_INT_REF_OUT_ON 0x70
66 #define ADC17_SETUP_CLK_INT 0x00
67 #define ADC17_SETUP_CLK_EXT 0x08
68 #define ADC17_SETUP_UNIPOLAR 0x00
69 #define ADC17_SETUP_BIPOLAR 0x04
70 #define ADC17_SETUP_RST_RESET 0x00
71 #define ADC17_SETUP_RST_NO_ACTION 0x02
77 #define ADC17_REG_CONFIG 0x00
78 #define ADC17_CONFIG_SCAN_AIN0_TO_CS0 0x00
79 #define ADC17_CONFIG_SCAN_CS0_8_TIMES 0x20
80 #define ADC17_CONFIG_SCAN_CS0 0x60
81 #define ADC17_CONFIG_CS0_AIN0 0x00
82 #define ADC17_CONFIG_CS0_AIN1 0x02
83 #define ADC17_CONFIG_DIFFERENTIAL 0x00
84 #define ADC17_CONFIG_SINGLE_ENDED 0x01
90 #define ADC17_REG_BIT_MASK 0x80
91 #define ADC17_SETUP_VREF_BIT_MASK 0x70
92 #define ADC17_SETUP_CLK_BIT_MASK 0x08
93 #define ADC17_SETUP_UNI_BIP_BIT_MASK 0x04
94 #define ADC17_SETUP_RST_BIT_MASK 0x02
95 #define ADC17_CONFIG_SCAN_BIT_MASK 0x60
96 #define ADC17_CONFIG_CS0_BIT_MASK 0x02
97 #define ADC17_CONFIG_SGL_DIF_BIT_MASK 0x01
103 #define ADC17_CHANNEL_0 0
104 #define ADC17_CHANNEL_1 1
110 #define ADC17_RESOLUTION 0x0FFF
111 #define ADC17_VREF 2.048
118 #define ADC17_SET_DEV_ADDR 0x36
136 #define ADC17_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
138 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
err_t adc17_set_channel(adc17_t *ctx, uint8_t channel)
ADC 17 set channel function.
err_t adc17_default_cfg(adc17_t *ctx)
ADC 17 default configuration function.
@ ADC17_ERROR
Definition: adc17.h:181
err_t adc17_get_voltage(adc17_t *ctx, float *voltage)
ADC 17 get voltage function.
adc17_return_value_t
ADC 17 Click return value data.
Definition: adc17.h:179
uint8_t i2c_address
Definition: adc17.h:170
void adc17_cfg_setup(adc17_cfg_t *cfg)
ADC 17 configuration object setup function.
uint8_t setup_byte
Definition: adc17.h:155
pin_name_t sda
Definition: adc17.h:167
err_t adc17_init(adc17_t *ctx, adc17_cfg_t *cfg)
ADC 17 initialization function.
uint8_t config_byte
Definition: adc17.h:156
@ ADC17_OK
Definition: adc17.h:180
ADC 17 Click configuration object.
Definition: adc17.h:165
uint8_t slave_address
Definition: adc17.h:153
err_t adc17_write_config_byte(adc17_t *ctx, uint8_t config_byte)
ADC 17 write config byte function.
i2c_master_t i2c
Definition: adc17.h:150
pin_name_t scl
Definition: adc17.h:166
ADC 17 Click context object.
Definition: adc17.h:148
err_t adc17_write_setup_byte(adc17_t *ctx, uint8_t setup_byte)
ADC 17 write setup byte function.
uint32_t i2c_speed
Definition: adc17.h:169