nuttx/Documentation/components/drivers/character
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
..
analog docs/ads1115: Add trigger commands to documentation 2025-07-14 10:22:33 -04:00
crypto Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
input drivers/input: Create Single Button Multi Actions 2025-07-15 18:39:59 -03:00
leds drivers/leds: Add support for KTD2052 2025-07-07 09:49:51 -03:00
motor drivers/foc: add support for FOC power-stage driver 2023-11-18 17:07:20 -08:00
timers docs(h743zi/capture): add capture driver docs 2025-08-14 20:46:37 +08:00
wireless style: fix typos 2025-04-30 13:45:46 +08:00
1wire.rst 1wire DS2XXX: add 1wire and DS2XXX documentation 2025-10-11 07:39:01 -03:00
bch.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
can.rst nuttx/can: add message alignment 2025-11-24 14:11:41 +08:00
contactless.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
eeprom.rst drivers/eeprom: Retrieve the geometry 2025-11-13 08:57:52 -03:00
efuse.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
gpio.rst documentation: add GPIO character device driver entry 2025-11-22 14:12:19 -05:00
i2s.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
index.rst documentation: add GPIO character device driver entry 2025-11-22 14:12:19 -05:00
ipcc.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
loop.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
math.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
modem.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
note.rst style: fix typos 2025-04-30 13:45:46 +08:00
nullzero.rst Documentation: cosmetics changes 2023-10-26 20:01:21 +08:00
quadrature.rst style: fix typos 2025-04-30 13:45:46 +08:00
rc.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
rf.rst Documentation: add dummy pages for missing filesystems and drivers 2023-10-27 13:21:40 -03:00
serial.rst serial: Add struct serial_icounter_s and CONFIG_SERIAL_TIOCGICOUNT 2025-02-14 18:24:47 +01:00
touchscreen.rst drivers/touchscreen: add grab for touchscreen 2024-08-08 18:30:32 +08:00