Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

28 Zeilen
830 B

  1. /*****************头文件*************************/
  2. #include "fsl_common.h"
  3. #include "fsl_port.h"
  4. #include "fsl_gpio.h"
  5. #include "pin_Init.h"
  6. /*****************GPIO初始化*************************/
  7. void pin_Init()
  8. {
  9. port_pin_config_t GPIO_Port_Init =
  10. {
  11. kPORT_PullUp , //上拉
  12. kPORT_FastSlewRate, //快速压摆率
  13. kPORT_PassiveFilterDisable, //无源滤波器
  14. kPORT_OpenDrainDisable, //推挽输出
  15. kPORT_LowDriveStrength, //低驱动力
  16. kPORT_MuxAsGpio, //普通GPIO模式
  17. kPORT_UnlockRegister, //
  18. };
  19. PORT_SetPinConfig(PORTA, 15U, &GPIO_Port_Init); //设置引脚复用方式
  20. gpio_pin_config_t config =
  21. {
  22. kGPIO_DigitalOutput, //输出模式
  23. 0,
  24. };
  25. GPIO_PinInit(GPIOA, 15U, &config); //初始化PTA15
  26. GPIO_PinWrite(GPIOA, 15, 1); //PTA15写1
  27. }