adc6  2.0.0.0
adc6.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright© 2020 MikroElektronika d.o.o.
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22  * OR OTHER DEALINGS IN THE SOFTWARE.
23  */
32 // ----------------------------------------------------------------------------
33 
34 #ifndef ADC6_H
35 #define ADC6_H
36 
37 #include "drv_digital_out.h"
38 #include "drv_digital_in.h"
39 #include "drv_spi_master.h"
40 
41 // -------------------------------------------------------------- PUBLIC MACROS
53 #define ADC6_MAP_MIKROBUS( cfg, mikrobus ) \
54  cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
55  cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
56  cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
57  cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
58  cfg.syn = MIKROBUS( mikrobus, MIKROBUS_RST )
59 
65 #define ADC6_RETVAL uint8_t
66 
67 #define ADC6_OK 0x00
68 #define ADC6_INIT_ERROR 0xFF
69 
75 #define ADC6_COMMUNICATION_AND_STATUS_REG 0x00
76 #define ADC6_CONTROL_REG 0x01
77 #define ADC6_DATA_REG 0x02
78 #define ADC6_IO_CONTROL_1_REG 0x03
79 #define ADC6_IO_CONTROL_2_REG 0x04
80 #define ADC6_ID_REG 0x05
81 #define ADC6_ERROR_STATUS_REG 0x06
82 #define ADC6_ERROR_ENABLE_REG 0x07
83 #define ADC6_MASTER_CLOCK_COUNTER_REG 0x08
84 #define ADC6_CHANNEL_0_REG 0x09
85 #define ADC6_CHANNEL_1_REG 0x0A
86 #define ADC6_CHANNEL_2_REG 0x0B
87 #define ADC6_CHANNEL_3_REG 0x0C
88 #define ADC6_CHANNEL_4_REG 0x0D
89 #define ADC6_CHANNEL_5_REG 0x0E
90 #define ADC6_CHANNEL_6_REG 0x0F
91 #define ADC6_CHANNEL_7_REG 0x10
92 #define ADC6_CHANNEL_8_REG 0x11
93 #define ADC6_CHANNEL_9_REG 0x12
94 #define ADC6_CHANNEL_10_REG 0x13
95 #define ADC6_CHANNEL_11_REG 0x14
96 #define ADC6_CHANNEL_12_REG 0x15
97 #define ADC6_CHANNEL_13_REG 0x16
98 #define ADC6_CHANNEL_14_REG 0x17
99 #define ADC6_CHANNEL_15_REG 0x18
100 #define ADC6_CONFIG_0_REG 0x19
101 #define ADC6_CONFIG_1_REG 0x1A
102 #define ADC6_CONFIG_2_REG 0x1B
103 #define ADC6_CONFIG_3_REG 0x1C
104 #define ADC6_CONFIG_4_REG 0x1D
105 #define ADC6_CONFIG_5_REG 0x1E
106 #define ADC6_CONFIG_6_REG 0x1F
107 #define ADC6_CONFIG_7_REG 0x20
108 #define ADC6_FILTER_0_REG 0x21
109 #define ADC6_FILTER_1_REG 0x22
110 #define ADC6_FILTER_2_REG 0x23
111 #define ADC6_FILTER_3_REG 0x24
112 #define ADC6_FILTER_4_REG 0x25
113 #define ADC6_FILTER_5_REG 0x26
114 #define ADC6_FILTER_6_REG 0x27
115 #define ADC6_FILTER_7_REG 0x28
116 #define ADC6_OFFSET_0_REG 0x29
117 #define ADC6_OFFSET_1_REG 0x2A
118 #define ADC6_OFFSET_2_REG 0x2B
119 #define ADC6_OFFSET_3_REG 0x2C
120 #define ADC6_OFFSET_4_REG 0x2D
121 #define ADC6_OFFSET_5_REG 0x2E
122 #define ADC6_OFFSET_6_REG 0x2F
123 #define ADC6_OFFSET_7_REG 0x30
124 #define ADC6_GAIN_0_REG 0x31
125 #define ADC6_GAIN_1_REG 0x32
126 #define ADC6_GAIN_2_REG 0x33
127 #define ADC6_GAIN_3_REG 0x34
128 #define ADC6_GAIN_4_REG 0x35
129 #define ADC6_GAIN_5_REG 0x36
130 #define ADC6_GAIN_6_REG 0x37
131 #define ADC6_GAIN_7_REG 0x38
132 
138 #define ADC6_COMMUN_WRITE_COMMAND 0x00
139 #define ADC6_COMMUN_READ_COMMAND 0x40
140 #define ADC6_COMMUN_WRITE_DISABLE 0x80
141 
147 #define ADC6_CONTROL_RDY_DELAY_10NS_LOW_POWER_MODE_RDY_PIN_ENABLE 0x0000
148 #define ADC6_CONTROL_RDY_DELAY_100NS 0x1000
149 #define ADC6_CONTROL_CONTINUOUS_CONVERSION_MODE 0x0800
150 #define ADC6_CONTROL_DATA_STATUS_ENABLE 0x0400
151 #define ADC6_CONTROL_DOUT_PIN_ENABLE 0x0200
152 #define ADC6_CONTROL_INTERNAL_REFERENCE_VOLTAGE_ENABLE 0x0100
153 #define ADC6_CONTROL_MID_POWER_MODE 0x0040
154 #define ADC6_CONTROL_FULL_POWER_MODE 0x0080
155 #define ADC6_CONTROL_SINGLE_CONVERSION_MODE 0x0004
156 #define ADC6_CONTROL_STANDBY_MODE 0x0008
157 #define ADC6_CONTROL_SINGLE_POWER_DOWN_MODE 0x000C
158 #define ADC6_CONTROL_IDLE_MODE 0x0010
159 #define ADC6_CONTROL_INTERNAL_ZERO_SCALE_OFFSET_CALIBRATION 0x0014
160 #define ADC6_CONTROL_INTERNAL_FULL_SCALE_GAIN_CALIBRATION 0x0018
161 #define ADC6_CONTROL_SYSTEM_ZERO_SCALE_OFFSET_CALIBRATION 0x001C
162 #define ADC6_CONTROL_SYSTEM_FULL_SCALE_GAIN_CALIBRATION 0x0020
163 
169 #define ADC6_IO_CON1_DIGITAL_OUTPUT_PINS_DISABLE_CURRENT_DISABLE 0x00000000
170 #define ADC6_IO_CON1_SET_DIGITAL_OUTPUT_PIN_P4 0x00800000
171 #define ADC6_IO_CON1_SET_DIGITAL_OUTPUT_PIN_P3 0x00400000
172 #define ADC6_IO_CON1_SET_DIGITAL_OUTPUT_PIN_P2 0x00200000
173 #define ADC6_IO_CON1_SET_DIGITAL_OUTPUT_PIN_P1 0x00100000
174 #define ADC6_IO_CON1_ENABLE_DIGITAL_OUTPUT_PIN_P4 0x00080000
175 #define ADC6_IO_CON1_ENABLE_DIGITAL_OUTPUT_PIN_P3 0x00040000
176 #define ADC6_IO_CON1_ENABLE_DIGITAL_OUTPUT_PIN_P2 0x00020000
177 #define ADC6_IO_CON1_ENABLE_DIGITAL_OUTPUT_PIN_P1 0x00010000
178 #define ADC6_IO_CON1_ENABLE_BRIGDE_POWER_DOWN 0x00008000
179 #define ADC6_IO_CON1_IOUT1_CURRENT_50_MIKRO_A 0x00000800
180 #define ADC6_IO_CON1_IOUT1_CURRENT_100_MIKRO_A 0x00001000
181 #define ADC6_IO_CON1_IOUT1_CURRENT_250_MIKRO_A 0x00001800
182 #define ADC6_IO_CON1_IOUT1_CURRENT_500_MIKRO_A 0x00002000
183 #define ADC6_IO_CON1_IOUT1_CURRENT_750_MIKRO_A 0x00002800
184 #define ADC6_IO_CON1_IOUT1_CURRENT_1000_MIKRO_A 0x00003000
185 #define ADC6_IO_CON1_IOUT0_CURRENT_50_MIKRO_A 0x00000100
186 #define ADC6_IO_CON1_IOUT0_CURRENT_100_MIKRO_A 0x00000200
187 #define ADC6_IO_CON1_IOUT0_CURRENT_250_MIKRO_A 0x00000300
188 #define ADC6_IO_CON1_IOUT0_CURRENT_500_MIKRO_A 0x00000400
189 #define ADC6_IO_CON1_IOUT0_CURRENT_750_MIKRO_A 0x00000500
190 #define ADC6_IO_CON1_IOUT0_CURRENT_1000_MIKRO_A 0x00000600
191 #define ADC6_IO_CON1_IOUT1_ON_AIN0_PIN 0x00000000
192 #define ADC6_IO_CON1_IOUT1_ON_AIN1_PIN 0x00000010
193 #define ADC6_IO_CON1_IOUT1_ON_AIN2_PIN 0x00000020
194 #define ADC6_IO_CON1_IOUT1_ON_AIN3_PIN 0x00000030
195 #define ADC6_IO_CON1_IOUT1_ON_AIN4_PIN 0x00000040
196 #define ADC6_IO_CON1_IOUT1_ON_AIN5_PIN 0x00000050
197 #define ADC6_IO_CON1_IOUT1_ON_AIN6_PIN 0x00000060
198 #define ADC6_IO_CON1_IOUT1_ON_AIN7_PIN 0x00000070
199 #define ADC6_IO_CON1_IOUT1_ON_AIN8_PIN 0x00000080
200 #define ADC6_IO_CON1_IOUT1_ON_AIN9_PIN 0x00000090
201 #define ADC6_IO_CON1_IOUT1_ON_AIN10_PIN 0x000000A0
202 #define ADC6_IO_CON1_IOUT1_ON_AIN11_PIN 0x000000B0
203 #define ADC6_IO_CON1_IOUT1_ON_AIN12_PIN 0x000000C0
204 #define ADC6_IO_CON1_IOUT1_ON_AIN13_PIN 0x000000D0
205 #define ADC6_IO_CON1_IOUT1_ON_AIN14_PIN 0x000000E0
206 #define ADC6_IO_CON1_IOUT1_ON_AIN15_PIN 0x000000F0
207 #define ADC6_IO_CON1_IOUT0_ON_AIN0_PIN 0x00000000
208 #define ADC6_IO_CON1_IOUT0_ON_AIN1_PIN 0x00000001
209 #define ADC6_IO_CON1_IOUT0_ON_AIN2_PIN 0x00000002
210 #define ADC6_IO_CON1_IOUT0_ON_AIN3_PIN 0x00000003
211 #define ADC6_IO_CON1_IOUT0_ON_AIN4_PIN 0x00000004
212 #define ADC6_IO_CON1_IOUT0_ON_AIN5_PIN 0x00000005
213 #define ADC6_IO_CON1_IOUT0_ON_AIN6_PIN 0x00000006
214 #define ADC6_IO_CON1_IOUT0_ON_AIN7_PIN 0x00000007
215 #define ADC6_IO_CON1_IOUT0_ON_AIN8_PIN 0x00000008
216 #define ADC6_IO_CON1_IOUT0_ON_AIN9_PIN 0x00000009
217 #define ADC6_IO_CON1_IOUT0_ON_AIN10_PIN 0x0000000A
218 #define ADC6_IO_CON1_IOUT0_ON_AIN11_PIN 0x0000000B
219 #define ADC6_IO_CON1_IOUT0_ON_AIN12_PIN 0x0000000C
220 #define ADC6_IO_CON1_IOUT0_ON_AIN13_PIN 0x0000000D
221 #define ADC6_IO_CON1_IOUT0_ON_AIN14_PIN 0x0000000E
222 #define ADC6_IO_CON1_IOUT0_ON_AIN15_PIN 0x0000000F
223 
229 #define ADC6_IO_CON2_VBIAS_DISABLE 0x0000
230 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN0_CHANNEL 0x0001
231 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN1_CHANNEL 0x0002
232 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN2_CHANNEL 0x0004
233 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN3_CHANNEL 0x0008
234 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN4_CHANNEL 0x0010
235 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN5_CHANNEL 0x0020
236 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN6_CHANNEL 0x0040
237 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN7_CHANNEL 0x0080
238 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN8_CHANNEL 0x0100
239 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN9_CHANNEL 0x0200
240 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN10_CHANNEL 0x0400
241 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN11_CHANNEL 0x0800
242 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN12_CHANNEL 0x1000
243 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN13_CHANNEL 0x2000
244 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN14_CHANNEL 0x4000
245 #define ADC6_IO_CON2_VBIAS_ENABLE_ON_AIN15_CHANNEL 0x8000
246 
252 #define ADC6_DISABLE_ALL_ERROR_FLAG 0x00000000
253 #define ADC6_ENABLE_MASTER_CLOCK_COUNTER 0x00400000
254 #define ADC6_ENABLE_LDO_CAPACITOR_TEST_CHECK 0x00200000
255 #define ADC6_ENABLE_ANALOG_LDO_CALIBRATION_CHECK 0x00080000
256 #define ADC6_ENABLE_DIGITAL_LDO_CALIBRATION_CHECK 0x00100000
257 #define ADC6_DISABLE_LDO_CHECK 0x00180000
258 #define ADC6_ENABLE_CALIBRATION_FAIL_CHECK 0x00040000
259 #define ADC6_ENABLE_CONVERSION_FAIL_CHECK 0x00020000
260 #define ADC6_ENABLE_SATURATION_CHECK 0x00010000
261 #define ADC6_ENABLE_OVERVOLTAGE_MONITOR_ON_AINP_CHANNELS 0x00008000
262 #define ADC6_ENABLE_UNDERVOLTAGE_MONITOR_ON_AINP_CHANNELS 0x00004000
263 #define ADC6_ENABLE_OVERVOLTAGE_MONITOR_ON_AINM_CHANNELS 0x00002000
264 #define ADC6_ENABLE_UNDERVOLTAGE_MONITOR_ON_AINM_CHANNELS 0x00001000
265 #define ADC6_ENABLE_EXT_REFERENCE_DETECT_ERROR 0x00000800
266 #define ADC6_ENABLE_DIG_LDO_TEST_MECHANISM_CHECK 0x00000400
267 #define ADC6_ENABLE_DIG_LDO_VOLTAGE_MONITORING 0x00000200
268 #define ADC6_ENABLE_AN_LDO_TEST_MECHANISM_CHECK 0x00000100
269 #define ADC6_ENABLE_AN_LDO_VOLTAGE_MONITORING 0x00000080
270 #define ADC6_ENABLE_SPI_IGNORE_ERROR 0x00000040
271 #define ADC6_ENABLE_SPI_SCLK_COUNTER_ERROR_CHECK 0x00000020
272 #define ADC6_ENABLE_SPI_READ_ERROR_CHECK 0x00000010
273 #define ADC6_ENABLE_SPI_WRITE_ERROR_CHECK 0x00000008
274 #define ADC6_ENABLE_SPI_CRC_CHECK 0x00000004
275 #define ADC6_ENABLE_SPI_CRC_CALCULATION_PERFORMING_ON_MEMORY 0x00000002
276 
282 #define ADC6_DISABLE_CHANNEL 0x0000
283 #define ADC6_ENABLE_CHANNEL 0x8000
284 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN0 0x0000
285 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN1 0x0020
286 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN2 0x0040
287 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN3 0x0060
288 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN4 0x0080
289 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN5 0x00A0
290 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN6 0x00C0
291 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN7 0x00E0
292 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN8 0x0100
293 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN9 0x0120
294 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN10 0x0140
295 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN11 0x0160
296 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN12 0x0180
297 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN13 0x01A0
298 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN14 0x01C0
299 #define ADC6_CHANNEL_POSITIVE_ANALOG_INPUT_AIN15 0x01E0
300 #define ADC6_POSITIVE_CHANNEL_TEMPERATURE_SENSOR 0x0200
301 #define ADC6_POSITIVE_CHANNEL_AVSS 0x0220
302 #define ADC6_POSITIVE_CHANNEL_INTERNAL_REFERENCE 0x0240
303 #define ADC6_POSITIVE_CHANNEL_DGND 0x0260
304 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN0 0x0000
305 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN1 0x0001
306 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN2 0x0002
307 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN3 0x0003
308 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN4 0x0004
309 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN5 0x0005
310 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN6 0x0006
311 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN7 0x0007
312 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN8 0x0008
313 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN9 0x0009
314 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN10 0x000A
315 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN11 0x000B
316 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN12 0x000C
317 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN13 0x000D
318 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN14 0x000E
319 #define ADC6_CHANNEL_NEGATIVE_ANALOG_INPUT_AIN15 0x000F
320 #define ADC6_NEGATIVE_CHANNEL_TEMPERATURE_SENSOR 0x0010
321 #define ADC6_NEGATIVE_CHANNEL_AVSS 0x0011
322 #define ADC6_NEGATIVE_CHANNEL_INTERNAL_REFERENCE 0x0012
323 #define ADC6_NEGATIVE_CHANNEL_DGND 0x0013
324 
330 #define ADC6_CONFIG_UNIPOLAR_OP_BUFFER_DISABLE_BURNOUT_CURRENT_OFF 0x0000
331 #define ADC6_CONFIG_ENABLE_BIPOLAR_OP 0x0800
332 #define ADC6_CONFIG_ENABLE_BURNOUT_CURRENT_ON_500_NANO_A 0x0200
333 #define ADC6_CONFIG_ENABLE_BURNOUT_CURRENT_ON_2_MIKRO_A 0x0400
334 #define ADC6_CONFIG_ENABLE_BURNOUT_CURRENT_ON_4_MIKRO_A 0x0600
335 #define ADC6_CONFIG_ENABLE_BUFFER_ON_REFIN_POSITIVE 0x0100
336 #define ADC6_CONFIG_ENABLE_BUFFER_ON_REFIN_NEGATIVE 0x0080
337 #define ADC6_CONFIG_ENABLE_BUFFER_ON_AINP 0x0040
338 #define ADC6_CONFIG_ENABLE_BUFFER_ON_AINM 0x0020
339 #define ADC6_CONFIG_SELECT_REFIN1 0x0000
340 #define ADC6_CONFIG_SELECT_REFIN2 0x0008
341 #define ADC6_CONFIG_SELECT_INTERNAL_REFERENCE 0x0010
342 #define ADC6_CONFIG_SELECT_AVDD_FOR_REFERENCE 0x0018
343 #define ADC6_CONFIG_SET_GAIN_1 0x0000
344 #define ADC6_CONFIG_SET_GAIN_2 0x0001
345 #define ADC6_CONFIG_SET_GAIN_4 0x0002
346 #define ADC6_CONFIG_SET_GAIN_8 0x0003
347 #define ADC6_CONFIG_SET_GAIN_16 0x0004
348 #define ADC6_CONFIG_SET_GAIN_32 0x0005
349 #define ADC6_CONFIG_SET_GAIN_64 0x0006
350 #define ADC6_CONFIG_SET_GAIN_128 0x0007
351 
357 #define ADC6_CONTINUOUS_GET_DATA_MODE 0x01
358 #define ADC6_SINGLE_GET_DATA_MODE 0x00
359  // End group macro
362 // --------------------------------------------------------------- PUBLIC TYPES
371 typedef struct
372 {
373  digital_out_t cs;
374 
375  // Output pins
376 
377  digital_out_t syn;
378 
379  // Modules
380 
381  spi_master_t spi;
382  pin_name_t chip_select;
383 
384 } adc6_t;
385 
389 typedef struct
390 {
391  // Communication gpio pins
392 
393  pin_name_t miso;
394  pin_name_t mosi;
395  pin_name_t sck;
396  pin_name_t cs;
397 
398  // Additional gpio pins
399 
400  pin_name_t syn;
401 
402  // static variable
403 
404  uint32_t spi_speed;
405  spi_master_mode_t spi_mode;
406  spi_master_chip_select_polarity_t cs_polarity;
407 
408 } adc6_cfg_t;
409  // End types group
411 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
412 
417 #ifdef __cplusplus
418 extern "C"{
419 #endif
420 
429 void adc6_cfg_setup ( adc6_cfg_t *cfg );
430 
439 ADC6_RETVAL adc6_init ( adc6_t *ctx, adc6_cfg_t *cfg );
440 
448 void adc6_default_cfg ( adc6_t* ctx );
449 
458 void adc6_reset_device ( adc6_t* ctx );
459 
473 uint32_t adc6_get_adc_data ( adc6_t* ctx, const uint8_t mode );
474 
485 uint32_t adc6_continuous_read_data ( adc6_t* ctx );
486 
497 uint32_t adc6_read_reg ( adc6_t* ctx, const uint8_t register_address );
498 
508 void adc6_write_reg ( adc6_t* ctx, const uint8_t register_address, const uint32_t transfer_data );
509 
510 
511 #ifdef __cplusplus
512 }
513 #endif
514 #endif // _ADC6_H_
515  // End public_function group
518 
519 // ------------------------------------------------------------------------- END
adc6_cfg_t::mosi
pin_name_t mosi
Definition: adc6.h:394
adc6_init
ADC6_RETVAL adc6_init(adc6_t *ctx, adc6_cfg_t *cfg)
Initialization function.
adc6_cfg_t::sck
pin_name_t sck
Definition: adc6.h:395
adc6_cfg_t::spi_speed
uint32_t spi_speed
Definition: adc6.h:404
ADC6_RETVAL
#define ADC6_RETVAL
Definition: adc6.h:65
adc6_cfg_t::spi_mode
spi_master_mode_t spi_mode
Definition: adc6.h:405
adc6_continuous_read_data
uint32_t adc6_continuous_read_data(adc6_t *ctx)
Continuous read function.
adc6_default_cfg
void adc6_default_cfg(adc6_t *ctx)
Click Default Configuration function.
adc6_cfg_t::syn
pin_name_t syn
Definition: adc6.h:400
adc6_cfg_t::cs_polarity
spi_master_chip_select_polarity_t cs_polarity
Definition: adc6.h:406
adc6_cfg_t::cs
pin_name_t cs
Definition: adc6.h:396
adc6_t::syn
digital_out_t syn
Definition: adc6.h:377
adc6_t::spi
spi_master_t spi
Definition: adc6.h:381
adc6_reset_device
void adc6_reset_device(adc6_t *ctx)
Reset device.
adc6_get_adc_data
uint32_t adc6_get_adc_data(adc6_t *ctx, const uint8_t mode)
Get data function.
adc6_t
Click ctx object definition.
Definition: adc6.h:371
adc6_read_reg
uint32_t adc6_read_reg(adc6_t *ctx, const uint8_t register_address)
Generic read function.
adc6_cfg_setup
void adc6_cfg_setup(adc6_cfg_t *cfg)
Config Object Initialization function.
adc6_cfg_t
Click configuration structure definition.
Definition: adc6.h:389
adc6_t::cs
digital_out_t cs
Definition: adc6.h:373
adc6_cfg_t::miso
pin_name_t miso
Definition: adc6.h:393
adc6_t::chip_select
pin_name_t chip_select
Definition: adc6.h:382
adc6_write_reg
void adc6_write_reg(adc6_t *ctx, const uint8_t register_address, const uint32_t transfer_data)
Generic write function.