A program to monitor some parameters for a motor
Dependencies: mbed-dev BufferSerial
Thanks to David Lowe for https://developer.mbed.org/users/gregeric/code/Nucleo_Hello_Encoder/ which I adapted for the use of TIM2 32bit timer as an encoder reader on the Nucleo L432KC board.
Diff: Encoder/EncoderMspInitL4.cpp
- Revision:
- 2:958e9094b198
- Parent:
- 1:a611582bffa7
diff -r a611582bffa7 -r 958e9094b198 Encoder/EncoderMspInitL4.cpp --- a/Encoder/EncoderMspInitL4.cpp Wed Mar 08 21:37:30 2017 +0000 +++ b/Encoder/EncoderMspInitL4.cpp Sat Mar 11 22:56:39 2017 +0000 @@ -17,12 +17,12 @@ * TIM2_CH2: AF1 @ PA1, PB3 * */ - + #ifdef TARGET_STM32L4 void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim) { GPIO_InitTypeDef GPIO_InitStruct; - + if (htim->Instance == TIM1) { //PA8 PA9 = Nucleo D9 D1 __TIM1_CLK_ENABLE(); __GPIOA_CLK_ENABLE();