Guest User

periph_conf.h

a guest
Apr 1st, 2015
210
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /**
  3. * @name PWM configuration
  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 // Ardumoto shield (PWMA 3)
  21. #define PWM_0_PIN_AF 3 // Don't know (stm32L152RE pin link to ardumoto pin PWMA ? )
  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 // Ardumoto shield (PWMB 11)
  33. #define PWM_1_PIN_AF 11 // Don't know (stm32L152RE pin link to ardumoto pin PWMB ? )
RAW Paste Data