GPIOA.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "stm32f10x.h" // Device header
  2. #include "CONFIG.h"
  3. void GPIOA_Init(void)
  4. {
  5. #if EC800M
  6. RCC_APB2PeriphClockCmd(WAKE_GPIO_RCC, ENABLE);
  7. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  8. GPIO_InitTypeDef GPIO_InitStructure;
  9. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  10. GPIO_InitStructure.GPIO_Pin = WAKE_GPIO_Pin;
  11. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  12. GPIO_Init(WAKE_GPIO, &GPIO_InitStructure);
  13. GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin); // 4G拉高
  14. #endif
  15. #if BC260Y
  16. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  17. GPIO_InitTypeDef GPIO_InitStructure;
  18. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
  19. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  20. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  21. GPIO_Init(GPIOA, &GPIO_InitStructure);
  22. GPIO_ResetBits(GPIOA, GPIO_Pin_7); // nb拉低
  23. #endif
  24. #if ESP32
  25. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  26. GPIO_InitTypeDef GPIO_InitStructure;
  27. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  28. GPIO_InitStructure.GPIO_Pin = WAKE_GPIO_Pin;
  29. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  30. GPIO_Init(WAKE_GPIO, &GPIO_InitStructure);
  31. GPIO_ResetBits(WAKE_GPIO, WAKE_GPIO_Pin); // WiFi深休眠引脚拉低
  32. #endif
  33. }