HPM APP
HPMicro Application solution
POWER_API

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

Data Structures

struct  mp_adc_map_t
 ADC MAP data structure ;ADC MAP数据结构 More...
 
struct  mp_pwm_trigger_map_t
 PWM TRGM MAP data structure ;PWM 互联触发MAP数据结构 More...
 
struct  mp_pwm_fault_map_t
 PWM fault protection for MAP data structure ;PWM 故障保护MAP数据结构 More...
 
struct  mp_pwm_pair_map_t
 Address of a pair of PWM MAP data structure ;PWM 对MAP数据结构 More...
 
struct  mp_pwm_map_t
 Address of the PWM MAP data structure ;PWM MAP数据结构 More...
 
struct  hpm_adc_t
 ADC data structure ;ADC 数据结构 More...
 
struct  hpm_hdma_adc_t
 HDMA ADC data structure, using HDMA to transfer ADC sampling values. This method is typically employed for sampling a set of data at a fixed frequency, such as collecting a group of points, for instance, 512/1024/4096. ;HDMA ADC 数据结构, 使用HDMA搬用ADC采样值,一般应用于固定频率采样一组(例如:512/1024/4096个点)数据 More...
 
struct  hpm_pwm_fault_t
 PWM fault protection data structure ;PWM 故障保护数据结构 More...
 
struct  hpm_pwm_pair_t
 A pair of PWM data structure ;PWM 对数据结构 More...
 
struct  hpm_pwm_t
 PWM data structure
;PWM 数据结构 More...
 
struct  hpm_mp_t
 Power MP data structure
;电源MP数据结构 More...
 

Macros

#define MP_VERSION   "V0.1.0"
 
#define MP_PWM_PAIR_COUNT   (MP_PWM_PAIR_NUM_MAX)
 Summation of a pair of PWM sequence numbers ;PWM对序号总和 More...
 
#define MP_PWM_TRIGGER_COUNT_MAX   (8)
 PWM trigger count max ;PWM互联触发最大总和 More...
 
#define MP_PWM_TRIGGER_ADC_BIT   (0)
 PWM trigger for ADC bit ;PWM互联触发ADC采样BIT位 More...
 

Typedefs

typedef void(* hpm_mp_adc_over_callback) (void *handle)
 ADC callback after sampling ends ;ADC 采样结束回调 More...
 
typedef void(* hpm_mp_hdma_over_callback) (hpm_hdma_adc_t *hdma_adc_t)
 HDMA ADC data transmission and callback completed ;HDMA ADC数据搬用完成回调 More...
 
typedef void(* mp_timer_cb) (void)
 High precision timer callback ;高精定时回调 More...
 

Enumerations

enum  mp_pwm_type { MP_PWM_SINGLE_TYPE = 0 , MP_PWM_PAIR_TYPE , MP_PWM_TYPE_MAX }
 PWM type(one channel or one pair) ;PWM类型(单路或一对) More...
 
enum  mp_pwm_pair_index {
  MP_PWM_PAIR_NUM_0 = 0 , MP_PWM_PAIR_NUM_1 , MP_PWM_PAIR_NUM_2 , MP_PWM_PAIR_NUM_3 ,
  MP_PWM_PAIR_NUM_4 , MP_PWM_PAIR_NUM_5 , MP_PWM_PAIR_NUM_6 , MP_PWM_PAIR_NUM_7 ,
  MP_PWM_PAIR_NUM_8 , MP_PWM_PAIR_NUM_9 , MP_PWM_PAIR_NUM_10 , MP_PWM_PAIR_NUM_11 ,
  MP_PWM_PAIR_NUM_12 , MP_PWM_PAIR_NUM_13 , MP_PWM_PAIR_NUM_14 , MP_PWM_PAIR_NUM_15 ,
  MP_PWM_PAIR_NUM_MAX
}
 a pair of PWM index number(an abstract MAP sequence number) ; PWM对序号(MAP抽象序号) More...
 
enum  mp_pwm_index {
  MP_PWM_NUM_0 = 0 , MP_PWM_NUM_1 , MP_PWM_NUM_2 , MP_PWM_NUM_3 ,
  MP_PWM_NUM_4 , MP_PWM_NUM_5 , MP_PWM_NUM_6 , MP_PWM_NUM_7 ,
  MP_PWM_NUM_MAX
}
 The PWM index number(an abstract MAP sequence number) ;PWM序号(MAP抽象序号) More...
 
