HPM SDK
HPMicro Software Development Kit
ADC12 driver APIs

ADC12 driver APIs. More...

Data Structures

struct  adc12_config_t
 ADC12 common configuration struct. More...
 
struct  adc12_channel_config_t
 ADC12 channel configuration struct. More...
 
struct  adc12_channel_threshold_t
 ADC12 channel configuration struct. More...
 
struct  adc12_dma_config_t
 ADC12 DMA configuration struct. More...
 
struct  adc12_seq_dma_data_t
 ADC12 DMA configuration struct for the sequence mode. More...
 
struct  adc12_pmt_dma_data_t
 ADC12 DMA configuration struct for the preemption mode. More...
 
struct  adc12_prd_config_t
 ADC12 configuration struct for the period mode. More...
 
struct  adc12_seq_queue_config_t
 ADC12 queue configuration struct for the sequence mode. More...
 
struct  adc12_seq_config_t
 ADC12 configuration struct for the sequence mode. More...
 
struct  adc12_pmt_config_t
 ADC12 trigger configuration struct for the preemption mode. More...
 

Macros

#define ADC12_IS_SIGNAL_TYPE_INVALID(TYPE)   (TYPE > (uint32_t)adc12_sample_signal_count)
 Define ADC12 validity check for the signal type. More...
 
#define ADC12_IS_CHANNEL_INVALID(CH)   (CH > ADC12_SOC_MAX_CH_NUM)
 Define ADC12 validity check for the channel number. More...
 
#define ADC12_IS_CHANNEL_SAMPLE_CYCLE_INVALID(CYC)   (CYC == 0)
 Define ADC12 validity check for the channel sample cycle. More...
 
#define ADC12_IS_TRIG_CH_INVLAID(CH)   (CH > ADC_SOC_MAX_TRIG_CH_NUM)
 Define ADC12 validity check for the trigger number. More...
 
#define ADC12_IS_TRIG_LEN_INVLAID(TRIG_LEN)   (TRIG_LEN > ADC_SOC_MAX_TRIG_CH_LEN)
 Define ADC12 validity check for the trigger length. More...
 
#define ADC12_IS_SEQ_LEN_INVLAID(LEN)   ((LEN == 0) || (LEN > ADC_SOC_SEQ_MAX_LEN))
 Define ADC12 validity check for the sequence length. More...
 
#define ADC12_IS_SEQ_DMA_BUFF_LEN_INVLAID(LEN)   ((LEN == 0) || (LEN > ADC_SOC_SEQ_MAX_DMA_BUFF_LEN_IN_4BYTES))
 Define ADC12 validity check for the DMA buffer length in the sequence mode. More...
 
#define ADC12_IS_PMT_DMA_BUFF_LEN_INVLAID(LEN)   ((LEN == 0) || (LEN > ADC_SOC_PMT_MAX_DMA_BUFF_LEN_IN_4BYTES))
 Define ADC12 validity check for the DMA buffer length in the preemption mode. More...
 

Enumerations

enum  adc12_sample_signal_t { adc12_sample_signal_single_ended = 0 , adc12_sample_signal_differential = 1 , adc12_sample_signal_count = 2 }
 Define ADC12 sample signal types. More...
 
enum  adc12_resolution_t { adc12_res_6_bits = 0 , adc12_res_8_bits , adc12_res_10_bits , adc12_res_12_bits }
 Define ADC12 resolutions. More...
 
enum  adc12_conversion_mode_t { adc12_conv_mode_oneshot = 0 , adc12_conv_mode_period , adc12_conv_mode_sequence , adc12_conv_mode_preemption }
 Define ADC12 conversion modes. More...
 
enum  adc12_clock_divider_t {
  adc12_clock_divider_1 = 1 , adc12_clock_divider_2 , adc12_clock_divider_3 , adc12_clock_divider_4 ,
  adc12_clock_divider_5 , adc12_clock_divider_6 , adc12_clock_divider_7 , adc12_clock_divider_8 ,
  adc12_clock_divider_9 , adc12_clock_divider_10 , adc12_clock_divider_11 , adc12_clock_divider_12 ,
  adc12_clock_divider_13 , adc12_clock_divider_14 , adc12_clock_divider_15 , adc12_clock_divider_16
}
 Define ADC12 Clock Divider. More...
 
