File tree Expand file tree Collapse file tree 6 files changed +49
-0
lines changed
arch/arm/soc/st_stm32/stm32f0
boards/arm/stm32f072b_disco Expand file tree Collapse file tree 6 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 3636#define CONFIG_SPI_2_NAME ST_STM32_SPI_FIFO_40003800_LABEL
3737#define CONFIG_SPI_2_IRQ ST_STM32_SPI_FIFO_40003800_IRQ_0
3838
39+ #define CONFIG_CAN_1_BASE_ADDRESS ST_STM32_CAN_40006400_BASE_ADDRESS
40+ #define CONFIG_CAN_1_BUS_SPEED ST_STM32_CAN_40006400_BUS_SPEED
41+ #define CONFIG_CAN_1_NAME ST_STM32_CAN_40006400_LABEL
42+ #define CONFIG_CAN_1_IRQ ST_STM32_CAN_40006400_IRQ_0
43+ #define CONFIG_CAN_1_IRQ_PRIORITY ST_STM32_CAN_40006400_IRQ_0_PRIORITY
44+
3945#define FLASH_DEV_BASE_ADDRESS ST_STM32F0_FLASH_CONTROLLER_40022000_BASE_ADDRESS
4046#define FLASH_DEV_NAME ST_STM32F0_FLASH_CONTROLLER_40022000_LABEL
4147
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ static const struct pin_config pinconf[] = {
3232 {STM32_PIN_PB4 , STM32F0_PINMUX_FUNC_PB4_SPI1_MISO },
3333 {STM32_PIN_PB5 , STM32F0_PINMUX_FUNC_PB5_SPI1_MOSI },
3434#endif /* CONFIG_SPI_1 */
35+ #ifdef CONFIG_CAN_1
36+ {STM32_PIN_PB8 , STM32F0_PINMUX_FUNC_PB8_CAN_RX },
37+ {STM32_PIN_PB9 , STM32F0_PINMUX_FUNC_PB9_CAN_TX },
38+ #endif /* CONFIG_CAN_1 */
39+
3540};
3641
3742static int pinmux_stm32_init (struct device * port )
Original file line number Diff line number Diff line change 7474&spi1 {
7575 status = "ok";
7676};
77+
78+ &can1 {
79+ pinctrl-0 = <&can_pins_a>;
80+ pinctrl-names = "default";
81+ bus-speed = <250000>;
82+ status = "ok";
83+ };
Original file line number Diff line number Diff line change 8888#define STM32F0_PINMUX_FUNC_PC3_SPI2_MOSI \
8989 (STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)
9090
91+ #define STM32F0_PINMUX_FUNC_PB8_CAN_RX \
92+ (STM32_PINMUX_ALT_FUNC_4 | STM32_PUSHPULL_NOPULL)
93+ #define STM32F0_PINMUX_FUNC_PB9_CAN_TX \
94+ (STM32_PINMUX_ALT_FUNC_4 | STM32_PUSHPULL_NOPULL)
95+ #define STM32F0_PINMUX_FUNC_PD0_CAN_RX \
96+ (STM32_PINMUX_ALT_FUNC_0 | STM32_PUPDR_PULL_UP)
97+ #define STM32F0_PINMUX_FUNC_PD1_CAN_TX \
98+ (STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)
99+
91100#endif /* _STM32F0_PINMUX_H_ */
Original file line number Diff line number Diff line change 3939 tx = <STM32_PIN_PD5 (STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)>;
4040 };
4141 };
42+ can_pins_a: can@0 {
43+ rx_tx {
44+ rx = <STM32_PIN_PB8 (STM32_PINMUX_ALT_FUNC_4 | STM32_PUPDR_PULL_UP)>;
45+ tx = <STM32_PIN_PB9 (STM32_PINMUX_ALT_FUNC_4 | STM32_PUPDR_NO_PULL)>;
46+ };
47+ };
48+ can_pins_b: can@1 {
49+ rx_tx {
50+ rx = <STM32_PIN_PD0 (STM32_PINMUX_ALT_FUNC_0 | STM32_PUPDR_PULL_UP)>;
51+ tx = <STM32_PIN_PD1 (STM32_PINMUX_ALT_FUNC_0 | STM32_PUPDR_NO_PULL)>;
52+ };
53+ };
4254 };
4355 };
4456};
Original file line number Diff line number Diff line change 4242 status = "disabled";
4343 label= "USB";
4444 };
45+
46+ can1: can@40006400 {
47+ compatible = "st,stm32-can";
48+ #address-cells = <1>;
49+ #size-cells = <0>;
50+ reg = <0x40006400 0x400>;
51+ interrupts = <30 0>;
52+ status = "disabled";
53+ label = "CAN_1";
54+ };
4555 };
4656};
You can’t perform that action at this time.
0 commit comments