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... | |
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... | |
HPM Power interface;HPM电源接口
HPM Power common interface;电源通用接口
| #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对序号总和
| #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位
| #define MP_PWM_TRIGGER_COUNT_MAX (8) |
#include <apps/mp_adapte/software/adapte/inc/mp_common.h>
PWM trigger count max ;PWM互联触发最大总和
| #define MP_VERSION "V0.1.0" |
#include <apps/mp_adapte/software/adapte/inc/mp_api.h>
| 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 采样结束回调
| 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数据搬用完成回调
| typedef void(* mp_timer_cb) (void) |
#include <apps/mp_adapte/software/adapte/inc/mp_common.h>
High precision timer callback ;高精定时回调
| enum mp_adc_index |
#include <apps/mp_adapte/software/adapte/inc/mp_common.h>
ADC index number(an abstract MAP sequence number) ;ADC序号(MAP抽象序号)
| enum 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 | |
| enum 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抽象序号)
| enum 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 | |
#include <apps/mp_adapte/software/adapte/inc/mp_common.h>
The phase Angle of a pair of PWM in phase center aligned mode ;PWM对相位中心对齐模式相位角度
| enum 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请求模式 |
| enum 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 | |
| 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数据结构默认值
| [in] | adc_index | ADC index number(an abstract MAP sequence number) ;ADC序号index(该序号为抽象的MAP序号) |
| [out] | adc_t | Address of the ADC data structure object, used for returning default values ;ADC数据结构对象地址,用于返回默认值 |
| ==0 | Successfully getting the default values of the ADC data structure; !=0 Failed to get the default value of the ADC data structure; ;==获取ADC数据结构默认值成功; !=0 获取ADC数据结构默认值错误; |
| 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初始化
| [in] | adc_index | ADC index number(an abstract MAP sequence number) ;ADC 序号(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设置
| [in] | map_t | Address of the PWM MAP data structure object ;ADC MAP数据结构对象地址 |
| [in] | count | Count for ADC MAP data ;ADC MAP数组总和 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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请求使能
| [in] | enable | true:enable; flase:disable; ;true:使能; flase:禁止; |
| [in] | type | PWM typemp_pwm_type ;PWM类型 mp_pwm_type |
| [in] | handle | Address of a pair of PWM or single PWM data structure object hpm_pwm_t 或 hpm_pwm_pair_t ;PWM 或 PWM对数据结构对象地址 hpm_pwm_t 或 hpm_pwm_pair_t |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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 ;电源数据结构默认值获取
| [out] | mp_t | Address of the Power data structure object, used for returning default values. ;电源数据结构对象地址,用于返回默认值 |
| ==0 | Successfully getting the default values of the power data structure; !=0 Failed to get the default value of the power data structure; ;==0 获取电源数据结构默认值成功; !=0 获取电源数据结构默认值错误; |
| int hpm_mp_api_init | ( | hpm_mp_t * | mp_t | ) |
#include <apps/mp_adapte/software/adapte/inc/mp_api.h>
Power API initialization ;电源API初始化
| [in] | mp_t | Address of the Power data structure object ;电源数据结构对象地址 |
| ==0 | Power API initialized successfully; !=0 Power API initialized failed; ;==0 电源API初始化成功; !=0 电源API初始化失败; |
| 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初始化
| [in] | pair_index | a pair of PWM index number(an abstract MAP sequence number) ;PWM 对序号(MAP抽象序号) |
| 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成员)
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| [in] | duty | Duty cycle(0..reload_count) ;占空比值(0..reload_count) |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| 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.
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| [in] | level | level ;电平
|
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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波形)
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| 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强制输出使能生效(强制输出为高或低)
| [in] | pwm_t | Address of the PWM data structure ;PWM数据结构地址 |
| 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%.
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| [in] | freq | PWM frequency ;PWM频率 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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%.
| [in] | pwm_t | Address of the PWM data structure object ;PWM数据结构对象地址 |
| [in] | freq | PWM frequency ;PWM频率 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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初始化
| [in] | index | The PWM index number(an abstract MAP sequence number) ;PWM 序号(MAP抽象序号) |
| 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对前后死区设置
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | start_halfcycle | Starting time for deadarea. The unit is half of the PWM bus frequency ;起始死区时间,单位为PWM总线频率的一半 |
| [in] | end_halfcycle | Ending time for deadarea. The unit is half of the PWM bus frequency ;结束死区时间, 单位为PWM总线频率的一半 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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设置
| [in] | map_t | Address of a pair of PWM MAP data structure object ;PWM对 MAP数据结构对象地址 |
| [in] | count | Count for a pair of PWM MAP data ;PWM对MAP数组总和 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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)
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | duty | duty cycle(0..reload_count) ;占空比值(0..reload_count) |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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设置
| [in] | map_t | Address of the PWM MAP data structure object ;PWM MAP数据结构对象地址 |
| [in] | count | Count for the PWM MAP data ;PWM MAP数组总和 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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)
| [in] | pwm_t | PWM Address of the PWM data structure object ;PWM数据结构对象地址 |
| [in] | duty | duty cycle(0..reload_count) ;占空比值(0..reload_count) |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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成员)
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | duty | Duty cycle(0..reload_count) ;占空比值(0..reload_count) |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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对故障状态软件清除 注意: 当故障恢复设置为软件恢复后,在确认故障清除后,使用此接口清除故障状态
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| 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.
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | index | One channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
|
| [in] | level | level ;电平
|
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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波形)
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | index | One channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
|
| 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对强制输出使能生效(强制输出为高或低)
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | index | One channel of the PWM pairs(two channels = one pair) ;PWM对某一路(PWM对两路为一对)
|
| 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%.
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | freq | a pair of PWM frequency ;PWM对频率 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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%.
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | freq | a pair of PWM frequency ;PWM对频率 |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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.
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | freq | a pair of PWM frequency ;PWM对频率 |
| A | pair of PWM gets the overloaded value 'reload_count' based on frequency ;PWM对根据频率获取的重载值reload_count |
| 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 接口获取
| [in] | pwm_pair_t | Address of a pair of PWM data structure object ;PWM对数据结构对象地址 |
| [in] | reload_count | The reload_count of a pair of PWM ;PWM对重载值reload_count |
| [in] | duty_count | duty_count(0..reload_count) ;占空比值(0..reload_count) |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |
| 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(单路)数据结构默认值
| [in] | pwm_index | PWM index number(an abstract MAP sequence number) ;PWM序号index(该序号为抽象的MAP序号) |
| [in] | freq | PWM frequency ;PWM频率 |
| [out] | pwm_t | Address of the PWM data structure object, used for returning default values ;PWM数据结构对象地址,用于返回默认值 |
| ==0 | Successfully 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数据结构默认值错误; |
| 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成一对)数据结构默认值
| [in] | pwm_pair_index | a pair of PWM index number(an abstract MAP sequence number) ;PWM对序号index(该序号为抽象的MAP序号) |
| [in] | freq | a pair of PWM frequency ;PWM对频率 |
| [out] | pwm_pair_t | Address of a pair of PWM data structure object, used for returning default values. ;PWM对数据结构对象地址,用于返回默认值 |
| ==0 | Successfully 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对数据结构默认值错误; |
| 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 ;高精定时器创建
| [in] | us | Timer time(unit:us) ;定时器时刻(单位:微妙) |
| [in] | cb | Timer callback ;定时器响应回调callback |
| ==0 | configuration succeeded; !=0 configuration failed ;==0 设置成功; !=0 设置失败 |