enum  adc12_irq_event_t {
  adc12_event_trig_complete = ADC12_INT_STS_TRIG_CMPT_MASK , adc12_event_trig_sw_conflict = ADC12_INT_STS_TRIG_SW_CFLCT_MASK , adc12_event_trig_hw_conflict = ADC12_INT_STS_TRIG_HW_CFLCT_MASK , adc12_event_read_conflict = ADC12_INT_STS_READ_CFLCT_MASK ,
  adc12_event_seq_sw_conflict = ADC12_INT_STS_SEQ_SW_CFLCT_MASK , adc12_event_seq_hw_conflict = ADC12_INT_STS_SEQ_HW_CFLCT_MASK , adc12_event_seq_dma_abort = ADC12_INT_STS_SEQ_DMAABT_MASK , adc12_event_seq_full_complete = ADC12_INT_STS_SEQ_CMPT_MASK ,
  adc12_event_seq_single_complete = ADC12_INT_STS_SEQ_CVC_MASK , adc12_event_dma_fifo_full = ADC12_INT_STS_DMA_FIFO_FULL_MASK
}
 Define ADC12 irq events. More...
 

Initialization and Deinitialization

void adc12_get_default_config (adc12_config_t *config)
 Get a default configuration for an ADC12 instance. More...
 
void adc12_get_channel_default_config (adc12_channel_config_t *config)
 Get a default configuration for an ADC12 channel. More...
 
hpm_stat_t adc12_deinit (ADC12_Type *ptr)
 De-initialize an ADC12 instance. More...
 
hpm_stat_t adc12_init (ADC12_Type *ptr, adc12_config_t *config)
 Initialize an ADC12 instance. More...
 
hpm_stat_t adc12_init_channel (ADC12_Type *ptr, adc12_channel_config_t *config)
 Initialize an ADC12 channel. More...
 
hpm_stat_t adc12_get_channel_threshold (ADC12_Type *ptr, uint8_t ch, adc12_channel_threshold_t *config)
 Get thresholds of an ADC12 channel. More...
 
hpm_stat_t adc12_set_prd_config (ADC12_Type *ptr, adc12_prd_config_t *config)
 Configure the the period mode for an ADC12 instance. More...
 
hpm_stat_t adc12_set_seq_config (ADC12_Type *ptr, adc12_seq_config_t *config)
 Configure the the sequence mode for an ADC12 instance. More...
 
hpm_stat_t adc12_set_pmt_config (ADC12_Type *ptr, adc12_pmt_config_t *config)
 Configure the preemption mode for an ADC12 instance. More...
 

DMA Control

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 mode. More...
 
static void adc12_init_pmt_dma (ADC12_Type *ptr, uint32_t addr)
 Configure the start address of DMA write operation for the preemption mode. More...
 
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. More...
 

Status

static uint32_t adc12_get_status_flags (ADC12_Type *ptr)
 Get all ADC12 status flags. More...
 
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 the ADC has completed its conversion. *. More...
 
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 completes the conversion. More...
 
static void adc12_set_nonblocking_read (ADC12_Type *ptr)
 Set nonblocking read in oneshot mode. More...
 
static void adc12_set_blocking_read (ADC12_Type *ptr)
 Set blocking read in oneshot mode. More...
 
static bool adc12_is_nonblocking_mode (ADC12_Type *ptr)
 Judge whether the current setting is none-blocking mode or not. More...
 
static bool adc12_get_conv_valid_status (ADC12_Type *ptr, uint8_t ch)
 Get the status of a conversion validity. More...
 
static void adc12_clear_status_flags (ADC12_Type *ptr, uint32_t mask)
 Clear the status flags. More...
 

Interrupts

static void adc12_enable_interrupts (ADC12_Type *ptr, uint32_t mask)
 Enable interrupts. More...
 
