Skip to content

Commit

Permalink
boards: arm: ucans32k1sic: enable FlexCAN
Browse files Browse the repository at this point in the history
Enable FlexCAN peripheral driver for ucans32k1sic board. The GPIO-based
CAN transceiver driver is used to control the on-board CAN transceivers.

Signed-off-by: Manuel Argüelles <[email protected]>
  • Loading branch information
manuargue committed Jan 6, 2024
1 parent 21616b0 commit 57ea377
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boards/arm/ucans32k1sic/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ config UART_CONSOLE

endif # SERIAL

if CAN

config GPIO
default y

endif # CAN

endif # BOARD_UCANS32K1SIC
1 change: 1 addition & 0 deletions boards/arm/ucans32k1sic/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ LPUART on-chip serial
LPI2C on-chip i2c
LPSPI on-chip spi
FTM on-chip pwm
FlexCAN on-chip can
============ ========== ================================

The default configuration can be found in the Kconfig file
Expand Down
14 changes: 14 additions & 0 deletions boards/arm/ucans32k1sic/ucans32k1sic-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,18 @@
drive-strength = "low";
};
};

flexcan0_default: flexcan0_default {
group0 {
pinmux = <CAN0_RX_PTE4>, <CAN0_TX_PTE5>;
drive-strength = "low";
};
};

flexcan1_default: flexcan1_default {
group0 {
pinmux = <CAN1_RX_PTA12>, <CAN1_TX_PTA13>;
drive-strength = "low";
};
};
};
37 changes: 37 additions & 0 deletions boards/arm/ucans32k1sic/ucans32k1sic.dts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
zephyr,console = &lpuart1;
zephyr,shell-uart = &lpuart1;
zephyr,uart-pipe = &lpuart1;
zephyr,canbus = &flexcan0;
};

aliases {
Expand Down Expand Up @@ -81,6 +82,20 @@
zephyr,code = <INPUT_KEY_0>;
};
};

can_phy0: can-phy0 {
compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio";
enable-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
max-bitrate = <8000000>;
#phy-cells = <0>;
};

can_phy1: can-phy1 {
compatible = "nxp,tja1463", "nxp,tja1443", "nxp,tja1153", "can-transceiver-gpio";
enable-gpios = <&gpioe 2 GPIO_ACTIVE_HIGH>;
max-bitrate = <8000000>;
#phy-cells = <0>;
};
};

&gpioa {
Expand Down Expand Up @@ -154,3 +169,25 @@
#pwm-cells = <3>;
status = "okay";
};

&flexcan0 {
pinctrl-0 = <&flexcan0_default>;
pinctrl-names = "default";
phys = <&can_phy0>;
bus-speed = <125000>;
sample-point = <875>;
bus-speed-data = <1000000>;
sample-point-data = <875>;
status = "okay";
};

&flexcan1 {
pinctrl-0 = <&flexcan1_default>;
pinctrl-names = "default";
phys = <&can_phy1>;
bus-speed = <125000>;
sample-point = <875>;
bus-speed-data = <1000000>;
sample-point-data = <875>;
status = "okay";
};
1 change: 1 addition & 0 deletions boards/arm/ucans32k1sic/ucans32k1sic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ supported:
- i2c
- spi
- pwm
- can

0 comments on commit 57ea377

Please sign in to comment.