123456789101112131415161718 |
- #include "stm32l0xx_hal.h"
- #include "io.h"
- //
- void io_init(void)
- {
- GPIO_InitTypeDef GPIO_InitStruct;
-
- __HAL_RCC_GPIOA_CLK_ENABLE();
- // switch
- GPIO_InitStruct.Pin = GPIO_PIN_7;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- }
|