Merge pull request #10592 from iNavFlight/MrD_Update-parameter-description
[inav.git] / lib / main / AT32F43x / Drivers / AT32F43x_StdPeriph_Driver / inc / at32f435_437_crc.h
blobdf3f88281698e361592e043bed9c9c7c6df17979
1 /**
2 **************************************************************************
3 * @file at32f435_437_crc.h
4 * @version v2.1.0
5 * @date 2022-08-16
6 * @brief at32f435_437 crc header file
7 **************************************************************************
8 * Copyright notice & Disclaimer
10 * The software Board Support Package (BSP) that is made available to
11 * download from Artery official website is the copyrighted work of Artery.
12 * Artery authorizes customers to use, copy, and distribute the BSP
13 * software and its related documentation for the purpose of design and
14 * development in conjunction with Artery microcontrollers. Use of the
15 * software is governed by this copyright notice and the following disclaimer.
17 * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
18 * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
19 * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
20 * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
21 * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
24 **************************************************************************
27 /* define to prevent recursive inclusion -------------------------------------*/
28 #ifndef __AT32F435_437_CRC_H
29 #define __AT32F435_437_CRC_H
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
36 /* includes ------------------------------------------------------------------*/
37 #include "at32f435_437.h"
39 /** @addtogroup AT32F435_437_periph_driver
40 * @{
43 /** @addtogroup CRC
44 * @{
47 /** @defgroup CRC_exported_types
48 * @{
51 /**
52 * @brief crc reverse input data
54 typedef enum
56 CRC_REVERSE_INPUT_NO_AFFECTE = 0x00, /*!< input data no reverse */
57 CRC_REVERSE_INPUT_BY_BYTE = 0x01, /*!< input data reverse by byte */
58 CRC_REVERSE_INPUT_BY_HALFWORD = 0x02, /*!< input data reverse by half word */
59 CRC_REVERSE_INPUT_BY_WORD = 0x03 /*!< input data reverse by word */
60 } crc_reverse_input_type;
62 /**
63 * @brief crc reverse output data
65 typedef enum
67 CRC_REVERSE_OUTPUT_NO_AFFECTE = 0x00, /*!< output data no reverse */
68 CRC_REVERSE_OUTPUT_DATA = 0x01 /*!< output data reverse by word */
69 } crc_reverse_output_type;
71 /**
72 * @brief type define crc register all
74 typedef struct
76 /**
77 * @brief crc dt register, offset:0x00
79 union
81 __IO uint32_t dt;
82 struct
84 __IO uint32_t dt : 32; /* [31:0] */
85 } dt_bit;
88 /**
89 * @brief crc cdt register, offset:0x04
91 union
93 __IO uint32_t cdt;
94 struct
96 __IO uint32_t cdt : 8 ; /* [7:0] */
97 __IO uint32_t reserved1 : 24 ;/* [31:8] */
98 } cdt_bit;
102 * @brief crc ctrl register, offset:0x08
104 union
106 __IO uint32_t ctrl;
107 struct
109 __IO uint32_t rst : 1 ; /* [0] */
110 __IO uint32_t reserved1 : 4 ; /* [4:1] */
111 __IO uint32_t revid : 2 ; /* [6:5] */
112 __IO uint32_t revod : 1 ; /* [7] */
113 __IO uint32_t reserved2 : 24 ;/* [31:8] */
114 } ctrl_bit;
118 * @brief crm reserved1 register, offset:0x0C
120 __IO uint32_t reserved1;
123 * @brief crc idt register, offset:0x10
125 union
127 __IO uint32_t idt;
128 struct
130 __IO uint32_t idt : 32; /* [31:0] */
131 } idt_bit;
134 } crc_type;
137 * @}
140 #define CRC ((crc_type *) CRC_BASE)
142 /** @defgroup CRC_exported_functions
143 * @{
146 void crc_data_reset(void);
147 uint32_t crc_one_word_calculate(uint32_t data);
148 uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length);
149 uint32_t crc_data_get(void);
150 void crc_common_data_set(uint8_t cdt_value);
151 uint8_t crc_common_data_get(void);
152 void crc_init_data_set(uint32_t value);
153 void crc_reverse_input_data_set(crc_reverse_input_type value);
154 void crc_reverse_output_data_set(crc_reverse_output_type value);
157 * @}
161 * @}
165 * @}
168 #ifdef __cplusplus
170 #endif
172 #endif