Skip to content

CRC

Documentation for the Mira CRC (Cyclic Redundancy Check) library.

Structs

mira_crc_ctx_t

CRC context structure.

Name Type Description
state uint32_t Current CRC state

Functions

mira_crc_init

mira_status_t mira_crc_init(mira_crc_ctx_t *ctx);

Initialize a CRC context.

Parameters

Name Description
ctx Pointer to the CRC context to initialize.

Return value

Name Description
MIRA_SUCCESS Mira CRC successfully initialized.
MIRA_ERROR_INVALID_VALUE Argument is NULL.

mira_crc_update

mira_status_t mira_crc_update(mira_crc_ctx_t *ctx, const uint8_t *data, uint32_t length);

Update the CRC value with new data.

Parameters

Name Description
ctx Pointer to the CRC context.
data Pointer to the data buffer.
length Length of the data buffer.

Return value

Name Description
MIRA_SUCCESS CRC value updated successfully.
MIRA_ERROR_INVALID_VALUE One or more arguments are NULL

mira_crc_get

mira_status_t mira_crc_get(const mira_crc_ctx_t *ctx, uint32_t *dest);

Retrieve the computed CRC value.

Parameters

Name Description
ctx Pointer to the CRC context.
dest Pointer to store the computed CRC value.

Return value

Name Description
MIRA_SUCCESS CRC value retrieved successfully.
MIRA_ERROR_INVALID_VALUE One or more arguments are NULL
Back to top