-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shields: Add CAN-FD mcp2518fd shield
Adds click shield for the Microchip MCP2518FD CAN-FD controller. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config MCP2518FD_CLICK | ||
def_bool $(shields_list_contains,mcp2518fd_click) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _mcp2518fd_click_shield: | ||
|
||
Microchip MCP2518FD Click shield (CAN FD) | ||
######################################### | ||
|
||
Overview | ||
-------- | ||
|
||
MCP2518FD Click shield has a MCP2518FD CAN FD controler via an SPI | ||
interface and a high-speed ATA6563 CAN transceiver. | ||
|
||
More information about the shield can be found at | ||
`MCP2518FD click`_. | ||
|
||
Requirements | ||
************ | ||
|
||
The shield uses a mikroBUS interface. The target board must define | ||
a mikrobus_spi node label (see :ref:`shields` for more details). | ||
|
||
Programming | ||
*********** | ||
|
||
Set ``-DSHIELD=mcp2518fd_click`` when you invoke ``west build``. | ||
In the example below, the target board does not have a mikroBUS | ||
interface. Instead it uses :ref:`arduino_uno_click` shield map the | ||
Arduino UNO R3 headers to a mikroBUS interface. | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/drivers/can/counter | ||
:board: xmc47_relax_kit | ||
:shield: "arduino_uno_click mcp2518fd_click" | ||
:goals: build flash | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: | ||
|
||
.. _MCP2518FD click: | ||
https://www.mikroe.com/mcp2518fd-click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
&mikrobus_spi { | ||
cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>; | ||
mcp2518fd: canfd@0 { | ||
compatible = "microchip,mcp25xxfd"; | ||
status = "okay"; | ||
|
||
spi-max-frequency = <18000000>; | ||
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>; | ||
reg = <0x0>; | ||
osc-freq = <40000000>; | ||
bus-speed = <500000>; | ||
bus-speed-data = <2000000>; | ||
prop-seg = <0>; | ||
phase-seg1 = <15>; | ||
phase-seg2 = <4>; | ||
sjw = <4>; | ||
prop-seg-data = <0>; | ||
phase-seg1-data = <7>; | ||
phase-seg2-data = <2>; | ||
sjw-data = <2>; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zephyr,canbus = &mcp2518fd; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mikrobus_header: &mikrobus_header_1 {}; |