enum  mp_adc_index {
  MP_ADC_NUM_0 = 0 , MP_ADC_NUM_1 , MP_ADC_NUM_2 , MP_ADC_NUM_3 ,
  MP_ADC_NUM_4 , MP_ADC_NUM_5 , MP_ADC_NUM_6 , MP_ADC_NUM_7 ,
  MP_ADC_NUM_8 , MP_ADC_NUM_9 , MP_ADC_NUM_10 , MP_ADC_NUM_11 ,
  MP_ADC_NUM_12 , MP_ADC_NUM_13 , MP_ADC_NUM_14 , MP_ADC_NUM_15 ,
  MP_ADC_NUM_16 , MP_ADC_NUM_17 , MP_ADC_NUM_18 , MP_ADC_NUM_19 ,
  MP_ADC_NUM_20 , MP_ADC_NUM_21 , MP_ADC_NUM_22 , MP_ADC_NUM_23 ,
  MP_ADC_NUM_MAX
}
 ADC index number(an abstract MAP sequence number) ;ADC序号(MAP抽象序号) More...
 
enum  mp_pwm_pair_mode { MP_PWM_PAIR_MODE_REVERSE = 0 , MP_PWM_PAIR_MODE_CENTRAL , MP_PWM_PAIR_MODE_EDGE , MP_PWM_PAIR_MODE_MAX }
 The type of a pair of PWM(complementary mode, phase center aligned mode, edge aligned mode) ;PWM对模式类型(互补模式; 相位中心对齐模式; 边沿对齐模式) More...
 
enum  mp_pwm_pair_phase_angle {
  MP_PWM_PAIR_PHASE_ANGLE_0 = 0 , MP_PWM_PAIR_PHASE_ANGLE_180 = 2 , MP_PWM_PAIR_PHASE_ANGLE_120 = 3 , MP_PWM_PAIR_PHASE_ANGLE_90 = 4 ,
  MP_PWM_PAIR_PHASE_ANGLE_72 = 5 , MP_PWM_PAIR_PHASE_ANGLE_60 = 6 , MP_PWM_PAIR_PHASE_ANGLE_45 = 8 , MP_PWM_PAIR_PHASE_ANGLE_40 = 9 ,
  MP_PWM_PAIR_PHASE_ANGLE_36 = 10 , MP_PWM_PAIR_PHASE_ANGLE_30 = 12
}
 The phase Angle of a pair of PWM in phase center aligned mode ;PWM对相位中心对齐模式相位角度 More...
 
enum  mp_pwm_trigger_mode { MP_PWM_TRIGGER_MODE_OUTPUT = 0 , MP_PWM_TRIGGER_MODE_DMA }
 PWM TRGM mode(Output mode; DMA request mode) Output mode:TRGM output IO signal DMA request mode:TRGM output DMA request and then trigger DMA ;PWM互联触发模式(输出模式;DMA请求模式) 输出模式: 互联输出IO信号 DMA请求模式: 互联输出DMA请求,触发DMA. More...
 

Functions

int hpm_mp_api_get_default (hpm_mp_t *mp_t)
 Get the default value of the power data structure ;电源数据结构默认值获取 More...
 
int hpm_mp_pwm_pair_get_default (uint8_t pwm_pair_index, uint32_t freq, hpm_pwm_pair_t *pwm_pair_t)
 Get the default value of a pair of PWM (two PWM channels as a pair) data structure
;获取PWM对(两路PWM成一对)数据结构默认值 More...
 
int hpm_mp_pwm_get_default (uint8_t pwm_index, uint32_t freq, hpm_pwm_t *pwm_t)
 Get the default value of the single PWM data structure ;获取PWM(单路)数据结构默认值 More...
 
int hpm_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 hpm_mp_api_init (hpm_mp_t *mp_t)
 Power API initialization ;电源API初始化 More...
 
uint32_t hpm_mp_api_pwmpair_get_reload_of_freq (hpm_pwm_pair_t *pwm_pair_t, uint32_t freq)
 A pair of PWM gets the overloaded value 'reload_count' based on frequency ;PWM对根据频率获取重载值reload_count. More...
 
int hpm_mp_api_pwmpair_set_reload_and_duty (hpm_pwm_pair_t *pwm_pair_t, uint32_t reload_count, uint32_t duty_count)
 A pair of PWM, configured frequency and duty cycle Note: Get reload_count by frequency first,by using hpm_mp_api_pwmpair_get_reload_of_freq ;PWM对同时设置频率和占空比; 注意: 先通过频率获取reload_count,调用 hpm_mp_api_pwmpair_get_reload_of_freq 接口获取 More...
 
int hpm_mp_api_pwmpair_freq (hpm_pwm_pair_t *pwm_pair_t, uint32_t freq)
 A pair of PWM frequency Settings; Note: After setting the frequency, the duty cycle automatically converts to the original percentage. For example, with a 20% duty cycle, after setting the frequency, the duty cycle remains at 20% ;PWM对频率设置; 注意: 设置频率后,占空比自动转换为原始百分比。如:20占空比,设置频率后,占空比仍然为20%. More...
 
int hpm_mp_api_pwmpair_freq_of_half_duty (hpm_pwm_pair_t *pwm_pair_t, uint32_t freq)
 Setting the frequency for a pair of PWM and configuring a 50% duty cycle Note: After setting the frequency, the duty cycle is simultaneously set to 50% ;PWM对频率设置且固定半占空比 注意: 设置频率后,占空比同时设置为50%. More...
 
