cpukit: add support for common CAN/CAN FD stack

This adds support for common full-featured CAN/CAN FD stack to RTEMS.
The API is provided in form the form of the POSIX character driver with
each CAN controller (chip) registered as node into “/dev”
namespace.

The stack utilizes FIFO queues (also called edges) organized
into oriented edges between controller side and application side.
Edges, responsible for message transfers from application to controller
and vice versa, can have different priorities and function as priority
classes.

The stack provides run time configuration options to create new
queues with desired priority, direction and filter, making it
suitable for various applications requirements. There is also a
possibility to configure controller’s characteristics (bit rate,
mode, chip specific ioctl calls). Both blocking and nonblocking mode
is supported.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
This commit is contained in:
Michal Lenc
2024-05-26 13:22:11 +02:00
committed by Gedare Bloom
parent cc4123136b
commit c3f4e215b1
19 changed files with 6119 additions and 0 deletions

View File

@@ -33,6 +33,10 @@ links:
uid: optboothartid
- role: build-dependency
uid: optbuildlabel
- role: build-dependency
uid: optcanfifosize
- role: build-dependency
uid: optcanqueueprios
- role: build-dependency
uid: optdebug
- role: build-dependency

View File

@@ -35,6 +35,18 @@ install:
- destination: ${BSP_INCLUDEDIR}/arpa
source:
- cpukit/include/arpa/ftp.h
- destination: ${BSP_INCLUDEDIR}/dev/can
source:
- cpukit/include/dev/can/can-bittiming.h
- cpukit/include/dev/can/can-bus.h
- cpukit/include/dev/can/can-devcommon.h
- cpukit/include/dev/can/can-filter.h
- cpukit/include/dev/can/can-frame.h
- cpukit/include/dev/can/can-helpers.h
- cpukit/include/dev/can/can-impl.h
- cpukit/include/dev/can/can-queue.h
- cpukit/include/dev/can/can-stats.h
- cpukit/include/dev/can/can.h
- destination: ${BSP_INCLUDEDIR}/dev/i2c
source:
- cpukit/include/dev/i2c/eeprom.h
@@ -531,6 +543,11 @@ source:
- cpukit/crc/crc24q.c
- cpukit/base64/base64-encode.c
- cpukit/base64/base64-decode.c
- cpukit/dev/can/can-bittiming.c
- cpukit/dev/can/can-bus.c
- cpukit/dev/can/can-devcommon.c
- cpukit/dev/can/can-quekern.c
- cpukit/dev/can/can-queue.c
- cpukit/dev/flash/flashdev.c
- cpukit/dev/i2c/eeprom.c
- cpukit/dev/i2c/fpga-i2c-slave.c

View File

@@ -0,0 +1,17 @@
SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR GPL-2.0-or-later
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2023-2024 Michal Lenc <michallenc@seznam.cz>
default:
- enabled-by: true
value: 64
description: |
Default size in CAN frames of FIFO queues.
enabled-by: true
format: '{}'
links: []
name: RTEMS_CAN_FIFO_SIZE
type: build

View File

@@ -0,0 +1,17 @@
SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0 OR GPL-2.0-or-later
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2023-2024 Michal Lenc <michallenc@seznam.cz>
default:
- enabled-by: true
value: 3
description: |
Number of available priorities for CAN priority queues.
enabled-by: true
format: '{}'
links: []
name: RTEMS_CAN_QUEUE_PRIO_NR
type: build