static void adc12_disable_interrupts (ADC12_Type *ptr, uint32_t mask)
 Disable interrupts. More...
 

Trigger and Conversion

hpm_stat_t adc12_trigger_seq_by_sw (ADC12_Type *ptr)
 Trigger ADC conversions by software in sequence mode. More...
 
hpm_stat_t adc12_trigger_pmt_by_sw (ADC12_Type *ptr, uint8_t trig_ch)
 Trigger ADC conversions by software in preemption mode. More...
 
hpm_stat_t adc12_get_oneshot_result (ADC12_Type *ptr, uint8_t ch, uint16_t *result)
 Get the result in oneshot mode. More...
 
hpm_stat_t adc12_get_prd_result (ADC12_Type *ptr, uint8_t ch, uint16_t *result)
 Get the result in the period mode. More...
 

Detailed Description

ADC12 driver APIs.

Macro Definition Documentation

◆ ADC12_IS_CHANNEL_INVALID

#define ADC12_IS_CHANNEL_INVALID (   CH)    (CH > ADC12_SOC_MAX_CH_NUM)

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the channel number.

◆ ADC12_IS_CHANNEL_SAMPLE_CYCLE_INVALID

#define ADC12_IS_CHANNEL_SAMPLE_CYCLE_INVALID (   CYC)    (CYC == 0)

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the channel sample cycle.

◆ ADC12_IS_PMT_DMA_BUFF_LEN_INVLAID

#define ADC12_IS_PMT_DMA_BUFF_LEN_INVLAID (   LEN)    ((LEN == 0) || (LEN > ADC_SOC_PMT_MAX_DMA_BUFF_LEN_IN_4BYTES))

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the DMA buffer length in the preemption mode.

◆ ADC12_IS_SEQ_DMA_BUFF_LEN_INVLAID

#define ADC12_IS_SEQ_DMA_BUFF_LEN_INVLAID (   LEN)    ((LEN == 0) || (LEN > ADC_SOC_SEQ_MAX_DMA_BUFF_LEN_IN_4BYTES))

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the DMA buffer length in the sequence mode.

◆ ADC12_IS_SEQ_LEN_INVLAID

#define ADC12_IS_SEQ_LEN_INVLAID (   LEN)    ((LEN == 0) || (LEN > ADC_SOC_SEQ_MAX_LEN))

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the sequence length.

◆ ADC12_IS_SIGNAL_TYPE_INVALID

#define ADC12_IS_SIGNAL_TYPE_INVALID (   TYPE)    (TYPE > (uint32_t)adc12_sample_signal_count)

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the signal type.

◆ ADC12_IS_TRIG_CH_INVLAID

#define ADC12_IS_TRIG_CH_INVLAID (   CH)    (CH > ADC_SOC_MAX_TRIG_CH_NUM)

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the trigger number.

◆ ADC12_IS_TRIG_LEN_INVLAID

#define ADC12_IS_TRIG_LEN_INVLAID (   TRIG_LEN)    (TRIG_LEN > ADC_SOC_MAX_TRIG_CH_LEN)

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 validity check for the trigger length.

Enumeration Type Documentation

◆ adc12_clock_divider_t

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 Clock Divider.

Enumerator
adc12_clock_divider_1 
adc12_clock_divider_2 
adc12_clock_divider_3 
adc12_clock_divider_4 
adc12_clock_divider_5 
adc12_clock_divider_6 
adc12_clock_divider_7 
adc12_clock_divider_8 
adc12_clock_divider_9 
adc12_clock_divider_10 
adc12_clock_divider_11 
adc12_clock_divider_12 
adc12_clock_divider_13 
adc12_clock_divider_14 
adc12_clock_divider_15 
adc12_clock_divider_16 

◆ adc12_conversion_mode_t

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 conversion modes.

Enumerator
adc12_conv_mode_oneshot 
adc12_conv_mode_period 
adc12_conv_mode_sequence 
adc12_conv_mode_preemption 

◆ adc12_irq_event_t

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 irq events.

