|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
CRC hardware calculator driver header. More...
Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_crc_init (ra8_crc_poly_t poly) |
| Configure the CRC block for a given polynomial. | |
| ra8_err_t | ra8_crc_compute (const uint8_t *data, uint32_t len, uint32_t *out_crc) |
| Compute a CRC over a byte buffer. | |
| void | ra8_crc_reset (void) |
| Clear the running CRC state. | |
| ra8_err_t | ra8_crc_deinit (void) |
| Tear down the CRC block (disable + MSTP release). | |
| ra8_err_t | ra8_crc_set_poly (ra8_crc_poly_t poly) |
| Change the CRC polynomial at runtime without a reset. | |
| ra8_err_t | ra8_crc_get_status (uint8_t *out_poly) |
| Read the current polynomial selection (CRCCR0.GPS). | |
| ra8_err_t | ra8_crc_enter_stop (void) |
| Put CRC into MSTP-gated stop. | |
| ra8_err_t | ra8_crc_exit_stop (void) |
| Exit MSTP-gated stop. | |
CRC hardware calculator driver header.
Declares the RA8 CRC engine configuration and bounded byte-stream calculation interface for supported polynomials.
Definition in file ra8_crc.h.
|
nodiscard |
Compute a CRC over a byte buffer.
Feeds each byte of data into CRCDIR and reads the running result from CRCDOR at the end. The CRC unit is not reset between calls – the caller must write CRCCR1 to clear state via ra8_crc_reset() first.
| [in] | data | Pointer to bytes (not NULL). |
| [in] | len | Byte count. |
| [out] | out_crc | Receives the final result. |
Definition at line 190 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, r_crc_regs_t::CRCDOR, internal_crc_feed_bytes(), internal_crc_feed_words(), internal_ra8_crc_is_32bit_poly(), k_ra8_crc_32bit_seed, k_ra8_crccr0_gps_mask, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_crc(), and s_tag.
Referenced by crc_demo_one_iter(), and ra8_nsc_crc_compute().
|
nodiscard |
Tear down the CRC block (disable + MSTP release).
Definition at line 236 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, r_crc_regs_t::CRCCR1, k_ra8_mstp_crc, ra8_crc(), and ra8_mstp_disable().
|
nodiscard |
Put CRC into MSTP-gated stop.
Definition at line 264 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, k_ra8_mstp_crc, ra8_crc(), and ra8_mstp_disable().
|
nodiscard |
Exit MSTP-gated stop.
Definition at line 271 of file ra8_crc.c.
References k_ra8_mstp_crc, and ra8_mstp_enable().
|
nodiscard |
Read the current polynomial selection (CRCCR0.GPS).
Definition at line 256 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_crc(), and s_tag.
|
nodiscard |
Configure the CRC block for a given polynomial.
| [in] | poly | One of the k_ra8_crc_poly_* values. |
Definition at line 158 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, r_crc_regs_t::CRCCR1, k_ra8_crccr0_dorclr, k_ra8_mstp_crc, k_ra8_ok, ra8_crc(), ra8_log_info_val, ra8_mstp_enable(), RA8_RETURN_ON_ERROR, and s_tag.
Referenced by crc_demo_setup_or_halt(), and ra8_nsc_crc_init().
| void ra8_crc_reset | ( | void | ) |
Clear the running CRC state.
See the matching header declaration for the full contract; this site adds no behaviour beyond what the public API documents.
Definition at line 180 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, k_ra8_crccr0_dorclr, and ra8_crc().
Referenced by crc_demo_one_iter().
|
nodiscard |
Change the CRC polynomial at runtime without a reset.
Definition at line 246 of file ra8_crc.c.
References r_crc_regs_t::CRCCR0, k_ra8_crccr0_dorclr, k_ra8_ok, and ra8_crc().