ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_crc.h
Go to the documentation of this file.
1
11
12#pragma once
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <stdint.h>
19
20#include "ra8_crc_regs.h"
21#include "ra8_err.h"
22
29[[nodiscard]] ra8_err_t ra8_crc_init(ra8_crc_poly_t poly);
30
46[[nodiscard]] ra8_err_t ra8_crc_compute(const uint8_t* data, uint32_t len, uint32_t* out_crc);
47
61void ra8_crc_reset(void);
62
67[[nodiscard]] ra8_err_t ra8_crc_deinit(void);
68
73[[nodiscard]] ra8_err_t ra8_crc_set_poly(ra8_crc_poly_t poly);
74
79[[nodiscard]] ra8_err_t ra8_crc_get_status(uint8_t* out_poly);
80
85[[nodiscard]] ra8_err_t ra8_crc_enter_stop(void);
86
91[[nodiscard]] ra8_err_t ra8_crc_exit_stop(void);
92
93#ifdef __cplusplus
94}
95#endif
ra8_err_t ra8_crc_exit_stop(void)
Exit MSTP-gated stop.
Definition ra8_crc.c:271
ra8_err_t ra8_crc_init(ra8_crc_poly_t poly)
Configure the CRC block for a given polynomial.
Definition ra8_crc.c:158
ra8_err_t ra8_crc_compute(const uint8_t *data, uint32_t len, uint32_t *out_crc)
Compute a CRC over a byte buffer.
Definition ra8_crc.c:190
void ra8_crc_reset(void)
Clear the running CRC state.
Definition ra8_crc.c:180
ra8_err_t ra8_crc_enter_stop(void)
Put CRC into MSTP-gated stop.
Definition ra8_crc.c:264
ra8_err_t ra8_crc_deinit(void)
Tear down the CRC block (disable + MSTP release).
Definition ra8_crc.c:236
ra8_err_t ra8_crc_get_status(uint8_t *out_poly)
Read the current polynomial selection (CRCCR0.GPS).
Definition ra8_crc.c:256
ra8_err_t ra8_crc_set_poly(ra8_crc_poly_t poly)
Change the CRC polynomial at runtime without a reset.
Definition ra8_crc.c:246
CRC calculator register layout for the Renesas RA8D2.
ra8_crc_poly_t
Polynomial selection values written to CRCCR0.GPS[2:0].
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546