Enumerator
adc12_event_trig_complete 

This mask indicates that a trigger conversion is complete.

adc12_event_trig_sw_conflict 

This mask indicates that a conflict caused by software-triggered conversions.

adc12_event_trig_hw_conflict 

This mask indicates that a conflict caused by hardware-triggered conversions.

adc12_event_read_conflict 

This mask indicates that a conflict caused when bus reading from different channels.

adc12_event_seq_sw_conflict 

This mask indicates that a conflict caused by sequence-triggered conversions.

adc12_event_seq_hw_conflict 

This mask indicates that a conflict caused by hardware-triggered conversions.

adc12_event_seq_dma_abort 

This mask indicates that DMA is stopped currently.

adc12_event_seq_full_complete 

This mask indicates that all of the configured conversion(s) in a queue is(are) complete.

adc12_event_seq_single_complete 

This mask indicates that one of the configured conversion(s) in a queue is complete.

adc12_event_dma_fifo_full 

This mask indicates that DMA FIFO is full currently.

◆ adc12_resolution_t

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 resolutions.

Enumerator
adc12_res_6_bits 
adc12_res_8_bits 
adc12_res_10_bits 
adc12_res_12_bits 

◆ adc12_sample_signal_t

#include <drivers/inc/hpm_adc12_drv.h>

Define ADC12 sample signal types.

Enumerator
adc12_sample_signal_single_ended 
adc12_sample_signal_differential 
adc12_sample_signal_count 

Function Documentation

◆ adc12_clear_status_flags()

static void adc12_clear_status_flags ( ADC12_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Clear the status flags.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]maskA mask that means the specified flags to be cleared. Please refer to adc12_irq_event_t.
Note
Only the specified flags can be cleared by writing the INT_STS register.

◆ adc12_deinit()

hpm_stat_t adc12_deinit ( ADC12_Type ptr)

#include <drivers/inc/hpm_adc12_drv.h>

De-initialize an ADC12 instance.

Parameters
[in]ptrAn ADC12 peripheral base address.
Returns
A result of de-initializing an ADC12 instance.
Return values
status_successDe-initialize an ADC12 instance successfully. Please refer to hpm_stat_t.
status_invalid_argumentDe-initialize an ADC12 instance unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_disable_busywait()

static void adc12_disable_busywait ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Set value of the WAIT_DIS bit. The ADC does not block access to the associated peripheral bus until the ADC has completed its conversion. *.

Parameters
[in]ptrAn ADC12 peripheral base address.
Deprecated:
This API will be removed from V2.0.x

◆ adc12_disable_interrupts()

static void adc12_disable_interrupts ( ADC12_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Disable interrupts.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]maskA mask indicating the specified interrupt events. Please refer to adc12_irq_event_t.

◆ adc12_enable_busywait()

static void adc12_enable_busywait ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Set value of the WAIT_DIS bit. ADC blocks access to the associated peripheral bus until the ADC completes the conversion.

Parameters
[in]ptrAn ADC12 peripheral base address.
Deprecated:
This API will be removed from V2.0.x

◆ adc12_enable_interrupts()

static void adc12_enable_interrupts ( ADC12_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Enable interrupts.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]maskA mask indicating the specified ADC interrupt events. Please refer to adc12_irq_event_t.

◆ adc12_get_channel_default_config()

void adc12_get_channel_default_config ( adc12_channel_config_t config)

#include <drivers/inc/hpm_adc12_drv.h>

Get a default configuration for an ADC12 channel.

Parameters
[out]configA pointer to the configuration struct of adc12_channel_config_t.

◆ adc12_get_channel_threshold()

hpm_stat_t adc12_get_channel_threshold ( ADC12_Type ptr,
uint8_t  ch,
adc12_channel_threshold_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Get thresholds of an ADC12 channel.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]chAn ADC12 channel number
[out]configA pointer to the structure of channel threshold
Returns
A result of getting thresholds of an ADC12 channel .
Return values
status_successInitialize an ADC12 channel successfully. Please refer to hpm_stat_t.
status_invalid_argumentInitialize an ADC12 channel unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_get_conv_valid_status()

