HPM SDK
HPMicro Software Development Kit
hpm_adc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef HPM_ADC_H
8 #define HPM_ADC_H
9 
10 #include "hpm_common.h"
11 #ifdef HPMSOC_HAS_HPMSDK_ADC12
12 #include "hpm_adc12_drv.h"
13 #endif
14 #ifdef HPMSOC_HAS_HPMSDK_ADC16
15 #include "hpm_adc16_drv.h"
16 #endif
17 #include "hpm_soc_feature.h"
29 typedef union {
30 #ifdef HPMSOC_HAS_HPMSDK_ADC12
31  ADC12_Type *adc12;
32 #endif
33 #ifdef HPMSOC_HAS_HPMSDK_ADC16
34  ADC16_Type *adc16;
35 #endif
36 } adc_base;
37 
42 #define ADCX_MODULE_ADC12 1
43 #define ADCX_MODULE_ADC16 2
44 
45 typedef enum {
49 
54 typedef struct {
57  struct {
58 #ifdef HPMSOC_HAS_HPMSDK_ADC12
59  adc12_config_t adc12;
60 #endif
61 #ifdef HPMSOC_HAS_HPMSDK_ADC16
62  adc16_config_t adc16;
63 #endif
64  } config;
65 } adc_config_t;
66 
71 typedef struct {
74  struct {
75 #ifdef HPMSOC_HAS_HPMSDK_ADC12
76  adc12_channel_config_t adc12_ch;
77 #endif
78 #ifdef HPMSOC_HAS_HPMSDK_ADC16
79  adc16_channel_config_t adc16_ch;
80 #endif
81  } config;
83 
88 typedef struct {
91  struct {
92 #ifdef HPMSOC_HAS_HPMSDK_ADC12
93  adc12_dma_config_t adc12;
94 #endif
95 #ifdef HPMSOC_HAS_HPMSDK_ADC16
96  adc16_dma_config_t adc16;
97 #endif
98  } config;
100 
105 typedef struct {
108  struct {
109 #ifdef HPMSOC_HAS_HPMSDK_ADC12
110  adc12_prd_config_t adc12;
111 #endif
112 #ifdef HPMSOC_HAS_HPMSDK_ADC16
113  adc16_prd_config_t adc16;
114 #endif
115  } config;
117 
122 typedef struct {
125  struct {
126 #ifdef HPMSOC_HAS_HPMSDK_ADC12
127  adc12_seq_config_t adc12;
128 #endif
129 #ifdef HPMSOC_HAS_HPMSDK_ADC16
130  adc16_seq_config_t adc16;
131 #endif
132  } config;
134 
139 typedef struct {
142  struct {
143 #ifdef HPMSOC_HAS_HPMSDK_ADC12
144  adc12_pmt_config_t adc12;
145 #endif
146 #ifdef HPMSOC_HAS_HPMSDK_ADC16
147  adc16_pmt_config_t adc16;
148 #endif
149  } config;
151 
152 
153 typedef struct {
156 } adc_type;
157 
158 
159 
160 #ifdef __cplusplus
161 extern "C" {
162 #endif
163 
170 static inline void hpm_adc_init_default_config(adc_config_t *config)
171 {
172  if (config->module == adc_module_adc12) {
173 #ifdef HPMSOC_HAS_HPMSDK_ADC12
174  adc12_get_default_config(&config->config.adc12);
175 #endif
176  } else if (config->module == adc_module_adc16) {
177 #ifdef HPMSOC_HAS_HPMSDK_ADC16
178  adc16_get_default_config(&config->config.adc16);
179 #endif
180  }
181 }
182 
190 {
191  if (config->module == adc_module_adc12) {
192 #ifdef HPMSOC_HAS_HPMSDK_ADC12
193  adc12_get_channel_default_config(&config->config.adc12_ch);
194 #endif
195  } else if (config->module == adc_module_adc16) {
196 #ifdef HPMSOC_HAS_HPMSDK_ADC16
197  adc16_get_channel_default_config(&config->config.adc16_ch);
198 #endif
199  }
200 }
201 
209 static inline hpm_stat_t hpm_adc_init(adc_config_t *config)
210 {
211  if (config->module == adc_module_adc12) {
212 #ifdef HPMSOC_HAS_HPMSDK_ADC12
213  return adc12_init(config->adc_base.adc12, &config->config.adc12);
214 #else
216 #endif
217  } else if (config->module == adc_module_adc16) {
218 #ifdef HPMSOC_HAS_HPMSDK_ADC16
219  return adc16_init(config->adc_base.adc16, &config->config.adc16);
220 #else
222 #endif
223  } else {
225  }
226 }
227 
236 {
237  if (config->module == adc_module_adc12) {
238 #ifdef HPMSOC_HAS_HPMSDK_ADC12
239  return adc12_init_channel(config->adc_base.adc12, &config->config.adc12_ch);
240 #else
242 #endif
243  } else if (config->module == adc_module_adc16) {
244 #ifdef HPMSOC_HAS_HPMSDK_ADC16
245  return adc16_init_channel(config->adc_base.adc16, &config->config.adc16_ch);
246 #else
248 #endif
249  } else {
251  }
252 }
253 
263 {
264  if (config->module == adc_module_adc12) {
265 #ifdef HPMSOC_HAS_HPMSDK_ADC12
266  return adc12_set_prd_config(config->adc_base.adc12, &config->config.adc12);
267 #else
269 #endif
270  } else if (config->module == adc_module_adc16) {
271 #ifdef HPMSOC_HAS_HPMSDK_ADC16
272  return adc16_set_prd_config(config->adc_base.adc16, &config->config.adc16);
273 #else
275 #endif
276  } else {
278  }
279 }
280 
289 {
290  if (config->module == adc_module_adc12) {
291 #ifdef HPMSOC_HAS_HPMSDK_ADC12
292  return adc12_set_seq_config(config->adc_base.adc12, &config->config.adc12);
293 #else
295 #endif
296  } else if (config->module == adc_module_adc16) {
297 #ifdef HPMSOC_HAS_HPMSDK_ADC16
298  return adc16_set_seq_config(config->adc_base.adc16, &config->config.adc16);
299 #else
301 #endif
302  } else {
304  }
305 }
306 
315 {
316  if (config->module == adc_module_adc12) {
317 #ifdef HPMSOC_HAS_HPMSDK_ADC12
318  return adc12_set_pmt_config(config->adc_base.adc12, &config->config.adc12);
319 #else
321 #endif
322  } else if (config->module == adc_module_adc16) {
323 #ifdef HPMSOC_HAS_HPMSDK_ADC16
324  return adc16_set_pmt_config(config->adc_base.adc16, &config->config.adc16);
325 #else
327 #endif
328  } else {
330  }
331 }
332 
339 static inline void hpm_adc_set_seq_stop_pos(adc_type *ptr, uint16_t stop_pos)
340 {
341  if (ptr->module == adc_module_adc12) {
342 #ifdef HPMSOC_HAS_HPMSDK_ADC12
343  adc12_set_seq_stop_pos(ptr->adc_base.adc12, stop_pos);
344 #endif
345  } else if (ptr->module == adc_module_adc16) {
346 #ifdef HPMSOC_HAS_HPMSDK_ADC16
347  adc16_set_seq_stop_pos(ptr->adc_base.adc16, stop_pos);
348 #endif
349  }
350 }
351 
358 static inline void hpm_adc_init_pmt_dma(adc_type *ptr, uint32_t addr)
359 {
360  if (ptr->module == adc_module_adc12) {
361 #ifdef HPMSOC_HAS_HPMSDK_ADC12
362  adc12_init_pmt_dma(ptr->adc_base.adc12, addr);
363 #endif
364  } else if (ptr->module == adc_module_adc16) {
365 #ifdef HPMSOC_HAS_HPMSDK_ADC16
366  adc16_init_pmt_dma(ptr->adc_base.adc16, addr);
367 #endif
368  }
369 }
370 
376 static inline void hpm_adc_init_seq_dma(adc_dma_config_t *config)
377 {
378  if (config->module == adc_module_adc12) {
379 #ifdef HPMSOC_HAS_HPMSDK_ADC12
380  adc12_init_seq_dma(config->adc_base.adc12, &config->config.adc12);
381 #endif
382  } else if (config->module == adc_module_adc16) {
383 #ifdef HPMSOC_HAS_HPMSDK_ADC16
384  adc16_init_seq_dma(config->adc_base.adc16, &config->config.adc16);
385 #endif
386  }
387 }
388 
395 static inline void hpm_adc_disable_busywait(adc_dma_config_t *config)
396 {
397  if (config->module == adc_module_adc12) {
398 #ifdef HPMSOC_HAS_HPMSDK_ADC12
399  adc12_disable_busywait(config->adc_base.adc12);
400 #endif
401  } else if (config->module == adc_module_adc16) {
402 #ifdef HPMSOC_HAS_HPMSDK_ADC16
403  adc16_disable_busywait(config->adc_base.adc16);
404 #endif
405  }
406 }
407 
414 static inline void hpm_adc_enable_busywait(adc_dma_config_t *config)
415 {
416  if (config->module == adc_module_adc12) {
417 #ifdef HPMSOC_HAS_HPMSDK_ADC12
418  adc12_enable_busywait(config->adc_base.adc12);
419 #endif
420  } else if (config->module == adc_module_adc16) {
421 #ifdef HPMSOC_HAS_HPMSDK_ADC16
422  adc16_enable_busywait(config->adc_base.adc16);
423 #endif
424  }
425 }
426 
427 
435 static inline uint32_t hpm_adc_get_status_flags(adc_type *ptr)
436 {
437  if (ptr->module == adc_module_adc12) {
438 #ifdef HPMSOC_HAS_HPMSDK_ADC12
439  return adc12_get_status_flags(ptr->adc_base.adc12);
440 #else
442 #endif
443  } else if (ptr->module == adc_module_adc16) {
444 #ifdef HPMSOC_HAS_HPMSDK_ADC16
445  return adc16_get_status_flags(ptr->adc_base.adc16);
446 #else
448 #endif
449  } else {
451  }
452 }
453 
463 static inline bool hpm_adc_get_conv_valid_status(adc_type *ptr, uint8_t ch)
464 {
465  if (ptr->module == adc_module_adc12) {
466 #ifdef HPMSOC_HAS_HPMSDK_ADC12
467  return adc12_get_conv_valid_status(ptr->adc_base.adc12, ch);
468 #else
470 #endif
471  } else if (ptr->module == adc_module_adc16) {
472 #ifdef HPMSOC_HAS_HPMSDK_ADC16
473  return adc16_get_conv_valid_status(ptr->adc_base.adc16, ch);
474 #else
476 #endif
477  } else {
479  }
480 }
481 
490 static inline void hpm_adc_clear_status_flags(adc_type *ptr, uint32_t mask)
491 {
492  if (ptr->module == adc_module_adc12) {
493 #ifdef HPMSOC_HAS_HPMSDK_ADC12
494  adc12_clear_status_flags(ptr->adc_base.adc12, mask);
495 #endif
496  } else if (ptr->module == adc_module_adc16) {
497 #ifdef HPMSOC_HAS_HPMSDK_ADC16
498  adc16_clear_status_flags(ptr->adc_base.adc16, mask);
499 #endif
500  }
501 }
502 
509 static inline void hpm_adc_enable_interrupts(adc_type *ptr, uint32_t mask)
510 {
511  if (ptr->module == adc_module_adc12) {
512 #ifdef HPMSOC_HAS_HPMSDK_ADC12
513  adc12_enable_interrupts(ptr->adc_base.adc12, mask);
514 #endif
515  } else if (ptr->module == adc_module_adc16) {
516 #ifdef HPMSOC_HAS_HPMSDK_ADC16
517  adc16_enable_interrupts(ptr->adc_base.adc16, mask);
518 #endif
519  }
520 }
521 
528 static inline void hpm_adc_disable_interrupts(adc_type *ptr, uint32_t mask)
529 {
530  if (ptr->module == adc_module_adc12) {
531 #ifdef HPMSOC_HAS_HPMSDK_ADC12
532  adc12_disable_interrupts(ptr->adc_base.adc12, mask);
533 #endif
534  } else if (ptr->module == adc_module_adc16) {
535 #ifdef HPMSOC_HAS_HPMSDK_ADC16
536  adc16_disable_interrupts(ptr->adc_base.adc16, mask);
537 #endif
538  }
539 }
540 
551 static inline hpm_stat_t hpm_adc_get_oneshot_result(adc_type *ptr, uint8_t ch, uint16_t *result)
552 {
553  if (ptr->module == adc_module_adc12) {
554 #ifdef HPMSOC_HAS_HPMSDK_ADC12
555  return adc12_get_oneshot_result(ptr->adc_base.adc12, ch, result);
556 #else
558 #endif
559  } else if (ptr->module == adc_module_adc16) {
560 #ifdef HPMSOC_HAS_HPMSDK_ADC16
561  return adc16_get_oneshot_result(ptr->adc_base.adc16, ch, result);
562 #else
564 #endif
565  } else {
567  }
568 }
569 
580 static inline hpm_stat_t hpm_adc_get_prd_result(adc_type *ptr, uint8_t ch, uint16_t *result)
581 {
582  if (ptr->module == adc_module_adc12) {
583 #ifdef HPMSOC_HAS_HPMSDK_ADC12
584  return adc12_get_prd_result(ptr->adc_base.adc12, ch, result);
585 #else
587 #endif
588  } else if (ptr->module == adc_module_adc16) {
589 #ifdef HPMSOC_HAS_HPMSDK_ADC16
590  return adc16_get_prd_result(ptr->adc_base.adc16, ch, result);
591 #else
593 #endif
594  } else {
596  }
597 }
598 
606 {
607  if (ptr->module == adc_module_adc12) {
608 #ifdef HPMSOC_HAS_HPMSDK_ADC12
609  return adc12_trigger_seq_by_sw(ptr->adc_base.adc12);
610 #endif
611  } else if (ptr->module == adc_module_adc16) {
612 #ifdef HPMSOC_HAS_HPMSDK_ADC16
613  return adc16_trigger_seq_by_sw(ptr->adc_base.adc16);
614 #endif
615  } else {
617  }
618 }
619 
620 #ifdef __cplusplus
621 }
622 #endif
623 
626 #endif
static void adc12_disable_busywait(ADC12_Type *ptr)
Set value of the WAIT_DIS bit. The ADC does not block access to the associated peripheral bus until t...
Definition: hpm_adc12_drv.h:379
hpm_stat_t adc12_init(ADC12_Type *ptr, adc12_config_t *config)
Initialize an ADC12 instance.
Definition: hpm_adc12_drv.c:93
hpm_stat_t adc12_get_oneshot_result(ADC12_Type *ptr, uint8_t ch, uint16_t *result)
Get the result in oneshot mode.
Definition: hpm_adc12_drv.c:342
static void adc12_init_pmt_dma(ADC12_Type *ptr, uint32_t addr)
Configure the start address of DMA write operation for the preemption mode.
Definition: hpm_adc12_drv.h:337
hpm_stat_t adc12_init_seq_dma(ADC12_Type *ptr, adc12_dma_config_t *config)
Configure the start address of DMA write operation for the sequence mode.
Definition: hpm_adc12_drv.c:211
static void adc12_disable_interrupts(ADC12_Type *ptr, uint32_t mask)
Disable interrupts.
Definition: hpm_adc12_drv.h:484
static void adc12_enable_interrupts(ADC12_Type *ptr, uint32_t mask)
Enable interrupts.
Definition: hpm_adc12_drv.h:473
hpm_stat_t adc12_set_pmt_config(ADC12_Type *ptr, adc12_pmt_config_t *config)
Configure the preemption mode for an ADC12 instance.
Definition: hpm_adc12_drv.c:312
hpm_stat_t adc12_trigger_seq_by_sw(ADC12_Type *ptr)
Trigger ADC conversions by software in sequence mode.
Definition: hpm_adc12_drv.c:267
hpm_stat_t adc12_set_prd_config(ADC12_Type *ptr, adc12_prd_config_t *config)
Configure the the period mode for an ADC12 instance.
Definition: hpm_adc12_drv.c:244
void adc12_get_default_config(adc12_config_t *config)
Get a default configuration for an ADC12 instance.
Definition: hpm_adc12_drv.c:11
static bool adc12_get_conv_valid_status(ADC12_Type *ptr, uint8_t ch)
Get the status of a conversion validity.
Definition: hpm_adc12_drv.h:441
hpm_stat_t adc12_set_seq_config(ADC12_Type *ptr, adc12_seq_config_t *config)
Configure the the sequence mode for an ADC12 instance.
Definition: hpm_adc12_drv.c:278
static void adc12_clear_status_flags(ADC12_Type *ptr, uint32_t mask)
Clear the status flags.
Definition: hpm_adc12_drv.h:455
hpm_stat_t adc12_init_channel(ADC12_Type *ptr, adc12_channel_config_t *config)
Initialize an ADC12 channel.
Definition: hpm_adc12_drv.c:166
static void adc12_enable_busywait(ADC12_Type *ptr)
Set value of the WAIT_DIS bit. ADC blocks access to the associated peripheral bus until the ADC compl...
Definition: hpm_adc12_drv.h:391
void adc12_get_channel_default_config(adc12_channel_config_t *config)
Get a default configuration for an ADC12 channel.
Definition: hpm_adc12_drv.c:21
static void adc12_set_seq_stop_pos(ADC12_Type *ptr, uint16_t stop_pos)
Configure the stop position offset in the specified memory of DMA write operation for the sequence mo...
Definition: hpm_adc12_drv.h:325
static uint32_t adc12_get_status_flags(ADC12_Type *ptr)
Get all ADC12 status flags.
Definition: hpm_adc12_drv.h:367
hpm_stat_t adc12_get_prd_result(ADC12_Type *ptr, uint8_t ch, uint16_t *result)
Get the result in the period mode.
Definition: hpm_adc12_drv.c:363
hpm_stat_t adc16_get_oneshot_result(ADC16_Type *ptr, uint8_t ch, uint16_t *result)
Get the result in oneshot mode.
Definition: hpm_adc16_drv.c:452
static void adc16_enable_busywait(ADC16_Type *ptr)
Set value of the WAIT_DIS bit. ADC blocks access to the associated peripheral bus until the ADC compl...
Definition: hpm_adc16_drv.h:525
hpm_stat_t adc16_trigger_seq_by_sw(ADC16_Type *ptr)
Trigger ADC conversions by software in sequence mode.
Definition: hpm_adc16_drv.c:325
hpm_stat_t adc16_init(ADC16_Type *ptr, adc16_config_t *config)
Initialize an ADC16 instance.
Definition: hpm_adc16_drv.c:154
static uint32_t adc16_get_status_flags(ADC16_Type *ptr)
Get all ADC16 status flags.
Definition: hpm_adc16_drv.h:501
static bool adc16_get_conv_valid_status(ADC16_Type *ptr, uint8_t ch)
Get the status of a conversion validity.
Definition: hpm_adc16_drv.h:575
static void adc16_enable_interrupts(ADC16_Type *ptr, uint32_t mask)
Enable interrupts.
Definition: hpm_adc16_drv.h:607
void adc16_get_default_config(adc16_config_t *config)
Get a default configuration for an ADC16 instance.
Definition: hpm_adc16_drv.c:11
hpm_stat_t adc16_get_prd_result(ADC16_Type *ptr, uint8_t ch, uint16_t *result)
Get the result in the period mode.
Definition: hpm_adc16_drv.c:474
void adc16_get_channel_default_config(adc16_channel_config_t *config)
Get a default configuration for an ADC16 Channel.
Definition: hpm_adc16_drv.c:22
hpm_stat_t adc16_set_seq_config(ADC16_Type *ptr, adc16_seq_config_t *config)
Configure the sequence mode for an ADC16 instance.
Definition: hpm_adc16_drv.c:336
static void adc16_init_pmt_dma(ADC16_Type *ptr, uint32_t addr)
Configure the start address of DMA write operation for the preemption mode.
Definition: hpm_adc16_drv.h:471
static void adc16_set_seq_stop_pos(ADC16_Type *ptr, uint16_t stop_pos)
Configure the stop position offset in the specified memory of DMA write operation for the sequence mo...
Definition: hpm_adc16_drv.h:459
static void adc16_disable_interrupts(ADC16_Type *ptr, uint32_t mask)
Disable interrupts.
Definition: hpm_adc16_drv.h:618
hpm_stat_t adc16_init_channel(ADC16_Type *ptr, adc16_channel_config_t *config)
Initialize an ADC16 channel.
Definition: hpm_adc16_drv.c:203
hpm_stat_t adc16_set_prd_config(ADC16_Type *ptr, adc16_prd_config_t *config)
Configure the the period mode for an ADC16 instance.
Definition: hpm_adc16_drv.c:302
static void adc16_clear_status_flags(ADC16_Type *ptr, uint32_t mask)
Clear the status flags.
Definition: hpm_adc16_drv.h:589
hpm_stat_t adc16_set_pmt_config(ADC16_Type *ptr, adc16_pmt_config_t *config)
Configure the preemption mode for an ADC16 instance.
Definition: hpm_adc16_drv.c:370
static void adc16_disable_busywait(ADC16_Type *ptr)
Set value of the WAIT_DIS bit. The ADC does not block access to the associated peripheral bus until t...
Definition: hpm_adc16_drv.h:513
hpm_stat_t adc16_init_seq_dma(ADC16_Type *ptr, adc16_dma_config_t *config)
Configure the start address of DMA write operation for the sequence mode.
Definition: hpm_adc16_drv.c:258
uint32_t hpm_stat_t
Definition: hpm_common.h:123
@ status_invalid_argument
Definition: hpm_common.h:179
static void hpm_adc_clear_status_flags(adc_type *ptr, uint32_t mask)
Clear status flags.
Definition: hpm_adc.h:490
static void hpm_adc_disable_busywait(adc_dma_config_t *config)
Reset value of the WAIT_DIS bit. ADC blocks access to the associated peripheral bus until the ADC com...
Definition: hpm_adc.h:395
static uint32_t hpm_adc_get_status_flags(adc_type *ptr)
Get ADC status flags.
Definition: hpm_adc.h:435
static hpm_stat_t hpm_adc_trigger_seq_by_sw(adc_type *ptr)
Do a software trigger for sequence mode.
Definition: hpm_adc.h:605
static void hpm_adc_enable_interrupts(adc_type *ptr, uint32_t mask)
Enable interrupts.
Definition: hpm_adc.h:509
static hpm_stat_t hpm_adc_set_preempt_config(adc_pmt_config_t *config)
Configure the preemption mode for an ADC instance.
Definition: hpm_adc.h:314
static void hpm_adc_enable_busywait(adc_dma_config_t *config)
Set value of the WAIT_DIS bit. The ADC does not block access to the associated peripheral bus until t...
Definition: hpm_adc.h:414
static void hpm_adc_set_seq_stop_pos(adc_type *ptr, uint16_t stop_pos)
Configure the stop position offset in the specified memory for DMA write operation for sequence mode.
Definition: hpm_adc.h:339
adc_module
Definition: hpm_adc.h:45
static void hpm_adc_init_pmt_dma(adc_type *ptr, uint32_t addr)
Configure the start address of DMA write operation for preemption mode.
Definition: hpm_adc.h:358
static hpm_stat_t hpm_adc_set_period_config(adc_prd_config_t *config)
Configure the periodic mode for an ADC instance.
Definition: hpm_adc.h:262
static hpm_stat_t hpm_adc_get_oneshot_result(adc_type *ptr, uint8_t ch, uint16_t *result)
Get the result in oneshot mode.
Definition: hpm_adc.h:551
#define ADCX_MODULE_ADC12
use adc12 or adc16.
Definition: hpm_adc.h:42
static void hpm_adc_init_seq_dma(adc_dma_config_t *config)
Configure the start address of DMA write operation for preemption mode.
Definition: hpm_adc.h:376
static hpm_stat_t hpm_adc_set_sequence_config(adc_seq_config_t *config)
Configure the sequence mode for an ADC instance.
Definition: hpm_adc.h:288
static void hpm_adc_init_default_config(adc_config_t *config)
Get a default configuration for an ADC instance.
Definition: hpm_adc.h:170
static bool hpm_adc_get_conv_valid_status(adc_type *ptr, uint8_t ch)
Get status flag of a conversion.
Definition: hpm_adc.h:463
static hpm_stat_t hpm_adc_get_prd_result(adc_type *ptr, uint8_t ch, uint16_t *result)
Get the result in periodic mode.
Definition: hpm_adc.h:580
static hpm_stat_t hpm_adc_channel_init(adc_channel_config_t *config)
Initialize an ADC channel.
Definition: hpm_adc.h:235
static void hpm_adc_init_channel_default_config(adc_channel_config_t *config)
Get a default configuration for an ADC channel instance.
Definition: hpm_adc.h:189
static void hpm_adc_disable_interrupts(adc_type *ptr, uint32_t mask)
Disable interrupts.
Definition: hpm_adc.h:528
static hpm_stat_t hpm_adc_init(adc_config_t *config)
Initialize an ADC instance.
Definition: hpm_adc.h:209
#define ADCX_MODULE_ADC16
Definition: hpm_adc.h:43
@ adc_module_adc12
Definition: hpm_adc.h:46
@ adc_module_adc16
Definition: hpm_adc.h:47
Definition: hpm_adc12_regs.h:12
Definition: hpm_adc16_regs.h:12
ADC12 channel configuration struct.
Definition: hpm_adc12_drv.h:134
ADC12 common configuration struct.
Definition: hpm_adc12_drv.h:123
ADC12 DMA configuration struct.
Definition: hpm_adc12_drv.h:152
ADC12 trigger configuration struct for the preemption mode.
Definition: hpm_adc12_drv.h:206
ADC12 configuration struct for the period mode.
Definition: hpm_adc12_drv.h:183
ADC12 configuration struct for the sequence mode.
Definition: hpm_adc12_drv.h:196
ADC16 channel configuration struct.
Definition: hpm_adc16_drv.h:136
ADC16 common configuration struct.
Definition: hpm_adc16_drv.h:125
ADC16 DMA configuration struct.
Definition: hpm_adc16_drv.h:153
ADC16 trigger configuration struct for the preemption mode.
Definition: hpm_adc16_drv.h:226
ADC16 configuration struct for the period mode.
Definition: hpm_adc16_drv.h:203
ADC16 configuration struct for the sequence mode.
Definition: hpm_adc16_drv.h:216
ADC channel configuration struct.
Definition: hpm_adc.h:71
adc_module module
Definition: hpm_adc.h:72
adc_base adc_base
Definition: hpm_adc.h:73
struct adc_channel_config_t::@740 config
ADC common configuration struct.
Definition: hpm_adc.h:54
struct adc_config_t::@739 config
adc_module module
Definition: hpm_adc.h:55
adc_base adc_base
Definition: hpm_adc.h:56
ADC DMA configuration struct.
Definition: hpm_adc.h:88
adc_module module
Definition: hpm_adc.h:89
adc_base adc_base
Definition: hpm_adc.h:90
struct adc_dma_config_t::@741 config
ADC trigger configuration struct for preempt mode.
Definition: hpm_adc.h:139
struct adc_pmt_config_t::@744 config
adc_base adc_base
Definition: hpm_adc.h:141
adc_module module
Definition: hpm_adc.h:140
ADC configuration struct for period mode.
Definition: hpm_adc.h:105
struct adc_prd_config_t::@742 config
adc_base adc_base
Definition: hpm_adc.h:107
adc_module module
Definition: hpm_adc.h:106
ADC configuration struct for sequence mode.
Definition: hpm_adc.h:122
struct adc_seq_config_t::@743 config
adc_base adc_base
Definition: hpm_adc.h:124
adc_module module
Definition: hpm_adc.h:123
Definition: hpm_adc.h:153
adc_base adc_base
Definition: hpm_adc.h:155
adc_module module
Definition: hpm_adc.h:154
An ADC peripheral base address.
Definition: hpm_adc.h:29