HPM APP
HPMicro Application solution
adc_16_pmt.h File Reference
#include "hpm_adc16_drv.h"
#include "hpm_pwm_drv.h"

Go to the source code of this file.

Macros

#define APP_ADC_TRIG_FREQ   (2000000U)
 APP_ADC_TRIG_FREQ:ADC sampling frequency. ;ADC采样频率 More...
 
#define APP_ADC16_DMA_BUFF_LEN_IN_BYTES   (1024U)
 APP_ADC16_DMA_BUFF_LEN_IN_BYTES:DMA BUFF size for storing ADC16 sampling data. ;存放ADC16采样数据的DMA BUFF大小 More...
 
#define APP_ADC16_TCP_SEND_SIZE   (APP_ADC16_DMA_BUFF_LEN_IN_BYTES*sizeof(uint16_t))
 APP_ADC16_TCP_SEND_SIZE:The number of 16 bit sampling data sent by TCP each time. ;TCP每次发送的16位采样数据的个数。 More...
 

Functions

void hdma_auto_config (void)
 HDMA configuration: Configure HDMA chain transmission, including the data width, amount of data transmitted each time, and DMA transmission mode. ;HDMA配置:配置HDMA链式传输,配置HDMA传输的数据宽度、每次传输的数据量、DMA传输的模式等 More...
 
void hdma_dma_chain_config (void)
 HDMA chain transmission configuration.task 1:ADC sampling data is stored in the first half of the adc_buff;task 2:adc_done[0] set 1; task 3:ADC sampling data is stored in the second half of the adc_buff; tasj 4:adc_done[1] set 1; Each task is connected through a linked list adc_descriptors1 and executed in a sequential loop. ;HDMA链式传输配置。任务1:ADC采样数据存放至adc_buff前半部分;任务2:adc_done[0]置1; 任务3:ADC采样数据存放至adc_buff前后半部分;任务4:adc_done[1]置1; 各任务通过链表adc_descriptors1连接起来,按照顺序循环执行。 More...
 
int hdma_transfer_start (void)
 HDMA start transfer.enable HDMA and start transmitting data. ;HDMA开始传输:使能HDMA并开始传输数据。 More...
 
void init_trigger_source (PWM_Type *ptr, uint32_t sample_freq)
 Initialize trigger source. ;初始化触发源PWM. More...
 
void init_trigger_mux (TRGM_Type *ptr)
 Initialize TRGM. ;初始化互联管理器。 More...
 
void init_trigger_target (ADC16_Type *ptr, uint8_t trig_ch, bool inten)
 Initialize trigger target. ;初始化触发目标。 More...
 
hpm_stat_t init_common_config (adc16_conversion_mode_t conv_mode)
 Initialize ADC common configuration. ;初始化ADC通用配置。 More...
 
void init_preemption_config (void)
 Initialize preemption conversion mode.Including trigger source initialization, trigger target initialization, TRGM initialization, and DMA initialization ;ADC抢占转换模式初始化,包括触发源初始化、触发目标初始化、互联管理器初始化和DMA初始化。 More...
 
void adc_pmt_auto_config (uint32_t sample_freq)
 ADC preemption conversion mode configuration, including ADC pin initialization, ADC clock initialization, ADC common configuration, and ADC preemption conversion mode initialization ;ADC抢占转换模式配置,包括ADC引脚初始化、ADC时钟初始化、ADC通用配置和ADC抢占转换模式初始化。 More...
 
void adc_clear_done (uint8_t index)
 adc_done flag clear: when adc_done flag is cleared, corresponding to the adc_buff data will be sent out via Ethernet ;adc_done标志位清除:当adc_done标志位被清除,对应的adc_buff数据将通过以太网发送出去。 More...
 
uint8_t adc_get_done (uint8_t index)
 adc_done flag clear: when adc_done flag is 1, corresponding to the adc_buff data will be sent out via Ethernet. ;获取adc_done标志位:当adc_done标志位为1,对应的adc_buff数据将通过以太网发送出去。 More...
 
uint8_t * adc_get_buf_addr_point (uint8_t index)
 get the starting address for sending data. ;获取发送数据的起始地址 More...