NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_crc.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2025 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
13
14#ifndef NEORV32_CRC_H
15#define NEORV32_CRC_H
16
17#include <stdint.h>
18
19
20/**********************************************************************/
25typedef volatile struct __attribute__((packed,aligned(4))) {
26 uint32_t MODE;
27 uint32_t POLY;
28 uint32_t DATA;
29 uint32_t SREG;
31
33#define NEORV32_CRC ((neorv32_crc_t*) (NEORV32_CRC_BASE))
34
41
42
43
44/**********************************************************************/
48int neorv32_crc_available(void);
49void neorv32_crc_setup(uint32_t mode, uint32_t poly, uint32_t start);
50uint32_t neorv32_crc_block(uint8_t *byte, int length);
51void neorv32_crc_single(uint8_t byte);
52uint32_t neorv32_crc_get(void);
54
55
56#endif // NEORV32_CRC_H
NEORV32_CRC_MODE_enum
Definition neorv32_crc.h:36
@ CRC_MODE32
Definition neorv32_crc.h:39
@ CRC_MODE8
Definition neorv32_crc.h:37
@ CRC_MODE16
Definition neorv32_crc.h:38
uint32_t neorv32_crc_get(void)
Definition neorv32_crc.c:86
void neorv32_crc_setup(uint32_t mode, uint32_t poly, uint32_t start)
Definition neorv32_crc.c:44
uint32_t neorv32_crc_block(uint8_t *byte, int length)
Definition neorv32_crc.c:59
int neorv32_crc_available(void)
Definition neorv32_crc.c:26
void neorv32_crc_single(uint8_t byte)
Definition neorv32_crc.c:75
Definition neorv32_crc.h:25
uint32_t DATA
Definition neorv32_crc.h:28
uint32_t POLY
Definition neorv32_crc.h:27
uint32_t SREG
Definition neorv32_crc.h:29
uint32_t MODE
Definition neorv32_crc.h:26