LibDriver ADS1118
Loading...
Searching...
No Matches
driver_ads1118_register_test.c
Go to the documentation of this file.
1
36
38#include <stdlib.h>
39
40static ads1118_handle_t gs_handle;
41
50{
51 uint8_t res;
52 ads1118_info_t info;
53 ads1118_channel_t channel;
54 ads1118_range_t range;
55 ads1118_rate_t rate;
56 ads1118_bool_t enable;
57 ads1118_mode_t mode;
58
59 /* link interface function */
66
67 /* get information */
68 res = ads1118_info(&info);
69 if (res != 0)
70 {
71 ads1118_interface_debug_print("ads1118: get info failed.\n");
72
73 return 1;
74 }
75 else
76 {
77 /* print chip info */
78 ads1118_interface_debug_print("ads1118: chip is %s.\n", info.chip_name);
79 ads1118_interface_debug_print("ads1118: manufacturer is %s.\n", info.manufacturer_name);
80 ads1118_interface_debug_print("ads1118: interface is %s.\n", info.interface);
81 ads1118_interface_debug_print("ads1118: driver version is %d.%d.\n", info.driver_version / 1000, (info.driver_version % 1000) / 100);
82 ads1118_interface_debug_print("ads1118: min supply voltage is %0.1fV.\n", info.supply_voltage_min_v);
83 ads1118_interface_debug_print("ads1118: max supply voltage is %0.1fV.\n", info.supply_voltage_max_v);
84 ads1118_interface_debug_print("ads1118: max current is %0.2fmA.\n", info.max_current_ma);
85 ads1118_interface_debug_print("ads1118: max temperature is %0.1fC.\n", info.temperature_max);
86 ads1118_interface_debug_print("ads1118: min temperature is %0.1fC.\n", info.temperature_min);
87 }
88
89 /* start register test */
90 ads1118_interface_debug_print("ads1118: start register test.\n");
91
92 /* ads1118 init */
93 res = ads1118_init(&gs_handle);
94 if (res != 0)
95 {
96 ads1118_interface_debug_print("ads1118: init failed.\n");
97
98 return 1;
99 }
100
101 /* ads1118_set_channel/ads1118_get_channel test */
102 ads1118_interface_debug_print("ads1118: ads1118_set_channel/ads1118_get_channel test.\n");
103
104 /* AIN0 to GND */
106 if (res != 0)
107 {
108 ads1118_interface_debug_print("ads1118: set channel failed.\n");
109 (void)ads1118_deinit(&gs_handle);
110
111 return 1;
112 }
113 ads1118_interface_debug_print("ads1118: set channel ain0_ground.\n");
114 res = ads1118_get_channel(&gs_handle, &channel);
115 if (res != 0)
116 {
117 ads1118_interface_debug_print("ads1118: get channel failed.\n");
118 (void)ads1118_deinit(&gs_handle);
119
120 return 1;
121 }
122 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN0_GND ? "ok" : "error");
123
124 /* AIN1 to GND */
126 if (res != 0)
127 {
128 ads1118_interface_debug_print("ads1118: set channel failed.\n");
129 (void)ads1118_deinit(&gs_handle);
130
131 return 1;
132 }
133 ads1118_interface_debug_print("ads1118: set channel ain1_ground.\n");
134 res = ads1118_get_channel(&gs_handle, &channel);
135 if (res != 0)
136 {
137 ads1118_interface_debug_print("ads1118: get channel failed.\n");
138 (void)ads1118_deinit(&gs_handle);
139
140 return 1;
141 }
142 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN1_GND ? "ok" : "error");
143
144 /* AIN2 to GND */
146 if (res != 0)
147 {
148 ads1118_interface_debug_print("ads1118: set channel failed.\n");
149 (void)ads1118_deinit(&gs_handle);
150
151 return 1;
152 }
153 ads1118_interface_debug_print("ads1118: set channel ain2_ground.\n");
154 res = ads1118_get_channel(&gs_handle, &channel);
155 if (res != 0)
156 {
157 ads1118_interface_debug_print("ads1118: get channel failed.\n");
158 (void)ads1118_deinit(&gs_handle);
159
160 return 1;
161 }
162 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN2_GND ? "ok" : "error");
163
164 /* AIN3 to GND */
166 if (res != 0)
167 {
168 ads1118_interface_debug_print("ads1118: set channel failed.\n");
169 (void)ads1118_deinit(&gs_handle);
170
171 return 1;
172 }
173 ads1118_interface_debug_print("ads1118: set channel ain3_ground.\n");
174 res = ads1118_get_channel(&gs_handle, &channel);
175 if (res != 0)
176 {
177 ads1118_interface_debug_print("ads1118: get channel failed.\n");
178 (void)ads1118_deinit(&gs_handle);
179
180 return 1;
181 }
182 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN3_GND ? "ok" : "error");
183
184 /* AIN0 to AIN1 */
186 if (res != 0)
187 {
188 ads1118_interface_debug_print("ads1118: set channel failed.\n");
189 (void)ads1118_deinit(&gs_handle);
190
191 return 1;
192 }
193 ads1118_interface_debug_print("ads1118: set channel ain0_ain1.\n");
194 res = ads1118_get_channel(&gs_handle, &channel);
195 if (res != 0)
196 {
197 ads1118_interface_debug_print("ads1118: get channel failed.\n");
198 (void)ads1118_deinit(&gs_handle);
199
200 return 1;
201 }
202 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN0_AIN1 ? "ok" : "error");
203
204 /* AIN0 to AIN3 */
206 if (res != 0)
207 {
208 ads1118_interface_debug_print("ads1118: set channel failed.\n");
209 (void)ads1118_deinit(&gs_handle);
210
211 return 1;
212 }
213 ads1118_interface_debug_print("ads1118: set channel ain0_ain3.\n");
214 res = ads1118_get_channel(&gs_handle, &channel);
215 if (res != 0)
216 {
217 ads1118_interface_debug_print("ads1118: get channel failed.\n");
218 (void)ads1118_deinit(&gs_handle);
219
220 return 1;
221 }
222 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN0_AIN3 ? "ok" : "error");
223
224 /* AIN1 to AIN3 */
226 if (res != 0)
227 {
228 ads1118_interface_debug_print("ads1118: set channel failed.\n");
229 (void)ads1118_deinit(&gs_handle);
230
231 return 1;
232 }
233 ads1118_interface_debug_print("ads1118: set channel ain1_ain3.\n");
234 res = ads1118_get_channel(&gs_handle, &channel);
235 if (res != 0)
236 {
237 ads1118_interface_debug_print("ads1118: get channel failed.\n");
238 (void)ads1118_deinit(&gs_handle);
239
240 return 1;
241 }
242 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN1_AIN3 ? "ok" : "error");
243
244 /* AIN2 to AIN3 */
246 if (res != 0)
247 {
248 ads1118_interface_debug_print("ads1118: set channel failed.\n");
249 (void)ads1118_deinit(&gs_handle);
250
251 return 1;
252 }
253 ads1118_interface_debug_print("ads1118: set channel ain2_ain3.\n");
254 res = ads1118_get_channel(&gs_handle, &channel);
255 if (res != 0)
256 {
257 ads1118_interface_debug_print("ads1118: get channel failed.\n");
258 (void)ads1118_deinit(&gs_handle);
259
260 return 1;
261 }
262 ads1118_interface_debug_print("ads1118: check channel %s.\n", channel == ADS1118_CHANNEL_AIN2_AIN3 ? "ok" : "error");
263
264 /* ads1118_set_range/ads1118_get_range test */
265 ads1118_interface_debug_print("ads1118: ads1118_set_range/ads1118_get_range test.\n");
266
267 /* set 6.144V */
268 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_6P144V);
269 if (res != 0)
270 {
271 ads1118_interface_debug_print("ads1118: set range failed.\n");
272 (void)ads1118_deinit(&gs_handle);
273
274 return 1;
275 }
276 ads1118_interface_debug_print("ads1118: set range 6.144V.\n");
277 res = ads1118_get_range(&gs_handle, &range);
278 if (res != 0)
279 {
280 ads1118_interface_debug_print("ads1118: get range failed.\n");
281 (void)ads1118_deinit(&gs_handle);
282
283 return 1;
284 }
285 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_6P144V ? "ok" : "error");
286
287 /* set 4.096V */
288 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_4P096V);
289 if (res != 0)
290 {
291 ads1118_interface_debug_print("ads1118: set range failed.\n");
292 (void)ads1118_deinit(&gs_handle);
293
294 return 1;
295 }
296 ads1118_interface_debug_print("ads1118: set range 4.096V.\n");
297 res = ads1118_get_range(&gs_handle, &range);
298 if (res != 0)
299 {
300 ads1118_interface_debug_print("ads1118: get range failed.\n");
301 (void)ads1118_deinit(&gs_handle);
302
303 return 1;
304 }
305 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_4P096V ? "ok" : "error");
306
307 /* set 2.048V */
308 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_2P048V);
309 if (res != 0)
310 {
311 ads1118_interface_debug_print("ads1118: set range failed.\n");
312 (void)ads1118_deinit(&gs_handle);
313
314 return 1;
315 }
316 ads1118_interface_debug_print("ads1118: set range 2.048V.\n");
317 res = ads1118_get_range(&gs_handle, &range);
318 if (res != 0)
319 {
320 ads1118_interface_debug_print("ads1118: get range failed.\n");
321 (void)ads1118_deinit(&gs_handle);
322
323 return 1;
324 }
325 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_2P048V ? "ok" : "error");
326
327 /* set 1.024V */
328 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_1P024V);
329 if (res != 0)
330 {
331 ads1118_interface_debug_print("ads1118: set range failed.\n");
332 (void)ads1118_deinit(&gs_handle);
333
334 return 1;
335 }
336 ads1118_interface_debug_print("ads1118: set range 1.024V.\n");
337 res = ads1118_get_range(&gs_handle, &range);
338 if (res != 0)
339 {
340 ads1118_interface_debug_print("ads1118: get range failed.\n");
341 (void)ads1118_deinit(&gs_handle);
342
343 return 1;
344 }
345 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_1P024V ? "ok" : "error");
346
347 /* set 0.512V */
348 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_0P512V);
349 if (res != 0)
350 {
351 ads1118_interface_debug_print("ads1118: set range failed.\n");
352 (void)ads1118_deinit(&gs_handle);
353
354 return 1;
355 }
356 ads1118_interface_debug_print("ads1118: set range 0.512V.\n");
357 res = ads1118_get_range(&gs_handle, &range);
358 if (res != 0)
359 {
360 ads1118_interface_debug_print("ads1118: get range failed.\n");
361 (void)ads1118_deinit(&gs_handle);
362
363 return 1;
364 }
365 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_0P512V ? "ok" : "error");
366
367 /* set 0.256V */
368 res = ads1118_set_range(&gs_handle, ADS1118_RANGE_0P256V);
369 if (res != 0)
370 {
371 ads1118_interface_debug_print("ads1118: set range failed.\n");
372 (void)ads1118_deinit(&gs_handle);
373
374 return 1;
375 }
376 ads1118_interface_debug_print("ads1118: set range 0.256V.\n");
377 res = ads1118_get_range(&gs_handle, &range);
378 if (res != 0)
379 {
380 ads1118_interface_debug_print("ads1118: get range failed.\n");
381 (void)ads1118_deinit(&gs_handle);
382
383 return 1;
384 }
385 ads1118_interface_debug_print("ads1118: check range %s.\n", range == ADS1118_RANGE_0P256V ? "ok" : "error");
386
387 /* ads1118_set_mode/ads1118_get_mode test */
388 ads1118_interface_debug_print("ads1118: ads1118_set_mode/ads1118_get_mode test.\n");
389
390 /* set adc mode */
391 res = ads1118_set_mode(&gs_handle, ADS1118_MODE_ADC);
392 if (res != 0)
393 {
394 ads1118_interface_debug_print("ads1118: set mode failed.\n");
395 (void)ads1118_deinit(&gs_handle);
396
397 return 1;
398 }
399 ads1118_interface_debug_print("ads1118: set adc mode.\n");
400 res = ads1118_get_mode(&gs_handle, &mode);
401 if (res != 0)
402 {
403 ads1118_interface_debug_print("ads1118: get mode failed.\n");
404 (void)ads1118_deinit(&gs_handle);
405
406 return 1;
407 }
408 ads1118_interface_debug_print("ads1118: check mode %s.\n", mode == ADS1118_MODE_ADC ? "ok" : "error");
409
410 /* set temperature mode */
412 if (res != 0)
413 {
414 ads1118_interface_debug_print("ads1118: set mode failed.\n");
415 (void)ads1118_deinit(&gs_handle);
416
417 return 1;
418 }
419 ads1118_interface_debug_print("ads1118: set temperature mode.\n");
420 res = ads1118_get_mode(&gs_handle, &mode);
421 if (res != 0)
422 {
423 ads1118_interface_debug_print("ads1118: get mode failed.\n");
424 (void)ads1118_deinit(&gs_handle);
425
426 return 1;
427 }
428 ads1118_interface_debug_print("ads1118: check mode %s.\n", mode == ADS1118_MODE_TEMPERATURE ? "ok" : "error");
429
430 /* ads1118_set_rate/ads1118_get_rate test */
431 ads1118_interface_debug_print("ads1118: ads1118_set_rate/ads1118_get_rate test.\n");
432
433 /* set 8SPS */
434 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_8SPS);
435 if (res != 0)
436 {
437 ads1118_interface_debug_print("ads1118: set rate failed.\n");
438 (void)ads1118_deinit(&gs_handle);
439
440 return 1;
441 }
442 ads1118_interface_debug_print("ads1118: set rate 8 sps.\n");
443 res = ads1118_get_rate(&gs_handle, &rate);
444 if (res != 0)
445 {
446 ads1118_interface_debug_print("ads1118: get rate failed.\n");
447 (void)ads1118_deinit(&gs_handle);
448
449 return 1;
450 }
451 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_8SPS ? "ok" : "error");
452
453 /* set 16SPS */
454 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_16SPS);
455 if (res != 0)
456 {
457 ads1118_interface_debug_print("ads1118: set rate failed.\n");
458 (void)ads1118_deinit(&gs_handle);
459
460 return 1;
461 }
462 ads1118_interface_debug_print("ads1118: set rate 16 sps.\n");
463 res = ads1118_get_rate(&gs_handle, &rate);
464 if (res != 0)
465 {
466 ads1118_interface_debug_print("ads1118: get rate failed.\n");
467 (void)ads1118_deinit(&gs_handle);
468
469 return 1;
470 }
471 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_16SPS ? "ok" : "error");
472
473 /* set 32SPS */
474 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_32SPS);
475 if (res != 0)
476 {
477 ads1118_interface_debug_print("ads1118: set rate failed.\n");
478 (void)ads1118_deinit(&gs_handle);
479
480 return 1;
481 }
482 ads1118_interface_debug_print("ads1118: set rate 32 sps.\n");
483 res = ads1118_get_rate(&gs_handle, &rate);
484 if (res != 0)
485 {
486 ads1118_interface_debug_print("ads1118: get rate failed.\n");
487 (void)ads1118_deinit(&gs_handle);
488
489 return 1;
490 }
491 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_32SPS ? "ok" : "error");
492
493 /* set 64SPS */
494 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_64SPS);
495 if (res != 0)
496 {
497 ads1118_interface_debug_print("ads1118: set rate failed.\n");
498 (void)ads1118_deinit(&gs_handle);
499
500 return 1;
501 }
502 ads1118_interface_debug_print("ads1118: set rate 64 sps.\n");
503 res = ads1118_get_rate(&gs_handle, &rate);
504 if (res != 0)
505 {
506 ads1118_interface_debug_print("ads1118: get rate failed.\n");
507 (void)ads1118_deinit(&gs_handle);
508
509 return 1;
510 }
511 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_64SPS ? "ok" : "error");
512
513 /* set 128SPS */
514 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_128SPS);
515 if (res != 0)
516 {
517 ads1118_interface_debug_print("ads1118: set rate failed.\n");
518 (void)ads1118_deinit(&gs_handle);
519
520 return 1;
521 }
522 ads1118_interface_debug_print("ads1118: set rate 128 sps.\n");
523 res = ads1118_get_rate(&gs_handle, &rate);
524 if (res != 0)
525 {
526 ads1118_interface_debug_print("ads1118: get rate failed.\n");
527 (void)ads1118_deinit(&gs_handle);
528
529 return 1;
530 }
531 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_128SPS ? "ok" : "error");
532
533 /* set 250SPS */
534 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_250SPS);
535 if (res != 0)
536 {
537 ads1118_interface_debug_print("ads1118: set rate failed.\n");
538 (void)ads1118_deinit(&gs_handle);
539
540 return 1;
541 }
542 ads1118_interface_debug_print("ads1118: set rate 250 sps.\n");
543 res = ads1118_get_rate(&gs_handle, &rate);
544 if (res != 0)
545 {
546 ads1118_interface_debug_print("ads1118: get rate failed.\n");
547 (void)ads1118_deinit(&gs_handle);
548
549 return 1;
550 }
551 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_250SPS ? "ok" : "error");
552
553 /* set 475SPS */
554 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_475SPS);
555 if (res != 0)
556 {
557 ads1118_interface_debug_print("ads1118: set rate failed.\n");
558 (void)ads1118_deinit(&gs_handle);
559
560 return 1;
561 }
562 ads1118_interface_debug_print("ads1118: set rate 475 sps.\n");
563 res = ads1118_get_rate(&gs_handle, &rate);
564 if (res != 0)
565 {
566 ads1118_interface_debug_print("ads1118: get rate failed.\n");
567 (void)ads1118_deinit(&gs_handle);
568
569 return 1;
570 }
571 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_475SPS ? "ok" : "error");
572
573 /* set 860SPS */
574 res = ads1118_set_rate(&gs_handle, ADS1118_RATE_860SPS);
575 if (res != 0)
576 {
577 ads1118_interface_debug_print("ads1118: set rate failed.\n");
578 (void)ads1118_deinit(&gs_handle);
579
580 return 1;
581 }
582 ads1118_interface_debug_print("ads1118: set rate 860 sps.\n");
583 res = ads1118_get_rate(&gs_handle, &rate);
584 if (res != 0)
585 {
586 ads1118_interface_debug_print("ads1118: get rate failed.\n");
587 (void)ads1118_deinit(&gs_handle);
588
589 return 1;
590 }
591 ads1118_interface_debug_print("ads1118: check rate %s.\n", rate == ADS1118_RATE_860SPS ? "ok" : "error");
592
593 /* ads1118_set_dout_pull_up/ads1118_get_dout_pull_up test */
594 ads1118_interface_debug_print("ads1118: ads1118_set_dout_pull_up/ads1118_get_dout_pull_up test.\n");
595
596 /* disable dout pull up */
598 if (res != 0)
599 {
600 ads1118_interface_debug_print("ads1118: set dout pull up failed.\n");
601 (void)ads1118_deinit(&gs_handle);
602
603 return 1;
604 }
605 ads1118_interface_debug_print("ads1118: disable dout pull up.\n");
606 res = ads1118_get_dout_pull_up(&gs_handle, &enable);
607 if (res != 0)
608 {
609 ads1118_interface_debug_print("ads1118: get dout pull up failed.\n");
610 (void)ads1118_deinit(&gs_handle);
611
612 return 1;
613 }
614 ads1118_interface_debug_print("ads1118: check dout pull up %s.\n", enable == ADS1118_BOOL_FALSE ? "ok" : "error");
615
616 /* enable dout pull up */
618 if (res != 0)
619 {
620 ads1118_interface_debug_print("ads1118: set dout pull up failed.\n");
621 (void)ads1118_deinit(&gs_handle);
622
623 return 1;
624 }
625 ads1118_interface_debug_print("ads1118: enable dout pull up.\n");
626 res = ads1118_get_dout_pull_up(&gs_handle, &enable);
627 if (res != 0)
628 {
629 ads1118_interface_debug_print("ads1118: get dout pull up failed.\n");
630 (void)ads1118_deinit(&gs_handle);
631
632 return 1;
633 }
634 ads1118_interface_debug_print("ads1118: check dout pull up %s.\n", enable == ADS1118_BOOL_TRUE ? "ok" : "error");
635
636 /* finish register */
637 ads1118_interface_debug_print("ads1118: finish register test.\n");
638 (void)ads1118_deinit(&gs_handle);
639
640 return 0;
641}
driver ads1118 register test header file
uint8_t ads1118_get_channel(ads1118_handle_t *handle, ads1118_channel_t *channel)
get the adc channel
uint8_t ads1118_set_channel(ads1118_handle_t *handle, ads1118_channel_t channel)
set the adc channel
uint8_t ads1118_set_range(ads1118_handle_t *handle, ads1118_range_t range)
set the adc range
uint8_t ads1118_info(ads1118_info_t *info)
get chip's information
ads1118_mode_t
ads1118 mode enumeration definition
ads1118_bool_t
ads1118 bool enumeration definition
uint8_t ads1118_get_mode(ads1118_handle_t *handle, ads1118_mode_t *mode)
get the chip mode
struct ads1118_info_s ads1118_info_t
ads1118 information structure definition
ads1118_range_t
ads1118 range enumeration definition
uint8_t ads1118_init(ads1118_handle_t *handle)
initialize the chip
uint8_t ads1118_set_dout_pull_up(ads1118_handle_t *handle, ads1118_bool_t enable)
enable or disable dout pull up
uint8_t ads1118_deinit(ads1118_handle_t *handle)
close the chip
struct ads1118_handle_s ads1118_handle_t
ads1118 handle structure definition
uint8_t ads1118_set_rate(ads1118_handle_t *handle, ads1118_rate_t rate)
set the sample rate
uint8_t ads1118_get_rate(ads1118_handle_t *handle, ads1118_rate_t *rate)
get the sample rate
ads1118_channel_t
ads1118 channel enumeration definition
ads1118_rate_t
ads1118 channel rate enumeration definition
uint8_t ads1118_set_mode(ads1118_handle_t *handle, ads1118_mode_t mode)
set the chip mode
uint8_t ads1118_get_dout_pull_up(ads1118_handle_t *handle, ads1118_bool_t *enable)
get dout pull up status
uint8_t ads1118_get_range(ads1118_handle_t *handle, ads1118_range_t *range)
get the adc range
@ ADS1118_MODE_TEMPERATURE
@ ADS1118_MODE_ADC
@ ADS1118_BOOL_TRUE
@ ADS1118_BOOL_FALSE
@ ADS1118_RANGE_0P256V
@ ADS1118_RANGE_1P024V
@ ADS1118_RANGE_0P512V
@ ADS1118_RANGE_2P048V
@ ADS1118_RANGE_6P144V
@ ADS1118_RANGE_4P096V
@ ADS1118_CHANNEL_AIN2_GND
@ ADS1118_CHANNEL_AIN0_GND
@ ADS1118_CHANNEL_AIN0_AIN1
@ ADS1118_CHANNEL_AIN0_AIN3
@ ADS1118_CHANNEL_AIN2_AIN3
@ ADS1118_CHANNEL_AIN1_GND
@ ADS1118_CHANNEL_AIN3_GND
@ ADS1118_CHANNEL_AIN1_AIN3
@ ADS1118_RATE_64SPS
@ ADS1118_RATE_16SPS
@ ADS1118_RATE_32SPS
@ ADS1118_RATE_860SPS
@ ADS1118_RATE_475SPS
@ ADS1118_RATE_128SPS
@ ADS1118_RATE_8SPS
@ ADS1118_RATE_250SPS
void ads1118_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t ads1118_interface_spi_transmit(uint8_t *tx, uint8_t *rx, uint16_t len)
interface spi bus transmit
uint8_t ads1118_interface_spi_deinit(void)
interface spi bus deinit
uint8_t ads1118_interface_spi_init(void)
interface spi bus init
void ads1118_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ads1118_register_test(void)
register test
uint32_t driver_version
char manufacturer_name[32]