Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 18,
(IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_DIGITAL_EN));
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 19,
(IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_DIGITAL_EN));
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 20,
(IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_DIGITAL_EN));
Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 21,
(IOCON_FUNC0 | IOCON_MODE_INACT | IOCON_DIGITAL_EN));
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 18);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 19);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 20);
Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 21);
SCTPWM_Init(); //在初始化完成了各个IO后,初始化PWM模块,用来控制自平衡车电机
Init_USART();//初始化串口
SysTick_Config(100000000 / TICKRATE_HZ);
TIME_Init();
|