mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
Documentation: update Lely CANopen doc
update Lely CANopen doc Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
9f69e1c0e9
commit
418c80c633
3 changed files with 126 additions and 0 deletions
|
|
@ -1,3 +1,46 @@
|
|||
=====================================
|
||||
``lely-canopen`` Lely CANopen support
|
||||
=====================================
|
||||
|
||||
`Lely CANopen <https://gitlab.com/lely_industries/lely-core>`_ is an
|
||||
open-source CANopen (CiA 301/302/305/315) protocol stack.
|
||||
|
||||
The port configuration (``LELY_NO_*`` feature switches) is generated
|
||||
from Kconfig in ``apps/include/canutils/lely/config.h``.
|
||||
|
||||
Feature selection
|
||||
=================
|
||||
|
||||
``CONFIG_CANUTILS_LELYCANOPEN`` enables the build. The individual CANopen
|
||||
services are selected with the ``CONFIG_CANUTILS_LELYCANOPEN_*`` options,
|
||||
including:
|
||||
|
||||
- ``SDEV`` – static device description support (selects ``OBJNAME``)
|
||||
- ``MASTER`` – NMT master support
|
||||
- ``EMCY`` – emergency (EMCY) objects
|
||||
- ``CSDO`` / ``SSDO`` – client / server SDO
|
||||
- ``RPDO`` / ``TPDO`` / ``MPDO`` – process data objects
|
||||
- ``SYNC`` / ``TIME`` – SYNC and TIME producers/consumers
|
||||
- ``LSS`` – layer setting services
|
||||
- ``NG`` / ``NMTBOOT`` / ``NMTCFG`` – node guarding and master boot/config
|
||||
- ``OBJDEFAULT`` / ``OBJLIMITS`` / ``OBJNAME`` / ``OBJUPLOAD`` /
|
||||
``OBJFILE`` – object dictionary features
|
||||
|
||||
Tools
|
||||
=====
|
||||
|
||||
``CONFIG_CANUTILS_LELYCANOPEN_TOOLS_COCTL`` builds ``coctl``, the Lely
|
||||
CANopen control tool (an interactive ASCII gateway). It requires SocketCAN
|
||||
(``NET_CAN``).
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
Two ready-to-run demos built on this library are provided:
|
||||
|
||||
- :doc:`/applications/examples/lely_slave/index` – a CANopen slave node
|
||||
- :doc:`/applications/examples/lely_master/index` – a CANopen master node
|
||||
|
||||
Both can run on the simulator over the CAN character driver. See
|
||||
:ref:`testing_lely_canopen_sim` for how to set up a virtual CAN network and
|
||||
observe the traffic.
|
||||
|
|
|
|||
44
Documentation/applications/examples/lely_master/index.rst
Normal file
44
Documentation/applications/examples/lely_master/index.rst
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
===========================================
|
||||
``lely_master`` Lely CANopen master example
|
||||
===========================================
|
||||
|
||||
A minimal CANopen **master** node built on the `Lely CANopen
|
||||
<https://gitlab.com/lely_industries/lely-core>`_ stack (see
|
||||
:doc:`/applications/canutils/lely-canopen/index`).
|
||||
|
||||
The node is described by a static device description
|
||||
(``sdev_master.c``, node-ID ``0x01``) and talks to the CAN bus through the
|
||||
NuttX **CAN character driver** (``/dev/can0``) by default, or through
|
||||
SocketCAN when the ``CONFIG_EXAMPLES_LELYMASTER_SOCKET`` backend is selected.
|
||||
|
||||
It registers the ``comaster`` NSH built-in command.
|
||||
|
||||
Once the slave has booted, the master drives a small CANopen network:
|
||||
|
||||
#. reads the slave's device type (object ``0x1000``) with a Client-SDO
|
||||
upload;
|
||||
#. commands the slave to OPERATIONAL with an NMT start;
|
||||
#. produces SYNC (object ``0x1005``/``0x1006``) and receives the slave's
|
||||
synchronous TPDO through an RPDO (object ``0x1400``/``0x1600``), printing
|
||||
the streamed counter that lands in object ``0x2100``.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
``CONFIG_EXAMPLES_LELYMASTER``
|
||||
Enable the example. Requires ``CANUTILS_LELYCANOPEN`` with ``SDEV``,
|
||||
``TIME``, ``OBJUPLOAD`` and ``MASTER`` support (the master services also
|
||||
pull in ``EMCY``, ``CSDO``, ``RPDO``, ``TPDO`` and ``SYNC``).
|
||||
|
||||
``CONFIG_EXAMPLES_LELYMASTER_CHARDEV`` / ``CONFIG_EXAMPLES_LELYMASTER_SOCKET``
|
||||
CAN backend selection (character driver or SocketCAN).
|
||||
|
||||
``CONFIG_EXAMPLES_LELYMASTER_DEVPATH``
|
||||
CAN character device path (default ``/dev/can0``).
|
||||
|
||||
``CONFIG_EXAMPLES_LELYMASTER_INTF``
|
||||
SocketCAN interface name (default ``can0``).
|
||||
|
||||
The ready-made ``sim:lely`` configuration builds this example together with
|
||||
the :doc:`/applications/examples/lely_slave/index` demo for the simulator
|
||||
with the CAN character driver enabled.
|
||||
39
Documentation/applications/examples/lely_slave/index.rst
Normal file
39
Documentation/applications/examples/lely_slave/index.rst
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
=========================================
|
||||
``lely_slave`` Lely CANopen slave example
|
||||
=========================================
|
||||
|
||||
A minimal CANopen **slave** node built on the `Lely CANopen
|
||||
<https://gitlab.com/lely_industries/lely-core>`_ stack (see
|
||||
:doc:`/applications/canutils/lely-canopen/index`).
|
||||
|
||||
The node is described by a static device description
|
||||
(``sdev_slave.c``, node-ID ``0x02``) and talks to the CAN bus through the
|
||||
NuttX **CAN character driver** (``/dev/can0``) by default, or through
|
||||
SocketCAN when the ``CONFIG_EXAMPLES_LELYSLAVE_SOCKET`` backend is selected.
|
||||
|
||||
It registers the ``coslave`` NSH built-in command.
|
||||
|
||||
The slave answers the master's Client-SDO requests through its default
|
||||
Server-SDO and, once the master has brought it to OPERATIONAL, streams an
|
||||
incrementing counter (object ``0x2100``) in a synchronous TPDO (object
|
||||
``0x1800``/``0x1a00``) on every SYNC.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
``CONFIG_EXAMPLES_LELYSLAVE``
|
||||
Enable the example. Requires ``CANUTILS_LELYCANOPEN`` with ``SDEV``,
|
||||
``TIME`` and ``OBJUPLOAD`` support.
|
||||
|
||||
``CONFIG_EXAMPLES_LELYSLAVE_CHARDEV`` / ``CONFIG_EXAMPLES_LELYSLAVE_SOCKET``
|
||||
CAN backend selection (character driver or SocketCAN).
|
||||
|
||||
``CONFIG_EXAMPLES_LELYSLAVE_DEVPATH``
|
||||
CAN character device path (default ``/dev/can0``).
|
||||
|
||||
``CONFIG_EXAMPLES_LELYSLAVE_INTF``
|
||||
SocketCAN interface name (default ``can0``).
|
||||
|
||||
The ready-made ``sim:lely`` configuration builds this example together with
|
||||
the :doc:`/applications/examples/lely_master/index` demo for the simulator
|
||||
with the CAN character driver enabled.
|
||||
Loading…
Add table
Add a link
Reference in a new issue