int hpm_mp_api_pwmpair_duty (hpm_pwm_pair_t *pwm_pair_t, uint32_t duty)
 A pair of PWM duty cycle Settings Note: The duty cycle ranges from 0 to reload_count(reload_count is a member of pwm_pair_t) ;PWM对占空比设置 注意: 占空比范围为0~reload_count(reload_count为pwm_pair_t成员) More...
 
int hpm_mp_api_pwmpair_force_config (hpm_pwm_pair_t *pwm_pair_t, uint8_t index, uint8_t level)
 Setting forced output for a pair of PWM (setting a pair of PWM signals to high or low level) Note: This interface is for configuration only and does not enable the active state. Enable or disable the following interfaces separately Enable (force output to be high or low level) hpm_mp_api_pwmpair_force_enable_output Disable (Restore PWM waveform) hpm_mp_api_pwmpair_force_disable_output ;PWM对强制输出设置(将PWM对强制设置为高电平或低电平) 注意: 此接口只是配置,并不会使能生效状态,使能或禁止需单独调用以下接口 使能生效(强制输出为高或低) hpm_mp_api_pwmpair_force_enable_output 禁止生效(恢复PWM波形) hpm_mp_api_pwmpair_force_disable_output. More...
 
void hpm_mp_api_pwmpair_force_enable_output (hpm_pwm_pair_t *pwm_pair_t, uint8_t index)
 Enable a pair of PWM signals forced outputs (force output to be high or low level) ;PWM对强制输出使能生效(强制输出为高或低) More...
 
void hpm_mp_api_pwmpair_force_disable_output (hpm_pwm_pair_t *pwm_pair_t, uint8_t index)
 Disable a pair of PWM signals forced outputs(Restore PWM waveform) ;PWM对强制输出禁止生效(恢复PWM波形) More...
 
void hpm_mp_api_pwmpair_fault_software_clear (hpm_pwm_pair_t *pwm_pair_t)
 A pair of PWM fault states are cleared by software Note: When the fault recovery is set to software recovery, use this interface to clear the fault status after confirming fault clearance. ;PWM对故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态 More...
 
int hpm_mp_api_pwm_freq (hpm_pwm_t *pwm_t, uint32_t freq)
 PWM frequency Settings; Note: After setting the frequency, the duty cycle automatically converts to the original percentage. For example, with a 20% duty cycle, after setting the frequency, the duty cycle remains at 20% ;PWM频率设置; 注意: 设置频率后,占空比自动转换为原始百分比。如:20占空比,设置频率后,占空比仍然为20%. More...
 
int hpm_mp_api_pwm_freq_of_half_duty (hpm_pwm_t *pwm_t, uint32_t freq)
 Setting the frequency for the PWM and configuring a 50% duty cycle Note: After setting the frequency, the duty cycle is simultaneously set to 50% ;PWM频率设置且固定半占空比 注意: 设置频率后,占空比同时设置为50%. More...
 
int hpm_mp_api_pwm_duty (hpm_pwm_t *pwm_t, uint32_t duty)
 The PWM duty cycle Settings Note: The duty cycle ranges from 0 to reload_count(reload_count is a member of pwm_pair_t) ;PWM占空比设置 注意: 占空比范围为0~reload_count(reload_count为pwm_t成员) More...
 
int hpm_mp_api_pwm_force_config (hpm_pwm_t *pwm_t, uint8_t level)
 Setting forced output for the PWM (setting the PWM signal to high or low level) Note: This interface is for configuration only and does not enable the active state. Enable or disable the following interfaces separately Enable (force output to be high or low level) hpm_mp_api_pwm_force_enable_output Disable (Restore PWM waveform) hpm_mp_api_pwm_force_disable_output ;PWM强制输出设置(将PWM强制设置为高电平或低电平) 注意: 此接口只是配置,并不会使能生效状态,使能或禁止需单独调用以下接口 使能生效(强制输出为高或低) hpm_mp_api_pwm_force_enable_output 禁止生效(恢复PWM波形) hpm_mp_api_pwm_force_disable_output. More...
 
void hpm_mp_api_pwm_force_enable_output (hpm_pwm_t *pwm_t)
 Enable the PWM signal forced outputs (force output to be high or low level) ;PWM强制输出使能生效(强制输出为高或低) More...
 
void hpm_mp_api_pwm_force_disable_output (hpm_pwm_t *pwm_t)
 Disable the PWM signal forced outputs(Restore PWM waveform)
;PWM强制输出禁止生效(恢复PWM波形) More...
 
void hpm_mp_api_pwm_fault_software_clear (hpm_pwm_t *pwm_t)
 The PWM fault states are cleared by software Note: When the fault recovery is set to software recovery, use this interface to clear the fault status after confirming fault clearance. ;PWM故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态 More...
 
