HPM APP
HPMicro Application solution
POWER_ADC_API

HPM Power ADC interface; HPM电源ADC接口 More...

Functions

uint8_t mp_adc_get_mapindex (uint8_t adc_index)
 Get ADC MAP index ;获取ADC MAP数组序号 More...
 
void mp_adc_get_default (uint8_t adc_index, hpm_adc_t *adc_t)
 Get the default value of the ADC data structure ;获取ADC数据结构默认值 More...
 
int mp_adc_init (uint8_t type, void *handle)
 MP ADC init ;MP ADC初始化 More...
 
int mp_adc_trigger_config (uint8_t type, void *handle)
 MP ADC trigger the preemption sampling configuration ;MP ADC触发抢占采样配置 More...
 
int mp_adc_interrupt_enable (uint8_t type, void *handle, bool enable)
 MP ADC enable interrupt ;MP ADC中断使能 More...
 
int mp_hdma_init_config (uint8_t type, void *handle, hpm_mp_hdma_over_callback cb)
 MP HDMA init(HDMA is used to transmit ADC sampling values. It can be used to continuously sample multiple adc values, and HDMA automatically carries the sampling results to the specified memory area) Note: After configuration, mp_hdma_transfer_start needs to be triggered to initiate the transfer ;MP HDMA初始配置(HDMA搬用ADC采样值; 常用于连续采样多个adc值,HDMA自动搬用到指定内存区域) 注意:配置完后需要 mp_hdma_transfer_start 触发开始传输 More...
 
int mp_hdma_transfer_start (uint32_t size)
 MP HDMA trigger and start transmission ;MP HDMA触发开始传输 More...
 
int mp_dma_chained_transfer_config (uint32_t size)
 MP HDMA chain transmission config, double buffered mode(In HDMA chain mode, multiple tasks are configured. In dual-buffer mode, the PING/PONG dual-buffer switching task is automatically performed without CPU intervention) ;MP HDMA链式传输配置,双缓冲模式(HDMA链式配置多任务,双缓冲模式下,自动PING/PONG双缓冲切换搬用,无需CPU干预) More...
 

Detailed Description

HPM Power ADC interface; HPM电源ADC接口

Function Documentation

◆ mp_adc_get_default()

void mp_adc_get_default ( uint8_t  adc_index,
hpm_adc_t adc_t 
)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

Get the default value of the ADC data structure ;获取ADC数据结构默认值

Parameters
[in]adc_indexADC index number(an abstract MAP sequence number) ;ADC序号(MAP抽象序号)
[out]adc_tAddress of the ADC data structure object ;ADC数据结构对象地址

◆ mp_adc_get_mapindex()

uint8_t mp_adc_get_mapindex ( uint8_t  adc_index)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

Get ADC MAP index ;获取ADC MAP数组序号

Parameters
[in]adc_indexADC index number(an abstract MAP sequence number) ;ADC序号(MAP抽象序号)
Return values
ADCMAP index number ;ADC MAP数组序号

◆ mp_adc_init()

int mp_adc_init ( uint8_t  type,
void *  handle 
)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP ADC init ;MP ADC初始化

Parameters
[in]typePWM type mp_pwm_type ;PWM类型 mp_pwm_type
[in]handleAddress of the PWM or a pair of PWM data structure object hpm_pwm_thpm_pwm_pair_t ;PWM 或 PWM对数据结构对象地址 hpm_pwm_thpm_pwm_pair_t
Return values
==0initialization succeeded; !=0 initialization failed ;==0 初始化成功; !=0 初始化失败

◆ mp_adc_interrupt_enable()

int mp_adc_interrupt_enable ( uint8_t  type,
void *  handle,
bool  enable 
)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP ADC enable interrupt ;MP ADC中断使能

Parameters
[in]typePWM type mp_pwm_type ;PWM类型 mp_pwm_type
[in]handleAddress of the PWM or a pair of PWM data structure object hpm_pwm_t or hpm_pwm_pair_t ;PWM 或 PWM对数据结构对象地址 hpm_pwm_thpm_pwm_pair_t
[in]enabletrue:enable; false:disable; ; true:使能; false:禁止;
Return values
==0configuration succeeded; !=0 configuration failed ;==0 配置成功; !=0 配置失败

◆ mp_adc_trigger_config()

int mp_adc_trigger_config ( uint8_t  type,
void *  handle 
)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP ADC trigger the preemption sampling configuration ;MP ADC触发抢占采样配置

Parameters
[in]typePWM type mp_pwm_type ;PWM类型 mp_pwm_type
[in]handleAddress of the PWM or a pair of PWM data structure object hpm_pwm_t or hpm_pwm_pair_t ;PWM 或 PWM对数据结构对象地址 hpm_pwm_thpm_pwm_pair_t
Return values
==0configuration succeeded; !=0 configuration failed ;==0 配置成功; !=0 配置失败

◆ mp_dma_chained_transfer_config()

int mp_dma_chained_transfer_config ( uint32_t  size)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP HDMA chain transmission config, double buffered mode(In HDMA chain mode, multiple tasks are configured. In dual-buffer mode, the PING/PONG dual-buffer switching task is automatically performed without CPU intervention) ;MP HDMA链式传输配置,双缓冲模式(HDMA链式配置多任务,双缓冲模式下,自动PING/PONG双缓冲切换搬用,无需CPU干预)

Parameters
[in]sizeNumber of bytes transmitted by HDMA ;HDMA传输的字节数
Return values
==0chain transmission succeeded; !=0 chain transmission failed ;==0 链式传输配置成功; !=0 链式传输配置失败;

◆ mp_hdma_init_config()

int mp_hdma_init_config ( uint8_t  type,
void *  handle,
hpm_mp_hdma_over_callback  cb 
)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP HDMA init(HDMA is used to transmit ADC sampling values. It can be used to continuously sample multiple adc values, and HDMA automatically carries the sampling results to the specified memory area) Note: After configuration, mp_hdma_transfer_start needs to be triggered to initiate the transfer ;MP HDMA初始配置(HDMA搬用ADC采样值; 常用于连续采样多个adc值,HDMA自动搬用到指定内存区域) 注意:配置完后需要 mp_hdma_transfer_start 触发开始传输

Parameters
[in]typePWM type mp_pwm_type ;PWM类型 mp_pwm_type
[in]handleAddress of the PWM or a pair of PWM data structure object hpm_pwm_t or hpm_pwm_pair_t ;PWM 或 PWM对数据结构对象地址 hpm_pwm_thpm_pwm_pair_t
[in]cbHDMA transmission done callback ;HDMA传输结束回调
Return values
==0configuration succeeded; !=0 configuration failed ;==0 配置成功; !=0 配置失败

◆ mp_hdma_transfer_start()

int mp_hdma_transfer_start ( uint32_t  size)

#include <apps/mp_adapte/software/adapte/src/mp_adc.h>

MP HDMA trigger and start transmission ;MP HDMA触发开始传输

Parameters
[in]sizeNumber of bytes transmitted by HDMA ;HDMA传输的字节数
Return values
==0transmission succeeded; !=0 transmission failed ;==0 触发传输成功; !=0 触发传输失败;