Skip to content

Commit

Permalink
boards/msbiot: Add PWM config to MSB-IoT
Browse files Browse the repository at this point in the history
  • Loading branch information
fnack committed Jan 22, 2015
1 parent 870a695 commit c1cc08a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boards/msbiot/Makefile.features
@@ -1,3 +1,3 @@
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_uart periph_gpio periph_spi
FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_pwm
FEATURES_PROVIDED += transceiver
20 changes: 20 additions & 0 deletions boards/msbiot/include/periph_conf.h
Expand Up @@ -70,6 +70,26 @@ extern "C" {
#define TIMER_1_IRQ_CHAN TIM5_IRQn
/** @} */

/**
* @name PWM configuration
* @{
*/
#define PWM_NUMOF (1U)
#define PWM_0_EN 1
#define PWM_MAX_CHANNELS 1 /* Increase if Timer with more channels is used */

/* PWM 0 device configuration */
#define PWM_0_DEV TIM11
#define PWM_0_CHANNELS 1
#define PWM_0_CLK (168000000U)
#define PWM_0_CLKEN() (RCC->APB2ENR |= RCC_APB2ENR_TIM11EN)
#define PWM_0_CLKDIS() (RCC->APB2ENR &= ~RCC_APB2ENR_TIM11EN)
/* PWM 0 pin configuration */
#define PWM_0_PORT GPIOB
#define PWM_0_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN)
#define PWM_0_PIN_CH0 9
#define PWM_0_PIN_AF 3
/** @} */

/**
* @name UART configuration
Expand Down

0 comments on commit c1cc08a

Please sign in to comment.