//PE4_M1PWM2 PE5_M1PWM3 Period=50000 Duty0=Duty1=5000.频率为50HZ占空比为20%
void mypwm0_Configuration(uint32_t Period, uint32_t Duty0,uint32_t Duty1)
{
// Set the PWM clock to the system clock.80M/32=2.5M
SysCtlPWMClockSet(SYSCTL_PWMDIV_32);
// Enable the GPIO Peripheral used by the PWM1
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
// Enable PWM1
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
// Configure GPIO Pins for PWM1 mode.
GPIOPinConfigure(GPIO_PE4_M1PWM2);
GPIOPinConfigure(GPIO_PE5_M1PWM3);
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_2, Duty0);
PWMPulseWidthSet(PWM1_BASE, PWM_OUT_3, Duty1);
// Enable the PWM1 Bit 2 (PE4)
PWMOutputState(PWM1_BASE, PWM_OUT_2_BIT, true);
PWMOutputState(PWM1_BASE, PWM_OUT_3_BIT, true);
// Enables the counter for a PWM generator block.
PWMGenEnable(PWM1_BASE, PWM_GEN_1);
}
//PD0_M0PWM6 PD1_M0PWM7 Period=50000 Duty2=Duty3=5000.频率为50HZ占空比为20%
void mypwm1_Configuration(uint32_t Period, uint32_t Duty2,uint32_t Duty3)
{
// Set the PWM clock to the system clock.80M/32=2.5M
SysCtlPWMClockSet(SYSCTL_PWMDIV_32);
// Enable the GPIO Peripheral used by the PWM0
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
// Enable PWM0
SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);
// Configure GPIO Pins for PWM0 mode.
GPIOPinConfigure(GPIO_PD0_M0PWM6);
GPIOPinConfigure(GPIO_PD1_M0PWM7);