int hpm_mp_api_pwm_pair_trig_set_duty (hpm_pwm_pair_t *pwm_pair_t, uint32_t duty)
 Setting the duty cycle for a pair of PWM signals that trigger ADC sampling moments Note: Duty cycle ranges from 0 to reload_count(pwm_t) ;PWM对触发ADC采样时刻占空比设置 注意: 占空比范围为0~reload_count(pwm_pair_t) More...
 
int hpm_mp_api_pwm_trig_set_duty (hpm_pwm_t *pwm_t, uint32_t duty)
 Setting the duty cycle for the PWM signal that trigger ADC sampling moments Note: Duty cycle ranges from 0 to reload_count(pwm_t) ;PWM 触发ADC采样时刻占空比设置 注意: 占空比范围为0~reload_count(pwm_t) More...
 
int hpm_mp_api_pwm_pair_set_deadzone (hpm_pwm_pair_t *pwm_pair_t, uint32_t start_halfcycle, uint32_t end_halfcycle)
 A pair of PWM dead zone Settings ;PWM对前后死区设置 More...
 
int hpm_mp_api_dma_request_enable (bool enable, uint8_t type, void *handle)
 PWM DMA enable ;PWM DMA请求使能 More...
 
int hpm_mp_timer_create (uint32_t us, mp_timer_cb cb)
 High precision timer creation ;高精定时器创建 More...
 
int hpm_mp_api_pwm_pair_set_map (const mp_pwm_pair_map_t *map_t, int count)
 Settings for a pair of PWM MAP ;PWM对 MAP设置 More...
 
int hpm_mp_api_pwm_set_map (const mp_pwm_map_t *map_t, int count)
 Settings for the PWM MAP ;PWM MAP设置 More...
 
int hpm_mp_api_adc_set_map (const mp_adc_map_t *map_t, int count)
 Settings for the ADC MAP ;ADC MAP设置 More...
 
void hpm_mp_api_pair_pwm_io_init (uint8_t pair_index)
 A pair of PWM IO init ;PWM 对 IO初始化 More...
 
void hpm_mp_api_pwm_io_init (uint8_t index)
 PWM IO init ;PWM IO初始化 More...
 
void hpm_mp_api_adc_io_init (uint8_t adc_index)
 ADC IO init ;ADC IO初始化 More...
 

Detailed Description

HPM Power interface;HPM电源接口

HPM Power common interface;电源通用接口

Macro Definition Documentation

◆ MP_PWM_PAIR_COUNT

#define MP_PWM_PAIR_COUNT   (MP_PWM_PAIR_NUM_MAX)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

Summation of a pair of PWM sequence numbers ;PWM对序号总和

◆ MP_PWM_TRIGGER_ADC_BIT

#define MP_PWM_TRIGGER_ADC_BIT   (0)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

PWM trigger for ADC bit ;PWM互联触发ADC采样BIT位

◆ MP_PWM_TRIGGER_COUNT_MAX

#define MP_PWM_TRIGGER_COUNT_MAX   (8)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

PWM trigger count max ;PWM互联触发最大总和

◆ MP_VERSION

#define MP_VERSION   "V0.1.0"

Typedef Documentation

◆ hpm_mp_adc_over_callback

typedef void(* hpm_mp_adc_over_callback) (void *handle)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

ADC callback after sampling ends ;ADC 采样结束回调

◆ hpm_mp_hdma_over_callback

typedef void(* hpm_mp_hdma_over_callback) (hpm_hdma_adc_t *hdma_adc_t)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

HDMA ADC data transmission and callback completed ;HDMA ADC数据搬用完成回调

◆ mp_timer_cb

typedef void(* mp_timer_cb) (void)

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

High precision timer callback ;高精定时回调

Enumeration Type Documentation

◆ mp_adc_index

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

ADC index number(an abstract MAP sequence number) ;ADC序号(MAP抽象序号)

Enumerator
MP_ADC_NUM_0 
MP_ADC_NUM_1 
MP_ADC_NUM_2 
MP_ADC_NUM_3 
MP_ADC_NUM_4 
MP_ADC_NUM_5 
MP_ADC_NUM_6 
MP_ADC_NUM_7 
MP_ADC_NUM_8 
MP_ADC_NUM_9 
MP_ADC_NUM_10 
MP_ADC_NUM_11 
MP_ADC_NUM_12 
MP_ADC_NUM_13 
MP_ADC_NUM_14 
MP_ADC_NUM_15 
MP_ADC_NUM_16 
MP_ADC_NUM_17 
MP_ADC_NUM_18 
MP_ADC_NUM_19 
MP_ADC_NUM_20 
MP_ADC_NUM_21 
MP_ADC_NUM_22 
MP_ADC_NUM_23 
MP_ADC_NUM_MAX 

◆ mp_pwm_index

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

The PWM index number(an abstract MAP sequence number) ;PWM序号(MAP抽象序号)

