11 #ifdef HPMSOC_HAS_HPMSDK_ADC12
14 #ifdef HPMSOC_HAS_HPMSDK_ADC16
17 #include "hpm_soc_feature.h"
30 #ifdef HPMSOC_HAS_HPMSDK_ADC12
33 #ifdef HPMSOC_HAS_HPMSDK_ADC16
42 #define ADCX_MODULE_ADC12 1
43 #define ADCX_MODULE_ADC16 2
58 #ifdef HPMSOC_HAS_HPMSDK_ADC12
61 #ifdef HPMSOC_HAS_HPMSDK_ADC16
75 #ifdef HPMSOC_HAS_HPMSDK_ADC12
78 #ifdef HPMSOC_HAS_HPMSDK_ADC16
92 #ifdef HPMSOC_HAS_HPMSDK_ADC12
95 #ifdef HPMSOC_HAS_HPMSDK_ADC16
109 #ifdef HPMSOC_HAS_HPMSDK_ADC12
112 #ifdef HPMSOC_HAS_HPMSDK_ADC16
126 #ifdef HPMSOC_HAS_HPMSDK_ADC12
129 #ifdef HPMSOC_HAS_HPMSDK_ADC16
143 #ifdef HPMSOC_HAS_HPMSDK_ADC12
146 #ifdef HPMSOC_HAS_HPMSDK_ADC16
173 #ifdef HPMSOC_HAS_HPMSDK_ADC12
177 #ifdef HPMSOC_HAS_HPMSDK_ADC16
192 #ifdef HPMSOC_HAS_HPMSDK_ADC12
196 #ifdef HPMSOC_HAS_HPMSDK_ADC16
212 #ifdef HPMSOC_HAS_HPMSDK_ADC12
218 #ifdef HPMSOC_HAS_HPMSDK_ADC16
238 #ifdef HPMSOC_HAS_HPMSDK_ADC12
244 #ifdef HPMSOC_HAS_HPMSDK_ADC16
265 #ifdef HPMSOC_HAS_HPMSDK_ADC12
271 #ifdef HPMSOC_HAS_HPMSDK_ADC16
291 #ifdef HPMSOC_HAS_HPMSDK_ADC12
297 #ifdef HPMSOC_HAS_HPMSDK_ADC16
317 #ifdef HPMSOC_HAS_HPMSDK_ADC12
323 #ifdef HPMSOC_HAS_HPMSDK_ADC16
342 #ifdef HPMSOC_HAS_HPMSDK_ADC12
346 #ifdef HPMSOC_HAS_HPMSDK_ADC16
361 #ifdef HPMSOC_HAS_HPMSDK_ADC12
365 #ifdef HPMSOC_HAS_HPMSDK_ADC16
379 #ifdef HPMSOC_HAS_HPMSDK_ADC12
383 #ifdef HPMSOC_HAS_HPMSDK_ADC16
398 #ifdef HPMSOC_HAS_HPMSDK_ADC12
402 #ifdef HPMSOC_HAS_HPMSDK_ADC16
417 #ifdef HPMSOC_HAS_HPMSDK_ADC12
421 #ifdef HPMSOC_HAS_HPMSDK_ADC16
438 #ifdef HPMSOC_HAS_HPMSDK_ADC12
444 #ifdef HPMSOC_HAS_HPMSDK_ADC16
466 #ifdef HPMSOC_HAS_HPMSDK_ADC12
472 #ifdef HPMSOC_HAS_HPMSDK_ADC16
493 #ifdef HPMSOC_HAS_HPMSDK_ADC12
497 #ifdef HPMSOC_HAS_HPMSDK_ADC16
512 #ifdef HPMSOC_HAS_HPMSDK_ADC12
516 #ifdef HPMSOC_HAS_HPMSDK_ADC16
531 #ifdef HPMSOC_HAS_HPMSDK_ADC12
535 #ifdef HPMSOC_HAS_HPMSDK_ADC16
554 #ifdef HPMSOC_HAS_HPMSDK_ADC12
560 #ifdef HPMSOC_HAS_HPMSDK_ADC16
583 #ifdef HPMSOC_HAS_HPMSDK_ADC12
589 #ifdef HPMSOC_HAS_HPMSDK_ADC16
608 #ifdef HPMSOC_HAS_HPMSDK_ADC12
612 #ifdef HPMSOC_HAS_HPMSDK_ADC16
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