You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1007 B

  1. /*****************头文件*************************/
  2. #include "fsl_common.h"
  3. #include "fsl_gpio.h"
  4. #include "pin_Init.h"
  5. #include "delay.h"
  6. #include "uart_Interrupt.h"
  7. #include "fsl_uart.h"
  8. #include "system_MKV56F24.h"
  9. /*********************************************
  10. PTA15——LED灯闪烁
  11. **********************************************/
  12. void main()
  13. {
  14. MCG->C4 = 0x40;
  15. SystemCoreClockUpdate ();
  16. Delay_Init(); //延时函数初始化
  17. pin_Init(); //GPIO初始化
  18. UART0_InterrputInit(); //UART0初始化
  19. UART2_InterrputInit(); //UART2初始化
  20. while (1)
  21. {
  22. GPIO_PinWrite(GPIOA, 15, 0);
  23. Delay_ms(500U);
  24. GPIO_PinWrite(GPIOA, 15, 1);
  25. Delay_ms(500U);
  26. UART_WriteByte(UART0, 0x1A); //发送一帧数据(一个字节,8个数据位)
  27. UART_WriteByte(UART0, 0x62); //发送一帧数据(一个字节,8个数据位)
  28. UART_WriteByte(UART0, 0xc2); //发送一帧数据(一个字节,8个数据位)
  29. UART_WriteByte(UART0, 0x40); //发送一帧数据(一个字节,8个数据位)
  30. }
  31. }