Advertisement
Guest User

Untitled

a guest
Apr 4th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. /**
  2. * @name PWM configuration
  3. * @{
  4. */
  5.  
  6. #define PWM_NUMOF (2U)
  7. #define PWM_0_EN 1
  8. #define PWM_1_EN 1
  9. #define PWM_MAX_CHANNELS 1
  10.  
  11. /* PWM 0 device configuration */
  12. #define PWM_0_DEV TIM2
  13. #define PWM_0_CHANNELS 1
  14. #define PWM_0_CLK (32000000U)
  15. #define PWM_0_CLKEN() (RCC->APB1ENR|= RCC_APB1ENR_TIM2EN)
  16. #define PWM_0_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN))
  17. /* PWM 0 pin configuration */
  18. #define PWM_0_PORT GPIOC
  19. #define PWM_0_PORT_CLKEN() (RCC->AHBENR |= RCC_AHBENR_GPIOCEN)
  20. #define PWM_0_PIN_CH0 3
  21. #define PWM_0_PIN_AF 1 //Pin PB_3
  22.  
  23. /* PWM 1 device configuration */
  24. #define PWM_1_DEV TIM3
  25. #define PWM_1_CHANNELS 1
  26. #define PWM_1_CLK (32000000U)
  27. #define PWM_1_CLKEN() (RCC->APB1ENR |= RCC_APB1ENR_TIM3EN)
  28. #define PWM_1_CLKDIS() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN))
  29. /* PWM 1 pin configuration */
  30. #define PWM_1_PORT GPIOD
  31. #define PWM_1_PORT_CLKEN() (RCC->AHBENR |= RCC_AHBENR_GPIODEN)
  32. #define PWM_1_PIN_CH0 11
  33. #define PWM_1_PIN_AF 2 //Pin PA_7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement