Skip to content

Commit

Permalink
app: boards: add support for the candlelightFD board
Browse files Browse the repository at this point in the history
Add support for the candlelightFD board from Linux Automation.

The board optionally supports a second CAN channel, but only provides two
LEDs (RX/TX) in total. To work around this limitation, the "dual"
configuration uses the RX LED for channel 0 state/activity, and the TX LED
for channel 1 state/activity.

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen committed Dec 25, 2024
1 parent c9ca536 commit 68ccfc9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
37 changes: 37 additions & 0 deletions app/boards/candlelightfd_stm32g0b1xx.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
cannectivity: cannectivity {
compatible = "cannectivity";
timestamp-counter = <&counter2>;

channel0 {
compatible = "cannectivity-channel";
can-controller = <&fdcan1>;
activity-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>,
<&gpioa 4 GPIO_ACTIVE_LOW>;
};
};
};

&zephyr_udc0 {
gs_usb0: gs_usb0 {
compatible = "gs_usb";
};
};

&timers2 {
status = "okay";
st,prescaler = <59>;

counter2: counter2 {
compatible = "st,stm32-counter";
status = "okay";
};
};
44 changes: 44 additions & 0 deletions app/boards/candlelightfd_stm32g0b1xx_dual.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
cannectivity: cannectivity {
compatible = "cannectivity";
timestamp-counter = <&counter2>;

channel0 {
compatible = "cannectivity-channel";
can-controller = <&fdcan1>;
/* Use RX LED for channel 0 state + activity */
state-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>;
};

channel1 {
compatible = "cannectivity-channel";
can-controller = <&fdcan2>;
/* Use TX LED for channel 0 state + activity */
state-gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
};
};
};

&zephyr_udc0 {
gs_usb0: gs_usb0 {
compatible = "gs_usb";
};
};

&timers2 {
status = "okay";
st,prescaler = <59>;

counter2: counter2 {
compatible = "st,stm32-counter";
status = "okay";
};
};

0 comments on commit 68ccfc9

Please sign in to comment.