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 - 2024 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
18#ifndef neorv32_crc_h
19#define neorv32_crc_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t MODE;
31 uint32_t POLY;
32 uint32_t DATA;
33 uint32_t SREG;
35
37#define NEORV32_CRC ((neorv32_crc_t*) (NEORV32_CRC_BASE))
38
48/**********************************************************************/
52int neorv32_crc_available(void);
53void neorv32_crc_setup(uint32_t mode, uint32_t poly, uint32_t start);
54uint32_t neorv32_crc_block(uint8_t *byte, int length);
55void neorv32_crc_single(uint8_t byte);
56uint32_t neorv32_crc_get(void);
60#endif // neorv32_crc_h
NEORV32_CRC_MODE_enum
Definition neorv32_crc.h:40
@ CRC_MODE32
Definition neorv32_crc.h:43
@ CRC_MODE8
Definition neorv32_crc.h:41
@ CRC_MODE16
Definition neorv32_crc.h:42
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:29
uint32_t DATA
Definition neorv32_crc.h:32
uint32_t POLY
Definition neorv32_crc.h:31
uint32_t SREG
Definition neorv32_crc.h:33
uint32_t MODE
Definition neorv32_crc.h:30