nuttx/Documentation/components
Karel Kočí c61d7c7e8d nuttx/can: add message alignment
This adds ability for read and write operations to work with messages
aligned to configured number of bytes. This has few different use
cases.

The alignment is specified as unsigned integer and can be changed with
ioctl command CANIOC_SET_MSGALIGN. The current value can be queried by
CANIOC_GET_MSGALIGN command.

The default value for the message alignment is 1. This will provide
behavior consistent with current one. Thus messages are placed to the
buffer right after data of the previous one. The same applies for
writes.

The special alignment value 0 disables read and write of multiple frames. Thus
read will always return at most one message and write will always write
only one message even if larger buffer size is provided.

Another use case is if message alignment is set to exactly message
representation size (`sizeof(struct can_msg_s)`). This allows writing
and reading arrays of messages.

Other values provide even more advanced and specialized use cases, such
as optimizations if architecture has to emulate some non-aligned
accesses, there alignment of for example 4 bytes could provide
performance boost.

The original motivation behind this is was compatibility with socket
CAN. It is easier to port applications to NuttX's CAN driver if only one
frame is provided at the time. This solution was suggested by Pavel Pisa
<pisa@fel.cvut.cz> as a more versatile variant of plain boolean
disabling the multiple frame retrieval.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-24 14:11:41 +08:00
..
arch Documentation: update organization.rst 2023-10-30 20:29:54 +08:00
audio Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
drivers nuttx/can: add message alignment 2025-11-24 14:11:41 +08:00
filesystem docs/littlefs: Improve documentation about littelfs on NuttX 2025-08-08 02:09:18 +08:00
libs libc: Move stdio/README to Documentation/components/libs/libc/stream.rst 2025-06-22 17:07:41 -03:00
mm Documentation: remove readme references 2023-10-27 13:21:40 -03:00
net net/mdio: add mdio bus 2025-09-25 16:24:18 +08:00
nxgraphics video/fb: add FBIOGET_PANINFOCNT ioctl 2025-10-14 17:50:42 +08:00
tools Documentation/Make: add implementation/make_build_system.rst 2025-11-20 09:39:16 -05:00
binfmt.rst style: fix typos 2025-04-30 13:45:46 +08:00
boards.rst Documentation: update organization.rst 2023-10-30 20:29:54 +08:00
cmake.rst Documentation: initialize cmake doc 2023-10-27 13:21:40 -03:00
crypto.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
index.rst Documentation: move nxwidgets to applications as it is apps-side lib 2023-10-27 13:21:40 -03:00
nxflat.rst style: fix typos 2025-04-30 13:45:46 +08:00
openamp.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
paging.rst style: fix typos 2025-04-30 13:45:46 +08:00
syscall.rst Documentation: fix spelling 2025-05-15 11:33:41 +08:00
video.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
wireless.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00