static bool adc12_get_conv_valid_status ( ADC12_Type ptr,
uint8_t  ch 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Get the status of a conversion validity.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]chAn ADC12 peripheral channel.
Returns
Status indicating the validity of the current conversion result.
Note
This function is only used when the WAIT_DIS bit in the BUF_RESULT register is 1.

◆ adc12_get_default_config()

void adc12_get_default_config ( adc12_config_t config)

#include <drivers/inc/hpm_adc12_drv.h>

Get a default configuration for an ADC12 instance.

Parameters
[out]configA pointer to the configuration struct of adc12_config_t.

◆ adc12_get_oneshot_result()

hpm_stat_t adc12_get_oneshot_result ( ADC12_Type ptr,
uint8_t  ch,
uint16_t *  result 
)

#include <drivers/inc/hpm_adc12_drv.h>

Get the result in oneshot mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]chAn ADC12 peripheral channel.
[out]resultA pointer to an ADC12 conversion result.
Returns
An implementation result of getting an ADC12 conversion result in oneshot mode.
Return values
status_successGet the result of an ADC12 conversion in oneshot mode successfully. Please refer to hpm_stat_t.
status_invalid_argumentGet the result of an ADC12 conversion in oneshot mode unsuccessfully due to passing invalid arguments. Please refer to hpm_stat_t.

◆ adc12_get_prd_result()

hpm_stat_t adc12_get_prd_result ( ADC12_Type ptr,
uint8_t  ch,
uint16_t *  result 
)

#include <drivers/inc/hpm_adc12_drv.h>

Get the result in the period mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]chAn ADC12 peripheral channel.
[out]resultA pointer to a specified ADC12 conversion result
Returns
An implementation of getting an ADC12 conversion result in the period mode.
Return values
status_successGet the result of an ADC12 conversion in the period mode successfully. Please refer to hpm_stat_t.
status_invalid_argumentGet the result of an ADC12 conversion in the period mode unsuccessfully due to passing invalid arguments. Please refer to hpm_stat_t.

◆ adc12_get_status_flags()

static uint32_t adc12_get_status_flags ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Get all ADC12 status flags.

Parameters
[in]ptrAn ADC12 peripheral base address.
Returns
A mask indicating all corresponding interrupt statuses.
Return values
Amask. Please refer to adc12_irq_event_t.

◆ adc12_init()

