![]() |
MINI51DE_BSP V3.02.004
The Board Support Package for Mini51DE Series MCU
|
Macros | |
#define | PWM_ENABLE_COMPLEMENTARY_MODE(pwm) |
This macro enable complementary mode. More... | |
#define | PWM_DISABLE_COMPLEMENTARY_MODE(pwm) |
This macro disable complementary mode, and enable independent mode. More... | |
#define | PWM_ENABLE_GROUP_MODE(pwm) |
This macro enable group mode. More... | |
#define | PWM_DISABLE_GROUP_MODE(pwm) |
This macro disable group mode. More... | |
#define | PWM_ENABLE_SYNC_MODE(pwm) |
This macro enable synchronous mode. More... | |
#define | PWM_DISABLE_SYNC_MODE(pwm) |
This macro disable synchronous mode, and enable independent mode. More... | |
#define | PWM_ENABLE_OUTPUT_INVERTER(pwm, u32ChannelMask) |
This macro enable output inverter of specified channel(s) More... | |
#define | PWM_SET_PRESCALER(pwm, u32ChannelNum, u32Prescaler) |
This macro set the prescaler of the selected channel. More... | |
#define | PWM_SET_DIVIDER(pwm, u32ChannelNum, u32Divider) |
This macro set the divider of the selected channel. More... | |
#define | PWM_SET_CMR(pwm, u32ChannelNum, u32CMR) |
This macro set the duty of the selected channel. More... | |
#define | PWM_SET_CNR(pwm, u32ChannelNum, u32CNR) |
This macro set the period of the selected channel. More... | |
#define | PWM_SET_ALIGNED_TYPE(pwm, u32ChannelMask, u32AlignedType) |
This macro set the PWM aligned type. More... | |
Functions | |
uint32_t | PWM_ConfigOutputChannel (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Frequency, uint32_t u32DutyCycle) |
This function config PWM generator and get the nearest frequency in edge aligned auto-reload mode. More... | |
void | PWM_Start (PWM_T *pwm, uint32_t u32ChannelMask) |
This function start PWM module. More... | |
void | PWM_Stop (PWM_T *pwm, uint32_t u32ChannelMask) |
This function stop PWM module. More... | |
void | PWM_ForceStop (PWM_T *pwm, uint32_t u32ChannelMask) |
This function stop PWM generation immediately by clear channel enable bit. More... | |
void | PWM_EnableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition) |
This function enable selected channel to trigger ADC. More... | |
void | PWM_DisableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum) |
This function disable selected channel to trigger ADC. More... | |
void | PWM_ClearADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition) |
This function clear selected channel trigger ADC flag. More... | |
uint32_t | PWM_GetADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function get selected channel trigger ADC flag. More... | |
void | PWM_EnableFaultBrake (PWM_T *pwm, uint32_t u32ChannelMask, uint32_t u32LevelMask, uint32_t u32BrakeSource) |
This function enable fault brake of selected channels. More... | |
void | PWM_ClearFaultBrakeFlag (PWM_T *pwm, uint32_t u32BrakeSource) |
This function clear fault brake flag. More... | |
void | PWM_EnableOutput (PWM_T *pwm, uint32_t u32ChannelMask) |
This function enables PWM output generation of selected channels. More... | |
void | PWM_DisableOutput (PWM_T *pwm, uint32_t u32ChannelMask) |
This function disables PWM output generation of selected channels. More... | |
void | PWM_EnableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration) |
This function enable Dead zone of selected channel. More... | |
void | PWM_DisableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum) |
This function disable Dead zone of selected channel. More... | |
void | PWM_EnableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType) |
This function enable duty interrupt of selected channel. More... | |
void | PWM_DisableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum) |
This function disable duty interrupt of selected channel. More... | |
void | PWM_ClearDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function clears duty interrupt flag of selected channel. More... | |
uint32_t | PWM_GetDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function get duty interrupt flag of selected channel. More... | |
void | PWM_EnableFaultBrakeInt (PWM_T *pwm, uint32_t u32BrakeSource) |
This function enable fault brake interrupt. More... | |
void | PWM_DisableFaultBrakeInt (PWM_T *pwm, uint32_t u32BrakeSource) |
This function disable fault brake interrupt. More... | |
void | PWM_ClearFaultBrakeIntFlag (PWM_T *pwm, uint32_t u32BrakeSource) |
This function clear fault brake interrupt of selected source. More... | |
uint32_t | PWM_GetFaultBrakeIntFlag (PWM_T *pwm, uint32_t u32BrakeSource) |
This function get fault brake interrupt of selected source. More... | |
void | PWM_EnablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntPeriodType) |
This function enable period interrupt of selected channel. More... | |
void | PWM_DisablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum) |
This function disable period interrupt of selected channel. More... | |
void | PWM_ClearPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function clear period interrupt of selected channel. More... | |
uint32_t | PWM_GetPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function get period interrupt of selected channel. More... | |
#define PWM_DISABLE_COMPLEMENTARY_MODE | ( | pwm | ) |
#define PWM_DISABLE_GROUP_MODE | ( | pwm | ) |
#define PWM_DISABLE_SYNC_MODE | ( | pwm | ) |
#define PWM_ENABLE_COMPLEMENTARY_MODE | ( | pwm | ) |
#define PWM_ENABLE_GROUP_MODE | ( | pwm | ) |
#define PWM_ENABLE_OUTPUT_INVERTER | ( | pwm, | |
u32ChannelMask | |||
) |
#define PWM_ENABLE_SYNC_MODE | ( | pwm | ) |
#define PWM_SET_ALIGNED_TYPE | ( | pwm, | |
u32ChannelMask, | |||
u32AlignedType | |||
) |
#define PWM_SET_CMR | ( | pwm, | |
u32ChannelNum, | |||
u32CMR | |||
) |
This macro set the duty of the selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32CMR | Duty of specified channel. Valid values are between 0~0xFFFF |
#define PWM_SET_CNR | ( | pwm, | |
u32ChannelNum, | |||
u32CNR | |||
) |
This macro set the period of the selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32CNR | Period of specified channel. Valid values are between 0~0xFFFF |
#define PWM_SET_DIVIDER | ( | pwm, | |
u32ChannelNum, | |||
u32Divider | |||
) |
This macro set the divider of the selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Divider | Clock divider of specified channel. Valid values are |
#define PWM_SET_PRESCALER | ( | pwm, | |
u32ChannelNum, | |||
u32Prescaler | |||
) |
This macro set the prescaler of the selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Prescaler | Clock prescaler of specified channel. Valid values are between 1 ~ 0xFF |
void PWM_ClearADCTriggerFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Condition | ||
) |
This function clear selected channel trigger ADC flag.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Condition | PWM triggered ADC flag to be cleared. A combination of following flags: |
void PWM_ClearDutyIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_ClearFaultBrakeFlag | ( | PWM_T * | pwm, |
uint32_t | u32BrakeSource | ||
) |
void PWM_ClearFaultBrakeIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32BrakeSource | ||
) |
This function clear fault brake interrupt of selected source.
[in] | pwm | The base address of PWM module |
[in] | u32BrakeSource | Fault brake source, could be either |
void PWM_ClearPeriodIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
uint32_t PWM_ConfigOutputChannel | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Frequency, | ||
uint32_t | u32DutyCycle | ||
) |
This function config PWM generator and get the nearest frequency in edge aligned auto-reload mode.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Frequency | Target generator frequency |
[in] | u32DutyCycle | Target generator duty cycle percentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%... |
void PWM_DisableADCTrigger | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_DisableDeadZone | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_DisableDutyInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_DisableFaultBrakeInt | ( | PWM_T * | pwm, |
uint32_t | u32BrakeSource | ||
) |
void PWM_DisableOutput | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
This function disables PWM output generation of selected channels.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output... |
void PWM_DisablePeriodInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_EnableADCTrigger | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Condition | ||
) |
This function enable selected channel to trigger ADC.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Condition | The condition to trigger ADC. Combination of following conditions: |
void PWM_EnableDeadZone | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Duration | ||
) |
This function enable Dead zone of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Duration | Dead Zone length in PWM clock count, valid values are between 0~0xFF, but 0 means there is no dead zone. |
void PWM_EnableDutyInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32IntDutyType | ||
) |
void PWM_EnableFaultBrake | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask, | ||
uint32_t | u32LevelMask, | ||
uint32_t | u32BrakeSource | ||
) |
This function enable fault brake of selected channels.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelMask | This parameter is not used |
[in] | u32LevelMask | Output high or low while fault brake occurs, each bit represent the level of a channel while fault brake occur. Bit 0 represents channel 0, bit 1 represents channel 1... , bit 6 represent D6, and bit 7 represents D7 |
[in] | u32BrakeSource | Fault brake source, could be one of following source |
void PWM_EnableFaultBrakeInt | ( | PWM_T * | pwm, |
uint32_t | u32BrakeSource | ||
) |
void PWM_EnableOutput | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
This function enables PWM output generation of selected channels.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel. Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output... |
void PWM_EnablePeriodInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32IntPeriodType | ||
) |
This function enable period interrupt of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32IntPeriodType | Period interrupt type, could be either |
void PWM_ForceStop | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
This function stop PWM generation immediately by clear channel enable bit.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelMask | Combination of enabled channels. Each bit corresponds to a channel. Bit 0 is channel 0, bit 1 is channel 1... |
uint32_t PWM_GetADCTriggerFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
This function get selected channel trigger ADC flag.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
uint32_t PWM_GetDutyIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
This function get duty interrupt flag of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
0 | Duty interrupt did not occurred |
1 | Duty interrupt occurred |
uint32_t PWM_GetFaultBrakeIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32BrakeSource | ||
) |
This function get fault brake interrupt of selected source.
[in] | pwm | The base address of PWM module |
[in] | u32BrakeSource | Fault brake source, could be either |
0 | Fault brake interrupt did not occurred |
1 | Fault brake interrupt occurred |
uint32_t PWM_GetPeriodIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
This function get period interrupt of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
0 | Period interrupt did not occurred |
1 | Period interrupt occurred |
void PWM_Start | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
void PWM_Stop | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |