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 36
36
#define CONFIG_SPI_2_NAME ST_STM32_SPI_FIFO_40003800_LABEL
37
37
#define CONFIG_SPI_2_IRQ ST_STM32_SPI_FIFO_40003800_IRQ_0
38
38
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
+
39
45
#define FLASH_DEV_BASE_ADDRESS ST_STM32F0_FLASH_CONTROLLER_40022000_BASE_ADDRESS
40
46
#define FLASH_DEV_NAME ST_STM32F0_FLASH_CONTROLLER_40022000_LABEL
41
47
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ static const struct pin_config pinconf[] = {
32
32
{STM32_PIN_PB4 , STM32F0_PINMUX_FUNC_PB4_SPI1_MISO },
33
33
{STM32_PIN_PB5 , STM32F0_PINMUX_FUNC_PB5_SPI1_MOSI },
34
34
#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
+
35
40
};
36
41
37
42
static int pinmux_stm32_init (struct device * port )
Original file line number Diff line number Diff line change 74
74
&spi1 {
75
75
status = "ok";
76
76
};
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 88
88
#define STM32F0_PINMUX_FUNC_PC3_SPI2_MOSI \
89
89
(STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)
90
90
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
+
91
100
#endif /* _STM32F0_PINMUX_H_ */
Original file line number Diff line number Diff line change 39
39
tx = <STM32_PIN_PD5 (STM32_PINMUX_ALT_FUNC_0 | STM32_PUSHPULL_NOPULL)>;
40
40
};
41
41
};
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
+ };
42
54
};
43
55
};
44
56
};
Original file line number Diff line number Diff line change 42
42
status = "disabled";
43
43
label= "USB";
44
44
};
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
+ };
45
55
};
46
56
};
You can’t perform that action at this time.
0 commit comments