LWIP_ADC 接口 More...
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... | |
| #define | TCP_ECHO_PORT (5001U) |
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... | |
| void | tcp_echo_init (void) |
| TCP initialization, binding IP address and port number. ;TCP初始化,绑定IP地址和端口号。 More... | |
| void | tcp_poll_handle (void) |
| Sending data using polling.Firstly, determine the values of adc_done[0] and adc_done[0]. If both are 1, it indicates that the data was not sent in a timely manner. If adc_done[0] is 1, set adc_done[0] to 0 and send the first half of the buff data; If adc_done[1] is 1, set adc_done[1] to 0 and send the second half of the buff data; ;LWIP将ADC的采样结果通过polling的方式发送出去,首先判断 adc_done[0]和adc_done[1]的值,如果同为1,表示数据未能及时发送。 若adc_done[0]为1,将adc_done[0]置0并发送adc_buff的前半部分数据; 若adc_done[1]为1,将adc_done[1]置0并发送adc_buff的前后半部分数据 More... | |
LWIP_ADC 接口
| #define APP_ADC16_DMA_BUFF_LEN_IN_BYTES (1024U) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
APP_ADC16_DMA_BUFF_LEN_IN_BYTES:DMA BUFF size for storing ADC16 sampling data. ;存放ADC16采样数据的DMA BUFF大小
| #define APP_ADC16_TCP_SEND_SIZE (APP_ADC16_DMA_BUFF_LEN_IN_BYTES*sizeof(uint16_t)) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
APP_ADC16_TCP_SEND_SIZE:The number of 16 bit sampling data sent by TCP each time. ;TCP每次发送的16位采样数据的个数。
| #define APP_ADC_TRIG_FREQ (2000000U) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
APP_ADC_TRIG_FREQ:ADC sampling frequency. ;ADC采样频率
| #define TCP_ECHO_PORT (5001U) |
| void adc_clear_done | ( | uint8_t | index | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
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数据将通过以太网发送出去。
| [in] | index | index of adc_done flag. ;adc_done标志位索引
|
| uint8_t* adc_get_buf_addr_point | ( | uint8_t | index | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
get the starting address for sending data. ;获取发送数据的起始地址
| [in] | index | adc_done flag index. ;adc_done标志位索引。
|
| uint8_t adc_get_done | ( | uint8_t | index | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
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数据将通过以太网发送出去。
| [in] | index | adc_done flag index. ;adc_done标志位索引。
|
| void adc_pmt_auto_config | ( | uint32_t | sample_freq | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
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抢占转换模式初始化。
| void hdma_auto_config | ( | void | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
HDMA configuration: Configure HDMA chain transmission, including the data width, amount of data transmitted each time, and DMA transmission mode. ;HDMA配置:配置HDMA链式传输,配置HDMA传输的数据宽度、每次传输的数据量、DMA传输的模式等
| void hdma_dma_chain_config | ( | void | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
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连接起来,按照顺序循环执行。
| int hdma_transfer_start | ( | void | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
HDMA start transfer.enable HDMA and start transmitting data. ;HDMA开始传输:使能HDMA并开始传输数据。
| hpm_stat_t init_common_config | ( | adc16_conversion_mode_t | conv_mode | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
Initialize ADC common configuration. ;初始化ADC通用配置。
| [in] | conv_mode | ADC conversion mode ;ADC转换模式选择,支持如下模式。 selection, supports the following modes:
|
| void init_preemption_config | ( | void | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
Initialize preemption conversion mode.Including trigger source initialization, trigger target initialization, TRGM initialization, and DMA initialization ;ADC抢占转换模式初始化,包括触发源初始化、触发目标初始化、互联管理器初始化和DMA初始化。
| void init_trigger_mux | ( | TRGM_Type * | ptr | ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
Initialize TRGM. ;初始化互联管理器。
| [in] | ptr | TRGM used by ADC ;ADC使用的TRGM。 |
| void init_trigger_source | ( | PWM_Type * | ptr, |
| uint32_t | sample_freq | ||
| ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
Initialize trigger source. ;初始化触发源PWM.
| [in] | ptr | PWM used by ADC ;ADC使用的PWM。 |
| [in] | sample_freq | ADC sampling frequency ;ADC采样率。 |
| void init_trigger_target | ( | ADC16_Type * | ptr, |
| uint8_t | trig_ch, | ||
| bool | inten | ||
| ) |
#include <apps/lwip_adc/software/common/adc/adc_16_pmt.h>
Initialize trigger target. ;初始化触发目标。
| [in] | ptr | ADC used ;使用的ADC。 |
| [in] | trig_ch | Trigger ADC channel selection ;触发的ADC通道选择。 |
| [in] | inten | Interrupt enable settings ;中断使能设置。 |
| void tcp_echo_init | ( | void | ) |
#include <apps/lwip_adc/software/lwip_tcpecho/inc/app/tcp_echo.h>
TCP initialization, binding IP address and port number. ;TCP初始化,绑定IP地址和端口号。
| void tcp_poll_handle | ( | void | ) |
#include <apps/lwip_adc/software/lwip_tcpecho/inc/app/tcp_echo.h>
Sending data using polling.Firstly, determine the values of adc_done[0] and adc_done[0]. If both are 1, it indicates that the data was not sent in a timely manner. If adc_done[0] is 1, set adc_done[0] to 0 and send the first half of the buff data; If adc_done[1] is 1, set adc_done[1] to 0 and send the second half of the buff data; ;LWIP将ADC的采样结果通过polling的方式发送出去,首先判断 adc_done[0]和adc_done[1]的值,如果同为1,表示数据未能及时发送。 若adc_done[0]为1,将adc_done[0]置0并发送adc_buff的前半部分数据; 若adc_done[1]为1,将adc_done[1]置0并发送adc_buff的前后半部分数据