Skip to content

Commit

Permalink
boards/common/blxxxpill: change PWM and QDEC configuration
Browse files Browse the repository at this point in the history
- Use pins PB0, PB1, PB4, and PB5 for PWM instead PA8, PA9, PA10, and
  PA11
    - PA9 and PA10 is in pin conflict with UART_DEV(0) which is used
      for stdio with stdio_uart, PA8 was in conflict with QDEC_DEV(0),
      PA11 was in conflict with USB D-
- Use PB6, PB7 as QDEC_DEV(0) (previously QDEC_DEV(2)), as this is the
  only completely conflict free setting
- Use PB4/PB5 instead of PA6/PA7 for QDEC_DEV(1)
    - This fixes a pin conflict with SPI_DEV(0) MISO (and ADC_LINE(4))
  • Loading branch information
maribu committed Oct 21, 2022
1 parent 7e61e83 commit ac9f595
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions boards/common/blxxxpill/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,32 +135,32 @@ static const timer_conf_t timer_config[] = {

static const qdec_conf_t qdec_config[] = {
{
.dev = TIM1,
.dev = TIM4,
.max = 0x0000ffff,
.rcc_mask = RCC_APB2ENR_TIM1EN,
.chan = { { .pin = GPIO_PIN(PORT_A, 8), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 9), .cc_chan = 1 } },
.bus = APB2,
.irqn = TIM1_UP_IRQn
.rcc_mask = RCC_APB1ENR_TIM4EN,
.chan = { { .pin = GPIO_PIN(PORT_B, 6), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_B, 7), .cc_chan = 1 } },
.bus = APB1,
.irqn = TIM4_IRQn
},
{
.dev = TIM3,
.max = 0x0000ffff,
.rcc_mask = RCC_APB1ENR_TIM3EN,
.chan = { { .pin = GPIO_PIN(PORT_A, 6), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 7), .cc_chan = 1 } },
.chan = { { .pin = GPIO_PIN(PORT_B, 4), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_B, 5), .cc_chan = 1 } },
.bus = APB1,
.irqn = TIM3_IRQn
},
{
.dev = TIM4,
.dev = TIM1,
.max = 0x0000ffff,
.rcc_mask = RCC_APB1ENR_TIM4EN,
.chan = { { .pin = GPIO_PIN(PORT_B, 6), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_B, 7), .cc_chan = 1 } },
.bus = APB1,
.irqn = TIM4_IRQn
}
.rcc_mask = RCC_APB2ENR_TIM1EN,
.chan = { { .pin = GPIO_PIN(PORT_A, 8), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 9), .cc_chan = 1 } },
.bus = APB2,
.irqn = TIM1_UP_IRQn
},
};

#define QDEC_NUMOF ARRAY_SIZE(qdec_config)
Expand Down Expand Up @@ -256,15 +256,15 @@ static const i2c_conf_t i2c_config[] = {
*/
static const pwm_conf_t pwm_config[] = {
{
.dev = TIM1,
.rcc_mask = RCC_APB2ENR_TIM1EN,
.chan = { { .pin = GPIO_PIN(PORT_A, 8), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_A, 9), .cc_chan = 1 },
{ .pin = GPIO_PIN(PORT_A, 10), .cc_chan = 2 },
{ .pin = GPIO_PIN(PORT_A, 11), .cc_chan = 3 } },
.dev = TIM3,
.rcc_mask = RCC_APB1ENR_TIM3EN,
.chan = { { .pin = GPIO_PIN(PORT_B, 0), .cc_chan = 2 },
{ .pin = GPIO_PIN(PORT_B, 1), .cc_chan = 3 },
{ .pin = GPIO_PIN(PORT_B, 4), .cc_chan = 0 },
{ .pin = GPIO_PIN(PORT_B, 5), .cc_chan = 1 } },
.af = GPIO_AF_OUT_PP,
.bus = APB2
}
.bus = APB1
},
};

#define PWM_NUMOF ARRAY_SIZE(pwm_config)
Expand Down

0 comments on commit ac9f595

Please sign in to comment.