GPIOA.c 792 B

12345678910111213141516171819202122232425262728293031
  1. #include "stm32f10x.h" // Device header
  2. #include "CONFIG.h"
  3. #include "AT.h"
  4. void GPIOA_Init(void)
  5. {
  6. RCC_APB2PeriphClockCmd(WAKE_GPIO_RCC, ENABLE);
  7. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  8. GPIO_InitTypeDef GPIO_InitStructure;
  9. #if _4GFLAG
  10. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  11. GPIO_InitStructure.GPIO_Pin = WAKE_GPIO_Pin;
  12. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  13. GPIO_Init(WAKE_GPIO, &GPIO_InitStructure);
  14. GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin); // 4GÀ­¸ß
  15. #endif
  16. #if NBFLAG
  17. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
  18. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  19. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  20. GPIO_Init(GPIOA, &GPIO_InitStructure);
  21. GPIO_ResetBits(GPIOA, GPIO_Pin_7); // nbÀ­µÍ
  22. #endif
  23. }