Dimitar Marinov
/
Nucleo_4_encoders_w_Nokia5110
4 Rotary encoders with 5110 LCD display. For Nucleo boards
Diff: Encoder/EncoderMspInitF4.cpp
- Revision:
- 10:65e7ceb96b39
- Parent:
- 7:62c2c1382d86
--- a/Encoder/EncoderMspInitF4.cpp Sun Oct 23 18:44:15 2016 +0000 +++ b/Encoder/EncoderMspInitF4.cpp Mon Oct 24 17:21:58 2016 +0000 @@ -72,5 +72,15 @@ GPIO_InitStruct.Alternate = GPIO_AF2_TIM4; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); } + else if (htim->Instance == TIM5) { // PA2 PA3 + __TIM5_CLK_ENABLE(); + __GPIOA_CLK_ENABLE(); + GPIO_InitStruct.Pin = GPIO_PIN_2 | GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLDOWN; + GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF2_TIM5; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + } } -#endif \ No newline at end of file +#endif