tests: drivers: can: api: add virtual CAN TX <-> RX Jumper
Remove the need for the can_transceiver fixture by assigning the CAN TX and CAN RX lines to the same GPIO pin to allow for testing without a transceiver or physical jumper. Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
This commit is contained in:
parent
2789e6a3c0
commit
1b919bbc28
2 changed files with 22 additions and 5 deletions
|
@ -10,9 +10,5 @@ tests:
|
|||
- drivers
|
||||
- can
|
||||
extra_args: DTC_OVERLAY_FILE=twai-enable.overlay
|
||||
harness: console
|
||||
harness_config:
|
||||
# actual CAN transceiver or shorted CAN RX/TX pins required for board testing
|
||||
fixture: can_transceiver
|
||||
filter: dt_compat_enabled("espressif,esp32-twai")
|
||||
platform_allow: esp32c3_devkitm
|
||||
|
|
|
@ -4,6 +4,27 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Enable CAN bus */
|
||||
&twai {
|
||||
status = "okay";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&twai_default>;
|
||||
pinctrl-names = "default";
|
||||
bus-speed = <125000>;
|
||||
|
||||
can-transceiver {
|
||||
max-bitrate = <1000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
twai_default: twai_default {
|
||||
group1 {
|
||||
pinmux = <TWAI_RX_GPIO5>;
|
||||
output-enable; /* enable internal loopback */
|
||||
};
|
||||
group2 {
|
||||
pinmux = <TWAI_TX_GPIO5>;
|
||||
input-enable; /* enable internal loopback */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue