nuttx/Documentation/guides
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
..
image Documentation: move debug pages to a separate top level page 2025-03-24 20:23:47 +08:00
porting-case-studies style: fix typos 2025-04-30 13:45:46 +08:00
armv7m_runtimestackcheck.rst Fix headings mark 2024-10-14 17:51:31 +08:00
automounter.rst Documentation: migrate "Auto-Mounter" from wiki 2023-11-06 18:42:17 -03:00
building_nuttx_with_app_out_of_src_tree.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
building_uclibcpp.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
changing_systemclockconfig.rst style: fix typos 2025-04-30 13:45:46 +08:00
citests.rst style: fix typos 2025-04-30 13:45:46 +08:00
cpp_cmake.rst Documentation/guides: Update CMake C++ guide 2025-09-15 15:30:15 -03:00
custom_app_directories.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
customapps.rst Doc: Fix CustomApps/CustomHello example 2024-07-20 13:17:48 +08:00
customboards.rst Corrected configure.sh call in customboards.rst 2025-04-29 15:30:28 -03:00
devicetree.rst fdt: add fdt description document 2024-09-30 14:20:49 +08:00
drivers.rst Documentation: various cosmetic changes 2023-10-30 20:29:54 +08:00
etcromfs.rst Documentation: update doc for etc romfs 2024-01-21 06:11:46 -08:00
fortify.rst Doc: Fortify Instructions 2025-01-23 15:36:14 +08:00
fully_linked_elf.rst docs: Update the ELF guides 2025-06-11 23:11:08 +08:00
include_files_board_h.rst Doc: Migrate including files in board.h 2024-10-15 01:22:59 +08:00
index.rst docs: Add Nix flake development environment guide 2025-07-26 20:55:29 +08:00
integrate_newlib.rst style: fix typos 2025-04-30 13:45:46 +08:00
ipv6.rst Doc: Migrate IPv6 2024-10-20 17:36:40 -03:00
kernel_threads_with_custom_stacks.rst Doc: Migrate Kernel Threads with Custom Stacks 2024-10-15 03:15:55 +08:00
logging_rambuffer.rst drivers/syslog: remove implement of syslog_putc() 2024-11-15 19:46:36 +08:00
multiple_nsh_sessions.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
nestedinterrupts.rst Documentation: Fix typos 2023-10-29 10:35:51 +08:00
nfs.rst documentation: correct the nfs command format 2023-07-03 10:18:00 -03:00
nix_flake.rst tools/nix: move nix flakes to tools/ 2025-08-28 10:04:01 +08:00
nsh_network_link_management.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
ofloader.rst Documentation: various cosmetic changes 2023-10-30 20:29:54 +08:00
optee.rst drivers/misc/optee: Expanded RPC support. 2025-08-06 02:29:33 +08:00
partially_linked_elf.rst docs: Update the ELF guides 2025-06-11 23:11:08 +08:00
platform_directories.rst style: fix typos 2025-04-30 13:45:46 +08:00
port.rst style: fix typos 2025-04-30 13:45:46 +08:00
port_bootsequence.rst Documentation/guides: add the guide:how to port. 2024-12-12 21:52:24 +08:00
port_drivers_to_stm32f7.rst Documentation: fix spelling 2025-05-15 11:33:41 +08:00
port_relatedkernelconfigrations.rst Documentation/guides: add the guide:how to port. 2024-12-12 21:52:24 +08:00
protected_build.rst Doc: Migrate NuttX Protected Build 2024-10-20 17:36:40 -03:00
pysimcoder.rst Documentation: fix spelling 2025-05-15 11:33:41 +08:00
ram_rom_disks.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
reading_can_msgs.rst nuttx/can: add message alignment 2025-11-24 14:11:41 +08:00
remove_device_drivers_nsh.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
renode.rst style: fix typos 2025-04-30 13:45:46 +08:00
rndis.rst style: fix typos 2025-04-30 13:45:46 +08:00
rust.rst docs: Add editor integration guide for Rust development in NuttX 2025-02-14 13:23:13 -03:00
semihosting.rst doc: Add semihost syslog guide instructions 2025-10-24 09:56:24 +08:00
signal_events_interrupt_handlers.rst Doc: Replace link from old wiki to new wiki in signaling events from int 2024-10-28 09:35:07 +08:00
signaling_sem_priority_inheritance.rst Doc: Migration Signaling Semaphores and priority inheritance 2024-10-28 09:35:07 +08:00
simulator.rst Doc: Remove MOTD string from nsh shell on simulator 2025-07-30 12:01:56 +08:00
smaller_vector_tables.rst Doc: Migrate Smaller Vector Tables 2024-10-28 09:35:07 +08:00
specialstuff_in_nuttxheaderfiles.rst Doc: Migrate Put special stuff in NuttX header files 2024-10-15 01:22:59 +08:00
stm32ccm.rst Documentation: Fix various typos 2023-11-23 16:38:19 -08:00
stm32nullpointer.rst Documentation: migrate "STM32 Null Pointer Detection" from wiki 2023-11-08 15:54:54 +08:00
testingtcpip.rst Documentation: Fix various typos 2023-11-23 16:38:19 -08:00
thread_local_storage.rst doc: Fix code blocks in thread_local_storage.rst 2024-08-03 21:15:05 +08:00
updating_release_system_elf.rst Doc: improve and add documentations for the guide section of the wiki 2024-12-30 12:32:42 +08:00
usbtrace.rst style: fix typos 2025-04-30 13:45:46 +08:00
usingkernelthreads.rst Doc: Fix kernel thread API 2024-12-10 09:28:20 +08:00
versioning_and_task_names.rst Documentation/Make: add implementation/make_build_system.rst 2025-11-20 09:39:16 -05:00
zerolatencyinterrupts.rst Documentation: Tweak text about Zero Latency Interrupts 2024-12-11 01:27:48 +08:00