宏定义 | |
#define | PER_LIB_MCU_MUODEL STC8Gx |
如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax 更多... | |
#define | PER_LIB_MPWM_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0" 更多... | |
#define | PER_LIB_MPWM_INIT_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0" 更多... | |
#define | PER_LIB_MPWM_NVIC_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0" 更多... | |
#define | PER_LIB_MPWM_WORK_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0" 更多... | |
枚举 | |
enum | MPWMCLKSrc_Type { MPWM_SCLK_DIV_1 = 0x00 , MPWM_SCLK_DIV_2 = 0x01 , MPWM_SCLK_DIV_3 = 0x02 , MPWM_SCLK_DIV_4 = 0x03 , MPWM_SCLK_DIV_5 = 0x04 , MPWM_SCLK_DIV_6 = 0x05 , MPWM_SCLK_DIV_7 = 0x06 , MPWM_SCLK_DIV_8 = 0x07 , MPWM_SCLK_DIV_9 = 0x08 , MPWM_SCLK_DIV_10 = 0x09 , MPWM_SCLK_DIV_11 = 0x0A , MPWM_SCLK_DIV_12 = 0x0B , MPWM_SCLK_DIV_13 = 0x0C , MPWM_SCLK_DIV_14 = 0x0D , MPWM_SCLK_DIV_15 = 0x0E , MPWM_SCLK_DIV_16 = 0x0F , MPWM_TIMER2_PULSE = 0x1F } |
MPWM系统时钟选择枚举体。 更多... | |
enum | MPWMStartLevel_Type { MPWM_Start_Low_Level = 0x00 , MPWM_Start_High_Level = 0x01 } |
enum | MPWMPort_Type { MPWM_Port_0 = 0x00 , MPWM_Port_1 = 0x01 , MPWM_Port_2 = 0x02 , MPWM_Port_3 = 0x03 , MPWM_Port_4 = 0x04 , MPWM_Port_5 = 0x05 } |
enum | MPWMChannel_Type { MPWM_Channel_0 = 0x00 , MPWM_Channel_1 = 0x01 , MPWM_Channel_2 = 0x02 , MPWM_Channel_3 = 0x03 , MPWM_Channel_4 = 0x04 , MPWM_Channel_5 = 0x05 , MPWM_Channel_6 = 0x06 , MPWM_Channel_7 = 0x07 } |
函数 | |
FSCSTATE | MPWMn_Port_Init (MPWMPort_Type port, MPWMCLKSrc_Type clkSrc, uint16_t period) |
PWM端口初始化函数。Init PWM port function. 更多... | |
FSCSTATE | MPWMn_Channel_Init (MPWMPort_Type port, MPWMChannel_Type ch, MPWMStartLevel_Type level, uint16_t fValue, uint16_t sValue, BOOL run) |
PWM通道初始化函数。Init PWM channel function. 更多... | |
FSCSTATE | MPWMn_Run (MPWMPort_Type port) |
指定PWM端口开始工作。Run specified PWM port. 更多... | |
FSCSTATE | MPWMn_Stop (MPWMPort_Type port) |
指定PWM端口停止工作。Stop specified PWM port working. 更多... | |
#define PER_LIB_MCU_MUODEL STC8Gx |
如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax
#define PER_LIB_MPWM_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0"
#define PER_LIB_MPWM_INIT_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0"
#define PER_LIB_MPWM_NVIC_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0"
#define PER_LIB_MPWM_WORK_CTRL 1 |
如果没有定义这个宏,默认为0。 If the mirco is undefined,select to "0"
enum MPWMChannel_Type |
enum MPWMCLKSrc_Type |
MPWM系统时钟选择枚举体。
PWM clock source Enumerator.
enum MPWMPort_Type |
enum MPWMStartLevel_Type |
FSCSTATE MPWMn_Channel_Init | ( | MPWMPort_Type | port, |
MPWMChannel_Type | ch, | ||
MPWMStartLevel_Type | level, | ||
uint16_t | fValue, | ||
uint16_t | sValue, | ||
BOOL | run | ||
) |
PWM通道初始化函数。Init PWM channel function.
初始化指定端口(0-5)的指定通道(0-7)。Init the specified port's channel (port from 0 to 5, channel from 0 to 7)
[in] | port | PWM端口枚举体。PWM port enumerator. |
[in] | ch | PWM通道枚举体。PWM channel enumerator. |
[in] | level | PWM开始电平。PWM start level. |
[in] | fValue | 第一个电平翻转点。The value of the first reversal point. |
[in] | sValue | 第二个电平翻转点。The value of the second reversal point. |
[in] | run | 运行控制位。Run control bit. |
FSCSTATE MPWMn_Port_Init | ( | MPWMPort_Type | port, |
MPWMCLKSrc_Type | clkSrc, | ||
uint16_t | period | ||
) |
PWM端口初始化函数。Init PWM port function.
初始化指定端口(0-5)。Init the specified PWM port. (from 0 to 5)
[in] | port | PWM端口枚举体。PWM port enumerator. |
[in] | clkSrc | PWM时钟源。PWM clock source. |
[in] | period | PWM周期值(计数器重装载值)。PWM period value (counter reload value) |
FSCSTATE MPWMn_Run | ( | MPWMPort_Type | port | ) |
指定PWM端口开始工作。Run specified PWM port.
指定PWM端口开始工作,输出PWM波形。Run specified PWM port. (Start PWM signal outputs)
[in] | port | PWM端口枚举体。PWM port enumerator. |
FSCSTATE MPWMn_Stop | ( | MPWMPort_Type | port | ) |
指定PWM端口停止工作。Stop specified PWM port working.
指定PWM端口停止工作,停止输出PWM波形。Stop specified PWM port. (Stop PWM signal outputs)
[in] | port | PWM端口枚举体。PWM port enumerator. |