/*****************头文件*************************/ #include "fsl_common.h" #include "fsl_gpio.h" #include "pin_Init.h" #include "delay.h" #include "uart_Interrupt.h" #include "fsl_uart.h" #include "system_MKV56F24.h" /********************************************* PTA15——LED灯闪烁 **********************************************/ void main() { MCG->C4 = 0x40; SystemCoreClockUpdate (); Delay_Init(); //延时函数初始化 pin_Init(); //GPIO初始化 UART0_InterrputInit(); //UART0初始化 UART2_InterrputInit(); //UART2初始化 while (1) { GPIO_PinWrite(GPIOA, 15, 0); Delay_ms(500U); GPIO_PinWrite(GPIOA, 15, 1); Delay_ms(500U); UART_WriteByte(UART0, 0x1A); //发送一帧数据(一个字节,8个数据位) UART_WriteByte(UART0, 0x62); //发送一帧数据(一个字节,8个数据位) UART_WriteByte(UART0, 0xc2); //发送一帧数据(一个字节,8个数据位) UART_WriteByte(UART0, 0x40); //发送一帧数据(一个字节,8个数据位) } }