Enumerator
MP_PWM_NUM_0 
MP_PWM_NUM_1 
MP_PWM_NUM_2 
MP_PWM_NUM_3 
MP_PWM_NUM_4 
MP_PWM_NUM_5 
MP_PWM_NUM_6 
MP_PWM_NUM_7 
MP_PWM_NUM_MAX 

◆ mp_pwm_pair_index

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

a pair of PWM index number(an abstract MAP sequence number) ; PWM对序号(MAP抽象序号)

Enumerator
MP_PWM_PAIR_NUM_0 
MP_PWM_PAIR_NUM_1 
MP_PWM_PAIR_NUM_2 
MP_PWM_PAIR_NUM_3 
MP_PWM_PAIR_NUM_4 
MP_PWM_PAIR_NUM_5 
MP_PWM_PAIR_NUM_6 
MP_PWM_PAIR_NUM_7 
MP_PWM_PAIR_NUM_8 
MP_PWM_PAIR_NUM_9 
MP_PWM_PAIR_NUM_10 
MP_PWM_PAIR_NUM_11 
MP_PWM_PAIR_NUM_12 
MP_PWM_PAIR_NUM_13 
MP_PWM_PAIR_NUM_14 
MP_PWM_PAIR_NUM_15 
MP_PWM_PAIR_NUM_MAX 

◆ mp_pwm_pair_mode

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

The type of a pair of PWM(complementary mode, phase center aligned mode, edge aligned mode) ;PWM对模式类型(互补模式; 相位中心对齐模式; 边沿对齐模式)

Enumerator
MP_PWM_PAIR_MODE_REVERSE 

complementary mode ;互补模式

MP_PWM_PAIR_MODE_CENTRAL 

phase center aligned mode ;相位中心对齐模式

MP_PWM_PAIR_MODE_EDGE 

edge aligned mode ;边沿对齐模式

MP_PWM_PAIR_MODE_MAX 

◆ mp_pwm_pair_phase_angle

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

The phase Angle of a pair of PWM in phase center aligned mode ;PWM对相位中心对齐模式相位角度

Enumerator
MP_PWM_PAIR_PHASE_ANGLE_0 

0 angle ;0度

MP_PWM_PAIR_PHASE_ANGLE_180 

180 angle ;180度

MP_PWM_PAIR_PHASE_ANGLE_120 

120 angle ;120度

MP_PWM_PAIR_PHASE_ANGLE_90 

90 angle ;90度

MP_PWM_PAIR_PHASE_ANGLE_72 

72 angle ;72度

MP_PWM_PAIR_PHASE_ANGLE_60 

60 angle ;60度

MP_PWM_PAIR_PHASE_ANGLE_45 

45 angle ;45度

MP_PWM_PAIR_PHASE_ANGLE_40 

40 angle ;40度

MP_PWM_PAIR_PHASE_ANGLE_36 

36 angle ;36度

MP_PWM_PAIR_PHASE_ANGLE_30 

30 angle ;30度

◆ mp_pwm_trigger_mode

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

PWM TRGM mode(Output mode; DMA request mode) Output mode:TRGM output IO signal DMA request mode:TRGM output DMA request and then trigger DMA ;PWM互联触发模式(输出模式;DMA请求模式) 输出模式: 互联输出IO信号 DMA请求模式: 互联输出DMA请求,触发DMA.

Enumerator
MP_PWM_TRIGGER_MODE_OUTPUT 

Output mode ;输出模式

MP_PWM_TRIGGER_MODE_DMA 

DMA request mode ;DMA请求模式

◆ mp_pwm_type

#include <apps/mp_adapte/software/adapte/inc/mp_common.h>

PWM type(one channel or one pair) ;PWM类型(单路或一对)

Enumerator
MP_PWM_SINGLE_TYPE 

one channel ;单路

MP_PWM_PAIR_TYPE 

one pair ;一对

MP_PWM_TYPE_MAX 

Function Documentation

◆ hpm_mp_adc_get_default()

