Skip to content

Commit

Permalink
shields: Add CAN-FD mcp2518fd click shield
Browse files Browse the repository at this point in the history
Adds click shield for the Microchip MCP2518FD CAN-FD controller.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
  • Loading branch information
talih0 committed Jul 4, 2023
1 parent 7fb5165 commit 9485385
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boards/shields/mcp2518fd_click/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023 Andriy Gelman
# SPDX-License-Identifier: Apache-2.0

config MCP2518FD_CLICK
def_bool $(shields_list_contains,mcp2518fd_click)
41 changes: 41 additions & 0 deletions boards/shields/mcp2518fd_click/doc/index.rst
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

Check warning on line 9 in boards/shields/mcp2518fd_click/doc/index.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TYPO_SPELLING

boards/shields/mcp2518fd_click/doc/index.rst:9 'controler' may be misspelled - perhaps 'controller'?
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: lpcxpresso55s28
:shield: mcp2518fd_click
:goals: build flash

References
**********

.. target-notes::

.. _MCP2518FD click:
https://www.mikroe.com/mcp2518fd-click
28 changes: 28 additions & 0 deletions boards/shields/mcp2518fd_click/mcp2518fd_click.overlay
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;
};
};

0 comments on commit 9485385

Please sign in to comment.