Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
CRC public API header file. More...
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/crc.h>
#include <zephyr/syscalls/crc.h>
Go to the source code of this file.
Data Structures | |
struct | crc_ctx |
CRC context structure. More... | |
struct | crc_driver_api |
Macros | |
CRC input/output string flags | |
#define | CRC_FLAG_REVERSE_INPUT BIT(0) |
Reverse input string. | |
#define | CRC_FLAG_REVERSE_OUTPUT BIT(1) |
Reverse output string. |
Typedefs | |
typedef uint32_t | crc_init_val_t |
Provides a type to hold CRC initial seed value. | |
typedef uint32_t | crc_poly_t |
Provides a type to hold CRC polynomial value. | |
typedef uint32_t | crc_result_t |
Provides a type to hold CRC result value. | |
typedef int(* | crc_api_begin) (const struct device *dev, struct crc_ctx *ctx) |
Callback API upon CRC calculation begin See crc_begin() for argument description. | |
typedef int(* | crc_api_update) (const struct device *dev, struct crc_ctx *ctx, const void *buffer, size_t bufsize) |
Callback API upon CRC calculation stream update See crc_update() for argument description. | |
typedef int(* | crc_api_finish) (const struct device *dev, struct crc_ctx *ctx) |
Callback API upon CRC calculation finish See crc_finish() for argument description. |
Enumerations | |
enum | crc_state { CRC_STATE_IDLE = 0 , CRC_STATE_IN_PROGRESS } |
CRC state enumeration. More... |
Functions | |
int | crc_begin (const struct device *dev, struct crc_ctx *ctx) |
Configure CRC unit for calculation. | |
int | crc_update (const struct device *dev, struct crc_ctx *ctx, const void *buffer, size_t bufsize) |
Perform CRC calculation on the provided data buffer and retrieve result. | |
int | crc_finish (const struct device *dev, struct crc_ctx *ctx) |
Finalize CRC calculation. | |
static int | crc_verify (struct crc_ctx *ctx, crc_result_t expected) |
Verify CRC result. |
CRC public API header file.