![]() |
NANO100_BSP V3.04.002
The Board Support Package for Nano100BN Series
|
Macros | |
#define | PWM_ENABLE_OUTPUT_INVERTER(pwm, u32ChannelMask) |
This macro enable output inverter of specified channel(s) More... | |
#define | PWM_GET_CAPTURE_RISING_DATA(pwm, u32ChannelNum) |
This macro get captured rising data. More... | |
#define | PWM_GET_CAPTURE_FALLING_DATA(pwm, u32ChannelNum) |
This macro get captured falling data. 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... | |
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... | |
uint32_t | PWM_ConfigCaptureChannel (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32UnitTimeNsec, uint32_t u32CaptureEdge) |
This function config PWM capture and get the nearest unit time. 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_EnableCapture (PWM_T *pwm, uint32_t u32ChannelMask) |
This function enables PWM capture of selected channels. More... | |
void | PWM_DisableCapture (PWM_T *pwm, uint32_t u32ChannelMask) |
This function disables PWM capture of selected channels. 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_EnableCaptureInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) |
This function enable capture interrupt of selected channel. More... | |
void | PWM_DisableCaptureInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) |
This function disable capture interrupt of selected channel. More... | |
void | PWM_ClearCaptureIntFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Edge) |
This function clear capture interrupt flag of selected channel. More... | |
uint32_t | PWM_GetCaptureIntFlag (PWM_T *pwm, uint32_t u32ChannelNum) |
This function get capture interrupt flag of selected channel. 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... | |
void | PWM_EnablePDMA (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32RisingFirst, uint32_t u32Mode) |
This function enable capture PDMA of selected channel. More... | |
void | PWM_DisablePDMA (PWM_T *pwm, uint32_t u32ChannelNum) |
This function disable capture PDMA of selected channel. More... | |
#define PWM_ENABLE_OUTPUT_INVERTER | ( | pwm, | |
u32ChannelMask | |||
) |
#define PWM_GET_CAPTURE_FALLING_DATA | ( | pwm, | |
u32ChannelNum | |||
) |
#define PWM_GET_CAPTURE_RISING_DATA | ( | pwm, | |
u32ChannelNum | |||
) |
#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_ClearCaptureIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Edge | ||
) |
This function clear capture interrupt flag of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Edge | Capture interrupt type. It could be either |
void PWM_ClearPeriodIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
uint32_t PWM_ConfigCaptureChannel | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32UnitTimeNsec, | ||
uint32_t | u32CaptureEdge | ||
) |
This function config PWM capture and get the nearest unit time.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32UnitTimeNsec | Unit time of counter |
[in] | u32CaptureEdge | Condition to latch the counter |
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%... |
Definition at line 37 of file pwm.c.
void PWM_DisableCapture | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
This function disables PWM capture 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_DisableCaptureInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Edge | ||
) |
This function disable capture interrupt of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Edge | Capture interrupt type. It could be either |
void PWM_DisableDeadZone | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
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... |
Definition at line 346 of file pwm.c.
void PWM_DisablePDMA | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_DisablePeriodInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
void PWM_EnableCapture | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |
This function enables PWM capture 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... |
Definition at line 285 of file pwm.c.
void PWM_EnableCaptureInt | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32Edge | ||
) |
This function enable capture interrupt of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are between 0~5 |
[in] | u32Edge | Capture interrupt type. It could be either |
Definition at line 393 of file pwm.c.
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_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... |
Definition at line 334 of file pwm.c.
void PWM_EnablePDMA | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum, | ||
uint32_t | u32RisingFirst, | ||
uint32_t | u32Mode | ||
) |
This function enable capture PDMA of selected channel.
[in] | pwm | The base address of PWM module |
[in] | u32ChannelNum | PWM channel number. Valid values are 0 and 2 |
[in] | u32RisingFirst | Order of captured data transferred by PDMA. It could be either |
[in] | u32Mode | Captured data transferred by PDMA interrupt type. It could be either |
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 | This parameter is not used |
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_GetCaptureIntFlag | ( | PWM_T * | pwm, |
uint32_t | u32ChannelNum | ||
) |
This function get capture 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 | Capture interrupt did not occurred |
PWM_RISING_LATCH_INT_FLAG | Rising edge latch interrupt occurred |
PWM_FALLING_LATCH_INT_FLAG | Falling edge latch interrupt occurred |
PWM_RISING_FALLING_LATCH_INT_FLAG | Rising and falling edge latch 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 | ||
) |
This function start PWM module.
[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... |
Definition at line 227 of file pwm.c.
void PWM_Stop | ( | PWM_T * | pwm, |
uint32_t | u32ChannelMask | ||
) |