zephyr/include
Carles Cufi 7f6524949a lib: os: crc: Rework the crc16() implementation
As described in #42403, there was an issue with the existing crc16_ansi()
implementation, since it was not calculating the CRC-16-ANSI (aka
CRC-16-MODBUS). This is because the  existing crc16() function only
supported non-reflected input and output (and the CRC-16-ANSI requires
reflection on both) and also it did not seem to support correctly inial
seeds different from 0x0000 (and, again, the CRC-16-ANSI requires 0xffff
as an initial seed).

This commit replaces the existing crc16() with a functional pair,
crc16() and crc16_reflect(), that also work with any poly, any initial seed
and allow to select whether reflection is performed.
It also adapts crc16_ansi() so that it actually returns the correct CRC.

Fixes #42403.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-04 12:33:22 -05:00
..
app_memory
arch arch/xtensa: Use ZSR assignments for the CPU pointer 2022-01-20 12:58:00 -05:00
audio audio: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
bluetooth Bluetooth: host: Document skip range in bt_le_per_adv_sync_param 2022-02-02 11:29:27 +01:00
canbus
console drivers: console: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
crypto
data
debug debug: coredump: allow for coredump backends to be defined outside of tree 2022-01-11 18:17:24 -05:00
devicetree devicetree: clocks: fix a docstring 2022-02-03 14:19:16 -06:00
dfu
display
drivers api: gpio: add missing member docstrings for gpio_dt_spec 2022-02-04 11:20:46 +01:00
dt-bindings drivers: pinctrl: Added pinctrl driver for RPi Pico 2022-02-02 16:23:35 +01:00
fs fs: littlefs: Rename *area (struct flash_area*) to *backend void pointer 2022-01-17 12:53:43 -05:00
ipc
kernel kernel: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
linker arch: add MIPS architecture support 2022-01-19 13:48:21 -05:00
logging logging: printk: Fix LOG_PRINTK for v2 2022-01-27 10:02:21 +01:00
lorawan
math math: introduce macro for integer log2 2022-01-11 16:10:53 -05:00
mgmt mcumgr: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
modbus modbus: remove @return doc for void functions 2022-01-12 16:02:16 -05:00
multi_heap
net c++: fix missing extern "C" closing } 2022-01-31 14:00:03 -06:00
pm c++: fix missing extern "C" closing } 2022-01-31 14:00:03 -06:00
portability
posix
random
settings
shell shell: Fix dictionary command naming 2022-02-04 11:14:21 +01:00
stats
storage
sys lib: os: crc: Rework the crc16() implementation 2022-02-04 12:33:22 -05:00
task_wdt
timing
toolchain cpp: BUILD_ASSERT() uses static_assert() iff C++11 2022-01-25 21:17:04 -05:00
tracing Tracing: Fixed TraceRecorder inclusion problem 2022-01-18 14:15:54 -05:00
usb usb: Add macro for user defined string descriptors 2022-02-03 14:57:42 +01:00
xen
zephyr
cache.h
device.h device: improve (z_)device_is_ready docs 2022-01-07 10:41:23 -05:00
devicetree.h
exc_handle.h
fatal.h
init.h
irq_nextlevel.h drivers: interrupt_controller: remove @return doc for void funcs 2022-01-12 16:02:16 -05:00
irq_offload.h
irq.h drivers: interrupt_controller: remove @return doc for void funcs 2022-01-12 16:02:16 -05:00
kernel_includes.h
kernel_structs.h kernel: extend CPU runtime stats 2022-01-10 10:38:06 -05:00
kernel_version.h
kernel.h kernel: C++ friendly version of Z_WORK_USER_INITIALIZER 2022-01-25 21:17:04 -05:00
shared_irq.h
smf.h
spinlock.h doc: spinlock: ensure spinlock api is added to doxygen 2022-02-02 08:57:14 -05:00
sw_isr_table.h
sys_clock.h clock: Z_TIMEOUT_NO_WAIT initializer to {0} 2022-01-25 21:17:04 -05:00
syscall_handler.h
syscall.h
timeout_q.h
toolchain.h
wait_q.h
zephyr.h