int hpm_mp_adc_get_default ( uint8_t  adc_index,
hpm_adc_t adc_t 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

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

Parameters
[in]adc_indexADC index number(an abstract MAP sequence number) ;ADC序号index(该序号为抽象的MAP序号)
[out]adc_tAddress of the ADC data structure object, used for returning default values ;ADC数据结构对象地址,用于返回默认值
Return values
==0Successfully getting the default values of the ADC data structure; !=0 Failed to get the default value of the ADC data structure; ;==获取ADC数据结构默认值成功; !=0 获取ADC数据结构默认值错误;

◆ hpm_mp_api_adc_io_init()

void hpm_mp_api_adc_io_init ( uint8_t  adc_index)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

ADC IO init ;ADC IO初始化

Parameters
[in]adc_indexADC index number(an abstract MAP sequence number) ;ADC 序号(MAP抽象序号)

◆ hpm_mp_api_adc_set_map()

int hpm_mp_api_adc_set_map ( const mp_adc_map_t map_t,
int  count 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Settings for the ADC MAP ;ADC MAP设置

Parameters
[in]map_tAddress of the PWM MAP data structure object ;ADC MAP数据结构对象地址
[in]countCount for ADC MAP data ;ADC MAP数组总和
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_dma_request_enable()

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

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

PWM DMA enable ;PWM DMA请求使能

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

◆ hpm_mp_api_get_default()

int hpm_mp_api_get_default ( hpm_mp_t mp_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

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

Parameters
[out]mp_tAddress of the Power data structure object, used for returning default values. ;电源数据结构对象地址,用于返回默认值
Return values
==0Successfully getting the default values of the power data structure; !=0 Failed to get the default value of the power data structure; ;==0 获取电源数据结构默认值成功; !=0 获取电源数据结构默认值错误;

◆ hpm_mp_api_init()

int hpm_mp_api_init ( hpm_mp_t mp_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Power API initialization ;电源API初始化

Parameters
[in]mp_tAddress of the Power data structure object ;电源数据结构对象地址
Return values
==0Power API initialized successfully; !=0 Power API initialized failed; ;==0 电源API初始化成功; !=0 电源API初始化失败;

◆ hpm_mp_api_pair_pwm_io_init()

void hpm_mp_api_pair_pwm_io_init ( uint8_t  pair_index)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM IO init ;PWM 对 IO初始化

Parameters
[in]pair_indexa pair of PWM index number(an abstract MAP sequence number) ;PWM 对序号(MAP抽象序号)

◆ hpm_mp_api_pwm_duty()

int hpm_mp_api_pwm_duty ( hpm_pwm_t pwm_t,
uint32_t  duty 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

The PWM duty cycle Settings Note: The duty cycle ranges from 0 to reload_count(reload_count is a member of pwm_pair_t) ;PWM占空比设置 注意: 占空比范围为0~reload_count(reload_count为pwm_t成员)

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址
[in]dutyDuty cycle(0..reload_count) ;占空比值(0..reload_count)
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_fault_software_clear()

void hpm_mp_api_pwm_fault_software_clear ( hpm_pwm_t pwm_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

The PWM fault states are cleared by software Note: When the fault recovery is set to software recovery, use this interface to clear the fault status after confirming fault clearance. ;PWM故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址

◆ hpm_mp_api_pwm_force_config()

int hpm_mp_api_pwm_force_config ( hpm_pwm_t pwm_t,
uint8_t  level 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting forced output for the PWM (setting the PWM signal to high or low level) Note: This interface is for configuration only and does not enable the active state. Enable or disable the following interfaces separately Enable (force output to be high or low level) hpm_mp_api_pwm_force_enable_output Disable (Restore PWM waveform) hpm_mp_api_pwm_force_disable_output ;PWM强制输出设置(将PWM强制设置为高电平或低电平) 注意: 此接口只是配置,并不会使能生效状态,使能或禁止需单独调用以下接口 使能生效(强制输出为高或低) hpm_mp_api_pwm_force_enable_output 禁止生效(恢复PWM波形) hpm_mp_api_pwm_force_disable_output.

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址
[in]levellevel ;电平
  • 0: low level ;低电平
  • 1: high level ;高电平
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_force_disable_output()

void hpm_mp_api_pwm_force_disable_output ( hpm_pwm_t pwm_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Disable the PWM signal forced outputs(Restore PWM waveform)
;PWM强制输出禁止生效(恢复PWM波形)

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址

◆ hpm_mp_api_pwm_force_enable_output()

void hpm_mp_api_pwm_force_enable_output ( hpm_pwm_t pwm_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Enable the PWM signal forced outputs (force output to be high or low level) ;PWM强制输出使能生效(强制输出为高或低)

Parameters
[in]pwm_tAddress of the PWM data structure ;PWM数据结构地址

◆ hpm_mp_api_pwm_freq()

int hpm_mp_api_pwm_freq ( hpm_pwm_t pwm_t,
uint32_t  freq 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

PWM frequency Settings; Note: After setting the frequency, the duty cycle automatically converts to the original percentage. For example, with a 20% duty cycle, after setting the frequency, the duty cycle remains at 20% ;PWM频率设置; 注意: 设置频率后,占空比自动转换为原始百分比。如:20占空比,设置频率后,占空比仍然为20%.

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址
[in]freqPWM frequency ;PWM频率
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_freq_of_half_duty()

int hpm_mp_api_pwm_freq_of_half_duty ( hpm_pwm_t pwm_t,
uint32_t  freq 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting the frequency for the PWM and configuring a 50% duty cycle Note: After setting the frequency, the duty cycle is simultaneously set to 50% ;PWM频率设置且固定半占空比 注意: 设置频率后,占空比同时设置为50%.

Parameters
[in]pwm_tAddress of the PWM data structure object ;PWM数据结构对象地址
[in]freqPWM frequency ;PWM频率
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_io_init()

void hpm_mp_api_pwm_io_init ( uint8_t  index)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

PWM IO init ;PWM IO初始化

Parameters
[in]indexThe PWM index number(an abstract MAP sequence number) ;PWM 序号(MAP抽象序号)

◆ hpm_mp_api_pwm_pair_set_deadzone()

int hpm_mp_api_pwm_pair_set_deadzone ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  start_halfcycle,
uint32_t  end_halfcycle 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM dead zone Settings ;PWM对前后死区设置

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]start_halfcycleStarting time for deadarea. The unit is half of the PWM bus frequency ;起始死区时间,单位为PWM总线频率的一半
[in]end_halfcycleEnding time for deadarea. The unit is half of the PWM bus frequency ;结束死区时间, 单位为PWM总线频率的一半
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_pair_set_map()

int hpm_mp_api_pwm_pair_set_map ( const mp_pwm_pair_map_t map_t,
int  count 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Settings for a pair of PWM MAP ;PWM对 MAP设置

Parameters
[in]map_tAddress of a pair of PWM MAP data structure object ;PWM对 MAP数据结构对象地址
[in]countCount for a pair of PWM MAP data ;PWM对MAP数组总和
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_pair_trig_set_duty()

int hpm_mp_api_pwm_pair_trig_set_duty ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  duty 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting the duty cycle for a pair of PWM signals that trigger ADC sampling moments Note: Duty cycle ranges from 0 to reload_count(pwm_t) ;PWM对触发ADC采样时刻占空比设置 注意: 占空比范围为0~reload_count(pwm_pair_t)

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]dutyduty cycle(0..reload_count) ;占空比值(0..reload_count)
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_set_map()

int hpm_mp_api_pwm_set_map ( const mp_pwm_map_t map_t,
int  count 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Settings for the PWM MAP ;PWM MAP设置

Parameters
[in]map_tAddress of the PWM MAP data structure object ;PWM MAP数据结构对象地址
[in]countCount for the PWM MAP data ;PWM MAP数组总和
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwm_trig_set_duty()

int hpm_mp_api_pwm_trig_set_duty ( hpm_pwm_t pwm_t,
uint32_t  duty 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting the duty cycle for the PWM signal that trigger ADC sampling moments Note: Duty cycle ranges from 0 to reload_count(pwm_t) ;PWM 触发ADC采样时刻占空比设置 注意: 占空比范围为0~reload_count(pwm_t)

Parameters
[in]pwm_tPWM Address of the PWM data structure object ;PWM数据结构对象地址
[in]dutyduty cycle(0..reload_count) ;占空比值(0..reload_count)
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwmpair_duty()

int hpm_mp_api_pwmpair_duty ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  duty 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM duty cycle Settings Note: The duty cycle ranges from 0 to reload_count(reload_count is a member of pwm_pair_t) ;PWM对占空比设置 注意: 占空比范围为0~reload_count(reload_count为pwm_pair_t成员)

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]dutyDuty cycle(0..reload_count) ;占空比值(0..reload_count)
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwmpair_fault_software_clear()

void hpm_mp_api_pwmpair_fault_software_clear ( hpm_pwm_pair_t pwm_pair_t)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM fault states are cleared by software Note: When the fault recovery is set to software recovery, use this interface to clear the fault status after confirming fault clearance. ;PWM对故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址

◆ hpm_mp_api_pwmpair_force_config()

int hpm_mp_api_pwmpair_force_config ( hpm_pwm_pair_t pwm_pair_t,
uint8_t  index,
uint8_t  level 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting forced output for a pair of PWM (setting a pair of PWM signals to high or low level) Note: This interface is for configuration only and does not enable the active state. Enable or disable the following interfaces separately Enable (force output to be high or low level) hpm_mp_api_pwmpair_force_enable_output Disable (Restore PWM waveform) hpm_mp_api_pwmpair_force_disable_output ;PWM对强制输出设置(将PWM对强制设置为高电平或低电平) 注意: 此接口只是配置,并不会使能生效状态,使能或禁止需单独调用以下接口 使能生效(强制输出为高或低) hpm_mp_api_pwmpair_force_enable_output 禁止生效(恢复PWM波形) hpm_mp_api_pwmpair_force_disable_output.

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]indexOne channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
  • 0: First channel ;PWM对第一路
  • 1: Second channel ;PWM对第二路
[in]levellevel ;电平
  • 0: low level ;低电平
  • 1: high level ;高电平
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwmpair_force_disable_output()

void hpm_mp_api_pwmpair_force_disable_output ( hpm_pwm_pair_t pwm_pair_t,
uint8_t  index 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Disable a pair of PWM signals forced outputs(Restore PWM waveform) ;PWM对强制输出禁止生效(恢复PWM波形)

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]indexOne channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
  • 0: First channel ;PWM对第一路
  • 1: Second channel ;PWM对第二路

◆ hpm_mp_api_pwmpair_force_enable_output()

void hpm_mp_api_pwmpair_force_enable_output ( hpm_pwm_pair_t pwm_pair_t,
uint8_t  index 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Enable a pair of PWM signals forced outputs (force output to be high or low level) ;PWM对强制输出使能生效(强制输出为高或低)

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]indexOne channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
  • 0: First channel ;PWM对第一路
  • 1: Second channel ;PWM对第二路

◆ hpm_mp_api_pwmpair_freq()

int hpm_mp_api_pwmpair_freq ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  freq 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM frequency Settings; Note: After setting the frequency, the duty cycle automatically converts to the original percentage. For example, with a 20% duty cycle, after setting the frequency, the duty cycle remains at 20% ;PWM对频率设置; 注意: 设置频率后,占空比自动转换为原始百分比。如:20占空比,设置频率后,占空比仍然为20%.

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]freqa pair of PWM frequency ;PWM对频率
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwmpair_freq_of_half_duty()

int hpm_mp_api_pwmpair_freq_of_half_duty ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  freq 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Setting the frequency for a pair of PWM and configuring a 50% duty cycle Note: After setting the frequency, the duty cycle is simultaneously set to 50% ;PWM对频率设置且固定半占空比 注意: 设置频率后,占空比同时设置为50%.

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]freqa pair of PWM frequency ;PWM对频率
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_api_pwmpair_get_reload_of_freq()

uint32_t hpm_mp_api_pwmpair_get_reload_of_freq ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  freq 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM gets the overloaded value 'reload_count' based on frequency ;PWM对根据频率获取重载值reload_count.

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]freqa pair of PWM frequency ;PWM对频率
Return values
Apair of PWM gets the overloaded value 'reload_count' based on frequency ;PWM对根据频率获取的重载值reload_count

◆ hpm_mp_api_pwmpair_set_reload_and_duty()

int hpm_mp_api_pwmpair_set_reload_and_duty ( hpm_pwm_pair_t pwm_pair_t,
uint32_t  reload_count,
uint32_t  duty_count 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

A pair of PWM, configured frequency and duty cycle Note: Get reload_count by frequency first,by using hpm_mp_api_pwmpair_get_reload_of_freq ;PWM对同时设置频率和占空比; 注意: 先通过频率获取reload_count,调用 hpm_mp_api_pwmpair_get_reload_of_freq 接口获取

Parameters
[in]pwm_pair_tAddress of a pair of PWM data structure object ;PWM对数据结构对象地址
[in]reload_countThe reload_count of a pair of PWM ;PWM对重载值reload_count
[in]duty_countduty_count(0..reload_count) ;占空比值(0..reload_count)
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败

◆ hpm_mp_pwm_get_default()

int hpm_mp_pwm_get_default ( uint8_t  pwm_index,
uint32_t  freq,
hpm_pwm_t pwm_t 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Get the default value of the single PWM data structure ;获取PWM(单路)数据结构默认值

Parameters
[in]pwm_indexPWM index number(an abstract MAP sequence number) ;PWM序号index(该序号为抽象的MAP序号)
[in]freqPWM frequency ;PWM频率
[out]pwm_tAddress of the PWM data structure object, used for returning default values ;PWM数据结构对象地址,用于返回默认值
Return values
==0Successfully getting the default values of the PWM data structure; !=0 Failed to get the default value of the PWM data structure; ;==0 获取PWM数据结构默认值成功; !=0 获取PWM数据结构默认值错误;

◆ hpm_mp_pwm_pair_get_default()

int hpm_mp_pwm_pair_get_default ( uint8_t  pwm_pair_index,
uint32_t  freq,
hpm_pwm_pair_t pwm_pair_t 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

Get the default value of a pair of PWM (two PWM channels as a pair) data structure
;获取PWM对(两路PWM成一对)数据结构默认值

Parameters
[in]pwm_pair_indexa pair of PWM index number(an abstract MAP sequence number) ;PWM对序号index(该序号为抽象的MAP序号)
[in]freqa pair of PWM frequency ;PWM对频率
[out]pwm_pair_tAddress of a pair of PWM data structure object, used for returning default values. ;PWM对数据结构对象地址,用于返回默认值
Return values
==0Successfully getting the default values of a pair of PWM data structure; !=0 Failed to get the default value of a pair of PWM data structure; ;==0 获取PWM对数据结构默认值成功; !=0 获取PWM对数据结构默认值错误;

◆ hpm_mp_timer_create()

int hpm_mp_timer_create ( uint32_t  us,
mp_timer_cb  cb 
)

#include <apps/mp_adapte/software/adapte/inc/mp_api.h>

High precision timer creation ;高精定时器创建

Parameters
[in]usTimer time(unit:us) ;定时器时刻(单位:微妙)
[in]cbTimer callback ;定时器响应回调callback
Return values
==0configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败