hpm_stat_t adc12_init ( ADC12_Type ptr,
adc12_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Initialize an ADC12 instance.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to the configuration struct of adc12_config_t.
Returns
A result of initializing an ADC12 instance.
Return values
status_successInitialize an ADC12 instance successfully. Please refer to hpm_stat_t.
status_invalid_argumentInitialize an ADC12 instance unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

disable adc When the adc is processing data, it will generate an error to initialize the adc again, so you need to shut down the adc before initializing it.

◆ adc12_init_channel()

hpm_stat_t adc12_init_channel ( ADC12_Type ptr,
adc12_channel_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Initialize an ADC12 channel.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to the configuration struct of adc12_channel_config_t.
Returns
A result of initializing an ADC12 channel.
Return values
status_successInitialize an ADC12 channel successfully. Please refer to hpm_stat_t.
status_invalid_argumentInitialize an ADC12 channel unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_init_pmt_dma()

static void adc12_init_pmt_dma ( ADC12_Type ptr,
uint32_t  addr 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Configure the start address of DMA write operation for the preemption mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]addrA start address of DMA write operation.

◆ adc12_init_seq_dma()

hpm_stat_t adc12_init_seq_dma ( ADC12_Type ptr,
adc12_dma_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Configure the start address of DMA write operation for the sequence mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to configuration struct of adc12_dma_config_t.
Returns
An implementation result of DMA initializing for the sequence mode
Return values
status_successADC12 initialize in sequence mode successfully. Please refert to hpm_stat_t.
status_invalid_argumentADC12 initialize in sequence mode unsuccessfully due to passing invalid arguments. Please refert to hpm_stat_t.

◆ adc12_is_nonblocking_mode()

static bool adc12_is_nonblocking_mode ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Judge whether the current setting is none-blocking mode or not.

Parameters
[in]ptrAn ADC12 peripheral base address.
Returns
A result indicating the status of bus waiting.
Return values
Truemeans that nonblocking reading.
Falsemeans that blocking reading.

◆ adc12_set_blocking_read()

static void adc12_set_blocking_read ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Set blocking read in oneshot mode.

Note
An ADC blocks access to the associated peripheral bus until it completes a conversion.
Parameters
[in]ptrAn ADC12 peripheral base address.

◆ adc12_set_nonblocking_read()

static void adc12_set_nonblocking_read ( ADC12_Type ptr)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Set nonblocking read in oneshot mode.

Note
An ADC does not block access to the associated peripheral whether it completes a conversion or not.
Parameters
[in]ptrAn ADC12 peripheral base address.

◆ adc12_set_pmt_config()

hpm_stat_t adc12_set_pmt_config ( ADC12_Type ptr,
adc12_pmt_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Configure the preemption mode for an ADC12 instance.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to configuration struct of adc12_pmt_config_t.
Returns
A result of configuring the preemption mode for an ADC12 instance.
Return values
status_successConfigure the preemption mode successfully. Please refer to hpm_stat_t.
status_invalid_argumentConfigure the preemption mode unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_set_prd_config()

hpm_stat_t adc12_set_prd_config ( ADC12_Type ptr,
adc12_prd_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Configure the the period mode for an ADC12 instance.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to the configuration struct of adc12_prd_config_t.
Returns
A result of configuring the the period mode for an ADC12 instance.
Return values
status_successConfigure the the period mode successfully. Please refer to hpm_stat_t.
status_invalid_argumentConfigure the the period mode unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_set_seq_config()

hpm_stat_t adc12_set_seq_config ( ADC12_Type ptr,
adc12_seq_config_t config 
)

#include <drivers/inc/hpm_adc12_drv.h>

Configure the the sequence mode for an ADC12 instance.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]configA pointer to configuration struct of adc12_seq_config_t.
Returns
A result of configuring the the sequence mode for an ADC12 instance.
Return values
status_successConfigure the the sequence mode successfully. Please refer to hpm_stat_t.
status_invalid_argumentConfigure the the sequence mode unsuccessfully due to passing one or more invalid arguments. Please refer to hpm_stat_t.

◆ adc12_set_seq_stop_pos()

static void adc12_set_seq_stop_pos ( ADC12_Type ptr,
uint16_t  stop_pos 
)
inlinestatic

#include <drivers/inc/hpm_adc12_drv.h>

Configure the stop position offset in the specified memory of DMA write operation for the sequence mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]stop_posA stop position offset.

◆ adc12_trigger_pmt_by_sw()

hpm_stat_t adc12_trigger_pmt_by_sw ( ADC12_Type ptr,
uint8_t  trig_ch 
)

#include <drivers/inc/hpm_adc12_drv.h>

Trigger ADC conversions by software in preemption mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
[in]trig_chA trigger channel number(e.g. TRIG0A,TRIG0B,TRIG0C...).
Returns
An implementation result of getting an ADC12 software trigger.
Return values
status_successADC12 software triggers successfully. Please refer to hpm_stat_t.
status_failADC12 software triggers unsuccessfully. Please refer to hpm_stat_t.

◆ adc12_trigger_seq_by_sw()

hpm_stat_t adc12_trigger_seq_by_sw ( ADC12_Type ptr)

#include <drivers/inc/hpm_adc12_drv.h>

Trigger ADC conversions by software in sequence mode.

Parameters
[in]ptrAn ADC12 peripheral base address.
Returns
An implementation result of getting an ADC12 software trigger.
Return values
status_successADC12 software triggers successfully. Please refer to hpm_stat_t.
status_failADC12 software triggers unsuccessfully. Please refer to hpm_stat_t.