+ tim->ccer = ((0 << STM_TIM234_CCER_CC1E) |
+ (0 << STM_TIM234_CCER_CC1P) |
+ (0 << STM_TIM234_CCER_CC1NP) |
+ (1 << STM_TIM234_CCER_CC2E) |
+ (1 << STM_TIM234_CCER_CC2P) |
+ (1 << STM_TIM234_CCER_CC2NP) |
+ (0 << STM_TIM234_CCER_CC3E) |
+ (0 << STM_TIM234_CCER_CC3P) |
+ (0 << STM_TIM234_CCER_CC3NP) |
+ (0 << STM_TIM234_CCER_CC4E) |
+ (0 << STM_TIM234_CCER_CC4P) |
+ (0 << STM_TIM234_CCER_CC4NP));
+
+ /* Enable event generation on channel 2 */
+
+ tim->egr = ((0 << STM_TIM234_EGR_TG) |
+ (0 << STM_TIM234_EGR_CC4G) |
+ (0 << STM_TIM234_EGR_CC3G) |
+ (1 << STM_TIM234_EGR_CC2G) |
+ (0 << STM_TIM234_EGR_CC1G) |
+ (0 << STM_TIM234_EGR_UG));
+ /* Start the timer */
+ tim->cr1 |= (1 << STM_TIM234_CR1_CEN);
+