Skip to content

Commit

Permalink
Merge pull request #20845 from thingsat/pr/add_can_to_board_nucleo-l4…
Browse files Browse the repository at this point in the history
…32kc

boards/nucleo-l432kc: enable CAN support
  • Loading branch information
benpicco authored Oct 7, 2024
2 parents 89d3370 + 84ec09f commit 0e20bfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/nucleo-l432kc/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CPU = stm32
CPU_MODEL = stm32l432kc

# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_can
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
Expand Down
7 changes: 7 additions & 0 deletions cpu/stm32/include/can_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ static const can_conf_t candev_conf[] = {
.rx_pin = GPIO_PIN(PORT_A, 11),
.tx_pin = GPIO_PIN(PORT_A, 12),
#elif defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F4)

#if defined(CPU_MODEL_STM32L432KC)
.rx_pin = GPIO_PIN(PORT_A, 11),
.tx_pin = GPIO_PIN(PORT_A, 12),
.af = GPIO_AF9,
#else
.rx_pin = GPIO_PIN(PORT_B, 8),
.tx_pin = GPIO_PIN(PORT_B, 9),
.af = GPIO_AF9,
#endif
#else
.rx_pin = GPIO_PIN(PORT_D, 0),
.tx_pin = GPIO_PIN(PORT_D, 1),
Expand Down

0 comments on commit 0e20bfd

Please sign in to comment.