Skip to content

Commit

Permalink
boards: nxp/frdm_mcxn236: Support Flexcan for NXP frdm_mcxa156 board
Browse files Browse the repository at this point in the history
Support Flexcan for NXP frdm_mcxa156 board

Signed-off-by: Neil Chen <[email protected]>
  • Loading branch information
NeilChen93 authored and kartben committed Jan 7, 2025
1 parent 0004a3f commit fd1826e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boards/nxp/frdm_mcxa156/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ static int frdm_mcxa156_init(void)
CLOCK_EnableClock(kCLOCK_GateDAC0);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(flexcan0))
CLOCK_SetClockDiv(kCLOCK_DivFLEXCAN0, 1U);
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF_DIV, 1U);
CLOCK_AttachClk(kFRO_HF_DIV_to_FLEXCAN0);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpadc0))
CLOCK_SetClockDiv(kCLOCK_DivADC0, 1u);
CLOCK_AttachClk(kFRO12M_to_ADC0);
Expand Down
2 changes: 2 additions & 0 deletions boards/nxp/frdm_mcxa156/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+
| DAC | on-chip | dac |
+-----------+------------+-------------------------------------+
| FLEXCAN | on-chip | CAN |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| LPCMP | on-chip | sensor(comparator) |
Expand Down
9 changes: 9 additions & 0 deletions boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
slew-rate = "fast";
};
};
pinmux_flexcan0: pinmux_flexcan0 {
group0 {
pinmux = <CAN0_TXD_P1_13>,
<CAN0_RXD_P1_12>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
};
};
pinmux_flexpwm0_pwm0: pinmux_flexpwm0_pwm0 {
group0 {
pinmux = <PWM0_A0_P3_6>,
Expand Down
7 changes: 7 additions & 0 deletions boards/nxp/frdm_mcxa156/frdm_mcxa156.dts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
zephyr,console = &lpuart0;
zephyr,shell-uart = &lpuart0;
zephyr,uart-mcumgr = &lpuart0;
zephyr,canbus = &flexcan0;
};

leds {
Expand Down Expand Up @@ -103,6 +104,12 @@
pinctrl-names = "default";
};

&flexcan0 {
status = "okay";
pinctrl-0 = <&pinmux_flexcan0>;
pinctrl-names = "default";
};

&flexpwm0_pwm0 {
status = "okay";
pinctrl-0 = <&pinmux_flexpwm0_pwm0>;
Expand Down
1 change: 1 addition & 0 deletions boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- adc
- flash
- gpio
- can
- counter
- dac
- i2c
Expand Down

0 comments on commit fd1826e

Please sign in to comment.