2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-08-12)
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
72 ** ###################################################################
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
78 * This file was generated automatically and any changes may be lost.
80 #ifndef __HW_CRC_REGISTERS_H__
81 #define __HW_CRC_REGISTERS_H__
84 #include "fsl_bitaccess.h"
89 * Cyclic Redundancy Check
91 * Registers defined in this header file:
92 * - HW_CRC_DATAL - CRC_DATAL register.
93 * - HW_CRC_DATAH - CRC_DATAH register.
94 * - HW_CRC_DATALL - CRC_DATALL register.
95 * - HW_CRC_DATALU - CRC_DATALU register.
96 * - HW_CRC_DATAHL - CRC_DATAHL register.
97 * - HW_CRC_DATAHU - CRC_DATAHU register.
98 * - HW_CRC_DATA - CRC Data register
99 * - HW_CRC_GPOLY - CRC Polynomial register
100 * - HW_CRC_GPOLYL - CRC_GPOLYL register.
101 * - HW_CRC_GPOLYH - CRC_GPOLYH register.
102 * - HW_CRC_GPOLYLL - CRC_GPOLYLL register.
103 * - HW_CRC_GPOLYLU - CRC_GPOLYLU register.
104 * - HW_CRC_GPOLYHL - CRC_GPOLYHL register.
105 * - HW_CRC_GPOLYHU - CRC_GPOLYHU register.
106 * - HW_CRC_CTRL - CRC Control register
107 * - HW_CRC_CTRLHU - CRC_CTRLHU register.
109 * - hw_crc_t - Struct containing all module registers.
112 #define HW_CRC_INSTANCE_COUNT (1U) /*!< Number of instances of the CRC module. */
114 /*******************************************************************************
115 * HW_CRC_DATAL - CRC_DATAL register.
116 ******************************************************************************/
119 * @brief HW_CRC_DATAL - CRC_DATAL register. (RW)
121 * Reset value: 0xFFFFU
123 typedef union _hw_crc_datal
126 struct _hw_crc_datal_bitfields
128 uint16_t DATAL
: 16; /*!< [15:0] DATAL stores the lower 16 bits of
129 * the 16/32 bit CRC */
134 * @name Constants and macros for entire CRC_DATAL register
137 #define HW_CRC_DATAL_ADDR(x) ((x) + 0x0U)
139 #define HW_CRC_DATAL(x) (*(__IO hw_crc_datal_t *) HW_CRC_DATAL_ADDR(x))
140 #define HW_CRC_DATAL_RD(x) (HW_CRC_DATAL(x).U)
141 #define HW_CRC_DATAL_WR(x, v) (HW_CRC_DATAL(x).U = (v))
142 #define HW_CRC_DATAL_SET(x, v) (HW_CRC_DATAL_WR(x, HW_CRC_DATAL_RD(x) | (v)))
143 #define HW_CRC_DATAL_CLR(x, v) (HW_CRC_DATAL_WR(x, HW_CRC_DATAL_RD(x) & ~(v)))
144 #define HW_CRC_DATAL_TOG(x, v) (HW_CRC_DATAL_WR(x, HW_CRC_DATAL_RD(x) ^ (v)))
148 * Constants & macros for individual CRC_DATAL bitfields
152 * @name Register CRC_DATAL, field DATAL[15:0] (RW)
155 #define BP_CRC_DATAL_DATAL (0U) /*!< Bit position for CRC_DATAL_DATAL. */
156 #define BM_CRC_DATAL_DATAL (0xFFFFU) /*!< Bit mask for CRC_DATAL_DATAL. */
157 #define BS_CRC_DATAL_DATAL (16U) /*!< Bit field size in bits for CRC_DATAL_DATAL. */
159 /*! @brief Read current value of the CRC_DATAL_DATAL field. */
160 #define BR_CRC_DATAL_DATAL(x) (HW_CRC_DATAL(x).U)
162 /*! @brief Format value for bitfield CRC_DATAL_DATAL. */
163 #define BF_CRC_DATAL_DATAL(v) ((uint16_t)((uint16_t)(v) << BP_CRC_DATAL_DATAL) & BM_CRC_DATAL_DATAL)
165 /*! @brief Set the DATAL field to a new value. */
166 #define BW_CRC_DATAL_DATAL(x, v) (HW_CRC_DATAL_WR(x, v))
168 /*******************************************************************************
169 * HW_CRC_DATAH - CRC_DATAH register.
170 ******************************************************************************/
173 * @brief HW_CRC_DATAH - CRC_DATAH register. (RW)
175 * Reset value: 0xFFFFU
177 typedef union _hw_crc_datah
180 struct _hw_crc_datah_bitfields
182 uint16_t DATAH
: 16; /*!< [15:0] DATAH stores the high 16 bits of the
188 * @name Constants and macros for entire CRC_DATAH register
191 #define HW_CRC_DATAH_ADDR(x) ((x) + 0x2U)
193 #define HW_CRC_DATAH(x) (*(__IO hw_crc_datah_t *) HW_CRC_DATAH_ADDR(x))
194 #define HW_CRC_DATAH_RD(x) (HW_CRC_DATAH(x).U)
195 #define HW_CRC_DATAH_WR(x, v) (HW_CRC_DATAH(x).U = (v))
196 #define HW_CRC_DATAH_SET(x, v) (HW_CRC_DATAH_WR(x, HW_CRC_DATAH_RD(x) | (v)))
197 #define HW_CRC_DATAH_CLR(x, v) (HW_CRC_DATAH_WR(x, HW_CRC_DATAH_RD(x) & ~(v)))
198 #define HW_CRC_DATAH_TOG(x, v) (HW_CRC_DATAH_WR(x, HW_CRC_DATAH_RD(x) ^ (v)))
202 * Constants & macros for individual CRC_DATAH bitfields
206 * @name Register CRC_DATAH, field DATAH[15:0] (RW)
209 #define BP_CRC_DATAH_DATAH (0U) /*!< Bit position for CRC_DATAH_DATAH. */
210 #define BM_CRC_DATAH_DATAH (0xFFFFU) /*!< Bit mask for CRC_DATAH_DATAH. */
211 #define BS_CRC_DATAH_DATAH (16U) /*!< Bit field size in bits for CRC_DATAH_DATAH. */
213 /*! @brief Read current value of the CRC_DATAH_DATAH field. */
214 #define BR_CRC_DATAH_DATAH(x) (HW_CRC_DATAH(x).U)
216 /*! @brief Format value for bitfield CRC_DATAH_DATAH. */
217 #define BF_CRC_DATAH_DATAH(v) ((uint16_t)((uint16_t)(v) << BP_CRC_DATAH_DATAH) & BM_CRC_DATAH_DATAH)
219 /*! @brief Set the DATAH field to a new value. */
220 #define BW_CRC_DATAH_DATAH(x, v) (HW_CRC_DATAH_WR(x, v))
222 /*******************************************************************************
223 * HW_CRC_DATALL - CRC_DATALL register.
224 ******************************************************************************/
227 * @brief HW_CRC_DATALL - CRC_DATALL register. (RW)
231 typedef union _hw_crc_datall
234 struct _hw_crc_datall_bitfields
236 uint8_t DATALL
: 8; /*!< [7:0] CRCLL stores the first 8 bits of the
242 * @name Constants and macros for entire CRC_DATALL register
245 #define HW_CRC_DATALL_ADDR(x) ((x) + 0x0U)
247 #define HW_CRC_DATALL(x) (*(__IO hw_crc_datall_t *) HW_CRC_DATALL_ADDR(x))
248 #define HW_CRC_DATALL_RD(x) (HW_CRC_DATALL(x).U)
249 #define HW_CRC_DATALL_WR(x, v) (HW_CRC_DATALL(x).U = (v))
250 #define HW_CRC_DATALL_SET(x, v) (HW_CRC_DATALL_WR(x, HW_CRC_DATALL_RD(x) | (v)))
251 #define HW_CRC_DATALL_CLR(x, v) (HW_CRC_DATALL_WR(x, HW_CRC_DATALL_RD(x) & ~(v)))
252 #define HW_CRC_DATALL_TOG(x, v) (HW_CRC_DATALL_WR(x, HW_CRC_DATALL_RD(x) ^ (v)))
256 * Constants & macros for individual CRC_DATALL bitfields
260 * @name Register CRC_DATALL, field DATALL[7:0] (RW)
263 #define BP_CRC_DATALL_DATALL (0U) /*!< Bit position for CRC_DATALL_DATALL. */
264 #define BM_CRC_DATALL_DATALL (0xFFU) /*!< Bit mask for CRC_DATALL_DATALL. */
265 #define BS_CRC_DATALL_DATALL (8U) /*!< Bit field size in bits for CRC_DATALL_DATALL. */
267 /*! @brief Read current value of the CRC_DATALL_DATALL field. */
268 #define BR_CRC_DATALL_DATALL(x) (HW_CRC_DATALL(x).U)
270 /*! @brief Format value for bitfield CRC_DATALL_DATALL. */
271 #define BF_CRC_DATALL_DATALL(v) ((uint8_t)((uint8_t)(v) << BP_CRC_DATALL_DATALL) & BM_CRC_DATALL_DATALL)
273 /*! @brief Set the DATALL field to a new value. */
274 #define BW_CRC_DATALL_DATALL(x, v) (HW_CRC_DATALL_WR(x, v))
276 /*******************************************************************************
277 * HW_CRC_DATALU - CRC_DATALU register.
278 ******************************************************************************/
281 * @brief HW_CRC_DATALU - CRC_DATALU register. (RW)
285 typedef union _hw_crc_datalu
288 struct _hw_crc_datalu_bitfields
290 uint8_t DATALU
: 8; /*!< [7:0] DATALL stores the second 8 bits of the
296 * @name Constants and macros for entire CRC_DATALU register
299 #define HW_CRC_DATALU_ADDR(x) ((x) + 0x1U)
301 #define HW_CRC_DATALU(x) (*(__IO hw_crc_datalu_t *) HW_CRC_DATALU_ADDR(x))
302 #define HW_CRC_DATALU_RD(x) (HW_CRC_DATALU(x).U)
303 #define HW_CRC_DATALU_WR(x, v) (HW_CRC_DATALU(x).U = (v))
304 #define HW_CRC_DATALU_SET(x, v) (HW_CRC_DATALU_WR(x, HW_CRC_DATALU_RD(x) | (v)))
305 #define HW_CRC_DATALU_CLR(x, v) (HW_CRC_DATALU_WR(x, HW_CRC_DATALU_RD(x) & ~(v)))
306 #define HW_CRC_DATALU_TOG(x, v) (HW_CRC_DATALU_WR(x, HW_CRC_DATALU_RD(x) ^ (v)))
310 * Constants & macros for individual CRC_DATALU bitfields
314 * @name Register CRC_DATALU, field DATALU[7:0] (RW)
317 #define BP_CRC_DATALU_DATALU (0U) /*!< Bit position for CRC_DATALU_DATALU. */
318 #define BM_CRC_DATALU_DATALU (0xFFU) /*!< Bit mask for CRC_DATALU_DATALU. */
319 #define BS_CRC_DATALU_DATALU (8U) /*!< Bit field size in bits for CRC_DATALU_DATALU. */
321 /*! @brief Read current value of the CRC_DATALU_DATALU field. */
322 #define BR_CRC_DATALU_DATALU(x) (HW_CRC_DATALU(x).U)
324 /*! @brief Format value for bitfield CRC_DATALU_DATALU. */
325 #define BF_CRC_DATALU_DATALU(v) ((uint8_t)((uint8_t)(v) << BP_CRC_DATALU_DATALU) & BM_CRC_DATALU_DATALU)
327 /*! @brief Set the DATALU field to a new value. */
328 #define BW_CRC_DATALU_DATALU(x, v) (HW_CRC_DATALU_WR(x, v))
330 /*******************************************************************************
331 * HW_CRC_DATAHL - CRC_DATAHL register.
332 ******************************************************************************/
335 * @brief HW_CRC_DATAHL - CRC_DATAHL register. (RW)
339 typedef union _hw_crc_datahl
342 struct _hw_crc_datahl_bitfields
344 uint8_t DATAHL
: 8; /*!< [7:0] DATAHL stores the third 8 bits of the
350 * @name Constants and macros for entire CRC_DATAHL register
353 #define HW_CRC_DATAHL_ADDR(x) ((x) + 0x2U)
355 #define HW_CRC_DATAHL(x) (*(__IO hw_crc_datahl_t *) HW_CRC_DATAHL_ADDR(x))
356 #define HW_CRC_DATAHL_RD(x) (HW_CRC_DATAHL(x).U)
357 #define HW_CRC_DATAHL_WR(x, v) (HW_CRC_DATAHL(x).U = (v))
358 #define HW_CRC_DATAHL_SET(x, v) (HW_CRC_DATAHL_WR(x, HW_CRC_DATAHL_RD(x) | (v)))
359 #define HW_CRC_DATAHL_CLR(x, v) (HW_CRC_DATAHL_WR(x, HW_CRC_DATAHL_RD(x) & ~(v)))
360 #define HW_CRC_DATAHL_TOG(x, v) (HW_CRC_DATAHL_WR(x, HW_CRC_DATAHL_RD(x) ^ (v)))
364 * Constants & macros for individual CRC_DATAHL bitfields
368 * @name Register CRC_DATAHL, field DATAHL[7:0] (RW)
371 #define BP_CRC_DATAHL_DATAHL (0U) /*!< Bit position for CRC_DATAHL_DATAHL. */
372 #define BM_CRC_DATAHL_DATAHL (0xFFU) /*!< Bit mask for CRC_DATAHL_DATAHL. */
373 #define BS_CRC_DATAHL_DATAHL (8U) /*!< Bit field size in bits for CRC_DATAHL_DATAHL. */
375 /*! @brief Read current value of the CRC_DATAHL_DATAHL field. */
376 #define BR_CRC_DATAHL_DATAHL(x) (HW_CRC_DATAHL(x).U)
378 /*! @brief Format value for bitfield CRC_DATAHL_DATAHL. */
379 #define BF_CRC_DATAHL_DATAHL(v) ((uint8_t)((uint8_t)(v) << BP_CRC_DATAHL_DATAHL) & BM_CRC_DATAHL_DATAHL)
381 /*! @brief Set the DATAHL field to a new value. */
382 #define BW_CRC_DATAHL_DATAHL(x, v) (HW_CRC_DATAHL_WR(x, v))
384 /*******************************************************************************
385 * HW_CRC_DATAHU - CRC_DATAHU register.
386 ******************************************************************************/
389 * @brief HW_CRC_DATAHU - CRC_DATAHU register. (RW)
393 typedef union _hw_crc_datahu
396 struct _hw_crc_datahu_bitfields
398 uint8_t DATAHU
: 8; /*!< [7:0] DATAHU stores the fourth 8 bits of the
404 * @name Constants and macros for entire CRC_DATAHU register
407 #define HW_CRC_DATAHU_ADDR(x) ((x) + 0x3U)
409 #define HW_CRC_DATAHU(x) (*(__IO hw_crc_datahu_t *) HW_CRC_DATAHU_ADDR(x))
410 #define HW_CRC_DATAHU_RD(x) (HW_CRC_DATAHU(x).U)
411 #define HW_CRC_DATAHU_WR(x, v) (HW_CRC_DATAHU(x).U = (v))
412 #define HW_CRC_DATAHU_SET(x, v) (HW_CRC_DATAHU_WR(x, HW_CRC_DATAHU_RD(x) | (v)))
413 #define HW_CRC_DATAHU_CLR(x, v) (HW_CRC_DATAHU_WR(x, HW_CRC_DATAHU_RD(x) & ~(v)))
414 #define HW_CRC_DATAHU_TOG(x, v) (HW_CRC_DATAHU_WR(x, HW_CRC_DATAHU_RD(x) ^ (v)))
418 * Constants & macros for individual CRC_DATAHU bitfields
422 * @name Register CRC_DATAHU, field DATAHU[7:0] (RW)
425 #define BP_CRC_DATAHU_DATAHU (0U) /*!< Bit position for CRC_DATAHU_DATAHU. */
426 #define BM_CRC_DATAHU_DATAHU (0xFFU) /*!< Bit mask for CRC_DATAHU_DATAHU. */
427 #define BS_CRC_DATAHU_DATAHU (8U) /*!< Bit field size in bits for CRC_DATAHU_DATAHU. */
429 /*! @brief Read current value of the CRC_DATAHU_DATAHU field. */
430 #define BR_CRC_DATAHU_DATAHU(x) (HW_CRC_DATAHU(x).U)
432 /*! @brief Format value for bitfield CRC_DATAHU_DATAHU. */
433 #define BF_CRC_DATAHU_DATAHU(v) ((uint8_t)((uint8_t)(v) << BP_CRC_DATAHU_DATAHU) & BM_CRC_DATAHU_DATAHU)
435 /*! @brief Set the DATAHU field to a new value. */
436 #define BW_CRC_DATAHU_DATAHU(x, v) (HW_CRC_DATAHU_WR(x, v))
438 /*******************************************************************************
439 * HW_CRC_DATA - CRC Data register
440 ******************************************************************************/
443 * @brief HW_CRC_DATA - CRC Data register (RW)
445 * Reset value: 0xFFFFFFFFU
447 * The CRC Data register contains the value of the seed, data, and checksum.
448 * When CTRL[WAS] is set, any write to the data register is regarded as the seed
449 * value. When CTRL[WAS] is cleared, any write to the data register is regarded as
450 * data for general CRC computation. In 16-bit CRC mode, the HU and HL fields are
451 * not used for programming the seed value, and reads of these fields return an
452 * indeterminate value. In 32-bit CRC mode, all fields are used for programming
453 * the seed value. When programming data values, the values can be written 8 bits,
454 * 16 bits, or 32 bits at a time, provided all bytes are contiguous; with MSB of
455 * data value written first. After all data values are written, the CRC result
456 * can be read from this data register. In 16-bit CRC mode, the CRC result is
457 * available in the LU and LL fields. In 32-bit CRC mode, all fields contain the
458 * result. Reads of this register at any time return the intermediate CRC value,
459 * provided the CRC module is configured.
461 typedef union _hw_crc_data
464 struct _hw_crc_data_bitfields
466 uint32_t LL
: 8; /*!< [7:0] CRC Low Lower Byte */
467 uint32_t LU
: 8; /*!< [15:8] CRC Low Upper Byte */
468 uint32_t HL
: 8; /*!< [23:16] CRC High Lower Byte */
469 uint32_t HU
: 8; /*!< [31:24] CRC High Upper Byte */
474 * @name Constants and macros for entire CRC_DATA register
477 #define HW_CRC_DATA_ADDR(x) ((x) + 0x0U)
479 #define HW_CRC_DATA(x) (*(__IO hw_crc_data_t *) HW_CRC_DATA_ADDR(x))
480 #define HW_CRC_DATA_RD(x) (HW_CRC_DATA(x).U)
481 #define HW_CRC_DATA_WR(x, v) (HW_CRC_DATA(x).U = (v))
482 #define HW_CRC_DATA_SET(x, v) (HW_CRC_DATA_WR(x, HW_CRC_DATA_RD(x) | (v)))
483 #define HW_CRC_DATA_CLR(x, v) (HW_CRC_DATA_WR(x, HW_CRC_DATA_RD(x) & ~(v)))
484 #define HW_CRC_DATA_TOG(x, v) (HW_CRC_DATA_WR(x, HW_CRC_DATA_RD(x) ^ (v)))
488 * Constants & macros for individual CRC_DATA bitfields
492 * @name Register CRC_DATA, field LL[7:0] (RW)
494 * When CTRL[WAS] is 1, values written to this field are part of the seed value.
495 * When CTRL[WAS] is 0, data written to this field is used for CRC checksum
499 #define BP_CRC_DATA_LL (0U) /*!< Bit position for CRC_DATA_LL. */
500 #define BM_CRC_DATA_LL (0x000000FFU) /*!< Bit mask for CRC_DATA_LL. */
501 #define BS_CRC_DATA_LL (8U) /*!< Bit field size in bits for CRC_DATA_LL. */
503 /*! @brief Read current value of the CRC_DATA_LL field. */
504 #define BR_CRC_DATA_LL(x) (HW_CRC_DATA(x).B.LL)
506 /*! @brief Format value for bitfield CRC_DATA_LL. */
507 #define BF_CRC_DATA_LL(v) ((uint32_t)((uint32_t)(v) << BP_CRC_DATA_LL) & BM_CRC_DATA_LL)
509 /*! @brief Set the LL field to a new value. */
510 #define BW_CRC_DATA_LL(x, v) (HW_CRC_DATA_WR(x, (HW_CRC_DATA_RD(x) & ~BM_CRC_DATA_LL) | BF_CRC_DATA_LL(v)))
514 * @name Register CRC_DATA, field LU[15:8] (RW)
516 * When CTRL[WAS] is 1, values written to this field are part of the seed value.
517 * When CTRL[WAS] is 0, data written to this field is used for CRC checksum
521 #define BP_CRC_DATA_LU (8U) /*!< Bit position for CRC_DATA_LU. */
522 #define BM_CRC_DATA_LU (0x0000FF00U) /*!< Bit mask for CRC_DATA_LU. */
523 #define BS_CRC_DATA_LU (8U) /*!< Bit field size in bits for CRC_DATA_LU. */
525 /*! @brief Read current value of the CRC_DATA_LU field. */
526 #define BR_CRC_DATA_LU(x) (HW_CRC_DATA(x).B.LU)
528 /*! @brief Format value for bitfield CRC_DATA_LU. */
529 #define BF_CRC_DATA_LU(v) ((uint32_t)((uint32_t)(v) << BP_CRC_DATA_LU) & BM_CRC_DATA_LU)
531 /*! @brief Set the LU field to a new value. */
532 #define BW_CRC_DATA_LU(x, v) (HW_CRC_DATA_WR(x, (HW_CRC_DATA_RD(x) & ~BM_CRC_DATA_LU) | BF_CRC_DATA_LU(v)))
536 * @name Register CRC_DATA, field HL[23:16] (RW)
538 * In 16-bit CRC mode (CTRL[TCRC] is 0), this field is not used for programming
539 * a seed value. In 32-bit CRC mode (CTRL[TCRC] is 1), values written to this
540 * field are part of the seed value when CTRL[WAS] is 1. When CTRL[WAS] is 0, data
541 * written to this field is used for CRC checksum generation in both 16-bit and
545 #define BP_CRC_DATA_HL (16U) /*!< Bit position for CRC_DATA_HL. */
546 #define BM_CRC_DATA_HL (0x00FF0000U) /*!< Bit mask for CRC_DATA_HL. */
547 #define BS_CRC_DATA_HL (8U) /*!< Bit field size in bits for CRC_DATA_HL. */
549 /*! @brief Read current value of the CRC_DATA_HL field. */
550 #define BR_CRC_DATA_HL(x) (HW_CRC_DATA(x).B.HL)
552 /*! @brief Format value for bitfield CRC_DATA_HL. */
553 #define BF_CRC_DATA_HL(v) ((uint32_t)((uint32_t)(v) << BP_CRC_DATA_HL) & BM_CRC_DATA_HL)
555 /*! @brief Set the HL field to a new value. */
556 #define BW_CRC_DATA_HL(x, v) (HW_CRC_DATA_WR(x, (HW_CRC_DATA_RD(x) & ~BM_CRC_DATA_HL) | BF_CRC_DATA_HL(v)))
560 * @name Register CRC_DATA, field HU[31:24] (RW)
562 * In 16-bit CRC mode (CTRL[TCRC] is 0), this field is not used for programming
563 * a seed value. In 32-bit CRC mode (CTRL[TCRC] is 1), values written to this
564 * field are part of the seed value when CTRL[WAS] is 1. When CTRL[WAS] is 0, data
565 * written to this field is used for CRC checksum generation in both 16-bit and
569 #define BP_CRC_DATA_HU (24U) /*!< Bit position for CRC_DATA_HU. */
570 #define BM_CRC_DATA_HU (0xFF000000U) /*!< Bit mask for CRC_DATA_HU. */
571 #define BS_CRC_DATA_HU (8U) /*!< Bit field size in bits for CRC_DATA_HU. */
573 /*! @brief Read current value of the CRC_DATA_HU field. */
574 #define BR_CRC_DATA_HU(x) (HW_CRC_DATA(x).B.HU)
576 /*! @brief Format value for bitfield CRC_DATA_HU. */
577 #define BF_CRC_DATA_HU(v) ((uint32_t)((uint32_t)(v) << BP_CRC_DATA_HU) & BM_CRC_DATA_HU)
579 /*! @brief Set the HU field to a new value. */
580 #define BW_CRC_DATA_HU(x, v) (HW_CRC_DATA_WR(x, (HW_CRC_DATA_RD(x) & ~BM_CRC_DATA_HU) | BF_CRC_DATA_HU(v)))
583 /*******************************************************************************
584 * HW_CRC_GPOLY - CRC Polynomial register
585 ******************************************************************************/
588 * @brief HW_CRC_GPOLY - CRC Polynomial register (RW)
590 * Reset value: 0x00001021U
592 * This register contains the value of the polynomial for the CRC calculation.
593 * The HIGH field contains the upper 16 bits of the CRC polynomial, which are used
594 * only in 32-bit CRC mode. Writes to the HIGH field are ignored in 16-bit CRC
595 * mode. The LOW field contains the lower 16 bits of the CRC polynomial, which are
596 * used in both 16- and 32-bit CRC modes.
598 typedef union _hw_crc_gpoly
601 struct _hw_crc_gpoly_bitfields
603 uint32_t LOW
: 16; /*!< [15:0] Low Polynominal Half-word */
604 uint32_t HIGH
: 16; /*!< [31:16] High Polynominal Half-word */
609 * @name Constants and macros for entire CRC_GPOLY register
612 #define HW_CRC_GPOLY_ADDR(x) ((x) + 0x4U)
614 #define HW_CRC_GPOLY(x) (*(__IO hw_crc_gpoly_t *) HW_CRC_GPOLY_ADDR(x))
615 #define HW_CRC_GPOLY_RD(x) (HW_CRC_GPOLY(x).U)
616 #define HW_CRC_GPOLY_WR(x, v) (HW_CRC_GPOLY(x).U = (v))
617 #define HW_CRC_GPOLY_SET(x, v) (HW_CRC_GPOLY_WR(x, HW_CRC_GPOLY_RD(x) | (v)))
618 #define HW_CRC_GPOLY_CLR(x, v) (HW_CRC_GPOLY_WR(x, HW_CRC_GPOLY_RD(x) & ~(v)))
619 #define HW_CRC_GPOLY_TOG(x, v) (HW_CRC_GPOLY_WR(x, HW_CRC_GPOLY_RD(x) ^ (v)))
623 * Constants & macros for individual CRC_GPOLY bitfields
627 * @name Register CRC_GPOLY, field LOW[15:0] (RW)
629 * Writable and readable in both 32-bit and 16-bit CRC modes.
632 #define BP_CRC_GPOLY_LOW (0U) /*!< Bit position for CRC_GPOLY_LOW. */
633 #define BM_CRC_GPOLY_LOW (0x0000FFFFU) /*!< Bit mask for CRC_GPOLY_LOW. */
634 #define BS_CRC_GPOLY_LOW (16U) /*!< Bit field size in bits for CRC_GPOLY_LOW. */
636 /*! @brief Read current value of the CRC_GPOLY_LOW field. */
637 #define BR_CRC_GPOLY_LOW(x) (HW_CRC_GPOLY(x).B.LOW)
639 /*! @brief Format value for bitfield CRC_GPOLY_LOW. */
640 #define BF_CRC_GPOLY_LOW(v) ((uint32_t)((uint32_t)(v) << BP_CRC_GPOLY_LOW) & BM_CRC_GPOLY_LOW)
642 /*! @brief Set the LOW field to a new value. */
643 #define BW_CRC_GPOLY_LOW(x, v) (HW_CRC_GPOLY_WR(x, (HW_CRC_GPOLY_RD(x) & ~BM_CRC_GPOLY_LOW) | BF_CRC_GPOLY_LOW(v)))
647 * @name Register CRC_GPOLY, field HIGH[31:16] (RW)
649 * Writable and readable in 32-bit CRC mode (CTRL[TCRC] is 1). This field is not
650 * writable in 16-bit CRC mode (CTRL[TCRC] is 0).
653 #define BP_CRC_GPOLY_HIGH (16U) /*!< Bit position for CRC_GPOLY_HIGH. */
654 #define BM_CRC_GPOLY_HIGH (0xFFFF0000U) /*!< Bit mask for CRC_GPOLY_HIGH. */
655 #define BS_CRC_GPOLY_HIGH (16U) /*!< Bit field size in bits for CRC_GPOLY_HIGH. */
657 /*! @brief Read current value of the CRC_GPOLY_HIGH field. */
658 #define BR_CRC_GPOLY_HIGH(x) (HW_CRC_GPOLY(x).B.HIGH)
660 /*! @brief Format value for bitfield CRC_GPOLY_HIGH. */
661 #define BF_CRC_GPOLY_HIGH(v) ((uint32_t)((uint32_t)(v) << BP_CRC_GPOLY_HIGH) & BM_CRC_GPOLY_HIGH)
663 /*! @brief Set the HIGH field to a new value. */
664 #define BW_CRC_GPOLY_HIGH(x, v) (HW_CRC_GPOLY_WR(x, (HW_CRC_GPOLY_RD(x) & ~BM_CRC_GPOLY_HIGH) | BF_CRC_GPOLY_HIGH(v)))
666 /*******************************************************************************
667 * HW_CRC_GPOLYL - CRC_GPOLYL register.
668 ******************************************************************************/
671 * @brief HW_CRC_GPOLYL - CRC_GPOLYL register. (RW)
673 * Reset value: 0xFFFFU
675 typedef union _hw_crc_gpolyl
678 struct _hw_crc_gpolyl_bitfields
680 uint16_t GPOLYL
: 16; /*!< [15:0] POLYL stores the lower 16 bits of
681 * the 16/32 bit CRC polynomial value */
686 * @name Constants and macros for entire CRC_GPOLYL register
689 #define HW_CRC_GPOLYL_ADDR(x) ((x) + 0x4U)
691 #define HW_CRC_GPOLYL(x) (*(__IO hw_crc_gpolyl_t *) HW_CRC_GPOLYL_ADDR(x))
692 #define HW_CRC_GPOLYL_RD(x) (HW_CRC_GPOLYL(x).U)
693 #define HW_CRC_GPOLYL_WR(x, v) (HW_CRC_GPOLYL(x).U = (v))
694 #define HW_CRC_GPOLYL_SET(x, v) (HW_CRC_GPOLYL_WR(x, HW_CRC_GPOLYL_RD(x) | (v)))
695 #define HW_CRC_GPOLYL_CLR(x, v) (HW_CRC_GPOLYL_WR(x, HW_CRC_GPOLYL_RD(x) & ~(v)))
696 #define HW_CRC_GPOLYL_TOG(x, v) (HW_CRC_GPOLYL_WR(x, HW_CRC_GPOLYL_RD(x) ^ (v)))
700 * Constants & macros for individual CRC_GPOLYL bitfields
704 * @name Register CRC_GPOLYL, field GPOLYL[15:0] (RW)
707 #define BP_CRC_GPOLYL_GPOLYL (0U) /*!< Bit position for CRC_GPOLYL_GPOLYL. */
708 #define BM_CRC_GPOLYL_GPOLYL (0xFFFFU) /*!< Bit mask for CRC_GPOLYL_GPOLYL. */
709 #define BS_CRC_GPOLYL_GPOLYL (16U) /*!< Bit field size in bits for CRC_GPOLYL_GPOLYL. */
711 /*! @brief Read current value of the CRC_GPOLYL_GPOLYL field. */
712 #define BR_CRC_GPOLYL_GPOLYL(x) (HW_CRC_GPOLYL(x).U)
714 /*! @brief Format value for bitfield CRC_GPOLYL_GPOLYL. */
715 #define BF_CRC_GPOLYL_GPOLYL(v) ((uint16_t)((uint16_t)(v) << BP_CRC_GPOLYL_GPOLYL) & BM_CRC_GPOLYL_GPOLYL)
717 /*! @brief Set the GPOLYL field to a new value. */
718 #define BW_CRC_GPOLYL_GPOLYL(x, v) (HW_CRC_GPOLYL_WR(x, v))
720 /*******************************************************************************
721 * HW_CRC_GPOLYH - CRC_GPOLYH register.
722 ******************************************************************************/
725 * @brief HW_CRC_GPOLYH - CRC_GPOLYH register. (RW)
727 * Reset value: 0xFFFFU
729 typedef union _hw_crc_gpolyh
732 struct _hw_crc_gpolyh_bitfields
734 uint16_t GPOLYH
: 16; /*!< [15:0] POLYH stores the high 16 bits of
735 * the 16/32 bit CRC polynomial value */
740 * @name Constants and macros for entire CRC_GPOLYH register
743 #define HW_CRC_GPOLYH_ADDR(x) ((x) + 0x6U)
745 #define HW_CRC_GPOLYH(x) (*(__IO hw_crc_gpolyh_t *) HW_CRC_GPOLYH_ADDR(x))
746 #define HW_CRC_GPOLYH_RD(x) (HW_CRC_GPOLYH(x).U)
747 #define HW_CRC_GPOLYH_WR(x, v) (HW_CRC_GPOLYH(x).U = (v))
748 #define HW_CRC_GPOLYH_SET(x, v) (HW_CRC_GPOLYH_WR(x, HW_CRC_GPOLYH_RD(x) | (v)))
749 #define HW_CRC_GPOLYH_CLR(x, v) (HW_CRC_GPOLYH_WR(x, HW_CRC_GPOLYH_RD(x) & ~(v)))
750 #define HW_CRC_GPOLYH_TOG(x, v) (HW_CRC_GPOLYH_WR(x, HW_CRC_GPOLYH_RD(x) ^ (v)))
754 * Constants & macros for individual CRC_GPOLYH bitfields
758 * @name Register CRC_GPOLYH, field GPOLYH[15:0] (RW)
761 #define BP_CRC_GPOLYH_GPOLYH (0U) /*!< Bit position for CRC_GPOLYH_GPOLYH. */
762 #define BM_CRC_GPOLYH_GPOLYH (0xFFFFU) /*!< Bit mask for CRC_GPOLYH_GPOLYH. */
763 #define BS_CRC_GPOLYH_GPOLYH (16U) /*!< Bit field size in bits for CRC_GPOLYH_GPOLYH. */
765 /*! @brief Read current value of the CRC_GPOLYH_GPOLYH field. */
766 #define BR_CRC_GPOLYH_GPOLYH(x) (HW_CRC_GPOLYH(x).U)
768 /*! @brief Format value for bitfield CRC_GPOLYH_GPOLYH. */
769 #define BF_CRC_GPOLYH_GPOLYH(v) ((uint16_t)((uint16_t)(v) << BP_CRC_GPOLYH_GPOLYH) & BM_CRC_GPOLYH_GPOLYH)
771 /*! @brief Set the GPOLYH field to a new value. */
772 #define BW_CRC_GPOLYH_GPOLYH(x, v) (HW_CRC_GPOLYH_WR(x, v))
774 /*******************************************************************************
775 * HW_CRC_GPOLYLL - CRC_GPOLYLL register.
776 ******************************************************************************/
779 * @brief HW_CRC_GPOLYLL - CRC_GPOLYLL register. (RW)
783 typedef union _hw_crc_gpolyll
786 struct _hw_crc_gpolyll_bitfields
788 uint8_t GPOLYLL
: 8; /*!< [7:0] POLYLL stores the first 8 bits of the
794 * @name Constants and macros for entire CRC_GPOLYLL register
797 #define HW_CRC_GPOLYLL_ADDR(x) ((x) + 0x4U)
799 #define HW_CRC_GPOLYLL(x) (*(__IO hw_crc_gpolyll_t *) HW_CRC_GPOLYLL_ADDR(x))
800 #define HW_CRC_GPOLYLL_RD(x) (HW_CRC_GPOLYLL(x).U)
801 #define HW_CRC_GPOLYLL_WR(x, v) (HW_CRC_GPOLYLL(x).U = (v))
802 #define HW_CRC_GPOLYLL_SET(x, v) (HW_CRC_GPOLYLL_WR(x, HW_CRC_GPOLYLL_RD(x) | (v)))
803 #define HW_CRC_GPOLYLL_CLR(x, v) (HW_CRC_GPOLYLL_WR(x, HW_CRC_GPOLYLL_RD(x) & ~(v)))
804 #define HW_CRC_GPOLYLL_TOG(x, v) (HW_CRC_GPOLYLL_WR(x, HW_CRC_GPOLYLL_RD(x) ^ (v)))
808 * Constants & macros for individual CRC_GPOLYLL bitfields
812 * @name Register CRC_GPOLYLL, field GPOLYLL[7:0] (RW)
815 #define BP_CRC_GPOLYLL_GPOLYLL (0U) /*!< Bit position for CRC_GPOLYLL_GPOLYLL. */
816 #define BM_CRC_GPOLYLL_GPOLYLL (0xFFU) /*!< Bit mask for CRC_GPOLYLL_GPOLYLL. */
817 #define BS_CRC_GPOLYLL_GPOLYLL (8U) /*!< Bit field size in bits for CRC_GPOLYLL_GPOLYLL. */
819 /*! @brief Read current value of the CRC_GPOLYLL_GPOLYLL field. */
820 #define BR_CRC_GPOLYLL_GPOLYLL(x) (HW_CRC_GPOLYLL(x).U)
822 /*! @brief Format value for bitfield CRC_GPOLYLL_GPOLYLL. */
823 #define BF_CRC_GPOLYLL_GPOLYLL(v) ((uint8_t)((uint8_t)(v) << BP_CRC_GPOLYLL_GPOLYLL) & BM_CRC_GPOLYLL_GPOLYLL)
825 /*! @brief Set the GPOLYLL field to a new value. */
826 #define BW_CRC_GPOLYLL_GPOLYLL(x, v) (HW_CRC_GPOLYLL_WR(x, v))
828 /*******************************************************************************
829 * HW_CRC_GPOLYLU - CRC_GPOLYLU register.
830 ******************************************************************************/
833 * @brief HW_CRC_GPOLYLU - CRC_GPOLYLU register. (RW)
837 typedef union _hw_crc_gpolylu
840 struct _hw_crc_gpolylu_bitfields
842 uint8_t GPOLYLU
: 8; /*!< [7:0] POLYLL stores the second 8 bits of
848 * @name Constants and macros for entire CRC_GPOLYLU register
851 #define HW_CRC_GPOLYLU_ADDR(x) ((x) + 0x5U)
853 #define HW_CRC_GPOLYLU(x) (*(__IO hw_crc_gpolylu_t *) HW_CRC_GPOLYLU_ADDR(x))
854 #define HW_CRC_GPOLYLU_RD(x) (HW_CRC_GPOLYLU(x).U)
855 #define HW_CRC_GPOLYLU_WR(x, v) (HW_CRC_GPOLYLU(x).U = (v))
856 #define HW_CRC_GPOLYLU_SET(x, v) (HW_CRC_GPOLYLU_WR(x, HW_CRC_GPOLYLU_RD(x) | (v)))
857 #define HW_CRC_GPOLYLU_CLR(x, v) (HW_CRC_GPOLYLU_WR(x, HW_CRC_GPOLYLU_RD(x) & ~(v)))
858 #define HW_CRC_GPOLYLU_TOG(x, v) (HW_CRC_GPOLYLU_WR(x, HW_CRC_GPOLYLU_RD(x) ^ (v)))
862 * Constants & macros for individual CRC_GPOLYLU bitfields
866 * @name Register CRC_GPOLYLU, field GPOLYLU[7:0] (RW)
869 #define BP_CRC_GPOLYLU_GPOLYLU (0U) /*!< Bit position for CRC_GPOLYLU_GPOLYLU. */
870 #define BM_CRC_GPOLYLU_GPOLYLU (0xFFU) /*!< Bit mask for CRC_GPOLYLU_GPOLYLU. */
871 #define BS_CRC_GPOLYLU_GPOLYLU (8U) /*!< Bit field size in bits for CRC_GPOLYLU_GPOLYLU. */
873 /*! @brief Read current value of the CRC_GPOLYLU_GPOLYLU field. */
874 #define BR_CRC_GPOLYLU_GPOLYLU(x) (HW_CRC_GPOLYLU(x).U)
876 /*! @brief Format value for bitfield CRC_GPOLYLU_GPOLYLU. */
877 #define BF_CRC_GPOLYLU_GPOLYLU(v) ((uint8_t)((uint8_t)(v) << BP_CRC_GPOLYLU_GPOLYLU) & BM_CRC_GPOLYLU_GPOLYLU)
879 /*! @brief Set the GPOLYLU field to a new value. */
880 #define BW_CRC_GPOLYLU_GPOLYLU(x, v) (HW_CRC_GPOLYLU_WR(x, v))
882 /*******************************************************************************
883 * HW_CRC_GPOLYHL - CRC_GPOLYHL register.
884 ******************************************************************************/
887 * @brief HW_CRC_GPOLYHL - CRC_GPOLYHL register. (RW)
891 typedef union _hw_crc_gpolyhl
894 struct _hw_crc_gpolyhl_bitfields
896 uint8_t GPOLYHL
: 8; /*!< [7:0] POLYHL stores the third 8 bits of the
902 * @name Constants and macros for entire CRC_GPOLYHL register
905 #define HW_CRC_GPOLYHL_ADDR(x) ((x) + 0x6U)
907 #define HW_CRC_GPOLYHL(x) (*(__IO hw_crc_gpolyhl_t *) HW_CRC_GPOLYHL_ADDR(x))
908 #define HW_CRC_GPOLYHL_RD(x) (HW_CRC_GPOLYHL(x).U)
909 #define HW_CRC_GPOLYHL_WR(x, v) (HW_CRC_GPOLYHL(x).U = (v))
910 #define HW_CRC_GPOLYHL_SET(x, v) (HW_CRC_GPOLYHL_WR(x, HW_CRC_GPOLYHL_RD(x) | (v)))
911 #define HW_CRC_GPOLYHL_CLR(x, v) (HW_CRC_GPOLYHL_WR(x, HW_CRC_GPOLYHL_RD(x) & ~(v)))
912 #define HW_CRC_GPOLYHL_TOG(x, v) (HW_CRC_GPOLYHL_WR(x, HW_CRC_GPOLYHL_RD(x) ^ (v)))
916 * Constants & macros for individual CRC_GPOLYHL bitfields
920 * @name Register CRC_GPOLYHL, field GPOLYHL[7:0] (RW)
923 #define BP_CRC_GPOLYHL_GPOLYHL (0U) /*!< Bit position for CRC_GPOLYHL_GPOLYHL. */
924 #define BM_CRC_GPOLYHL_GPOLYHL (0xFFU) /*!< Bit mask for CRC_GPOLYHL_GPOLYHL. */
925 #define BS_CRC_GPOLYHL_GPOLYHL (8U) /*!< Bit field size in bits for CRC_GPOLYHL_GPOLYHL. */
927 /*! @brief Read current value of the CRC_GPOLYHL_GPOLYHL field. */
928 #define BR_CRC_GPOLYHL_GPOLYHL(x) (HW_CRC_GPOLYHL(x).U)
930 /*! @brief Format value for bitfield CRC_GPOLYHL_GPOLYHL. */
931 #define BF_CRC_GPOLYHL_GPOLYHL(v) ((uint8_t)((uint8_t)(v) << BP_CRC_GPOLYHL_GPOLYHL) & BM_CRC_GPOLYHL_GPOLYHL)
933 /*! @brief Set the GPOLYHL field to a new value. */
934 #define BW_CRC_GPOLYHL_GPOLYHL(x, v) (HW_CRC_GPOLYHL_WR(x, v))
936 /*******************************************************************************
937 * HW_CRC_GPOLYHU - CRC_GPOLYHU register.
938 ******************************************************************************/
941 * @brief HW_CRC_GPOLYHU - CRC_GPOLYHU register. (RW)
945 typedef union _hw_crc_gpolyhu
948 struct _hw_crc_gpolyhu_bitfields
950 uint8_t GPOLYHU
: 8; /*!< [7:0] POLYHU stores the fourth 8 bits of
956 * @name Constants and macros for entire CRC_GPOLYHU register
959 #define HW_CRC_GPOLYHU_ADDR(x) ((x) + 0x7U)
961 #define HW_CRC_GPOLYHU(x) (*(__IO hw_crc_gpolyhu_t *) HW_CRC_GPOLYHU_ADDR(x))
962 #define HW_CRC_GPOLYHU_RD(x) (HW_CRC_GPOLYHU(x).U)
963 #define HW_CRC_GPOLYHU_WR(x, v) (HW_CRC_GPOLYHU(x).U = (v))
964 #define HW_CRC_GPOLYHU_SET(x, v) (HW_CRC_GPOLYHU_WR(x, HW_CRC_GPOLYHU_RD(x) | (v)))
965 #define HW_CRC_GPOLYHU_CLR(x, v) (HW_CRC_GPOLYHU_WR(x, HW_CRC_GPOLYHU_RD(x) & ~(v)))
966 #define HW_CRC_GPOLYHU_TOG(x, v) (HW_CRC_GPOLYHU_WR(x, HW_CRC_GPOLYHU_RD(x) ^ (v)))
970 * Constants & macros for individual CRC_GPOLYHU bitfields
974 * @name Register CRC_GPOLYHU, field GPOLYHU[7:0] (RW)
977 #define BP_CRC_GPOLYHU_GPOLYHU (0U) /*!< Bit position for CRC_GPOLYHU_GPOLYHU. */
978 #define BM_CRC_GPOLYHU_GPOLYHU (0xFFU) /*!< Bit mask for CRC_GPOLYHU_GPOLYHU. */
979 #define BS_CRC_GPOLYHU_GPOLYHU (8U) /*!< Bit field size in bits for CRC_GPOLYHU_GPOLYHU. */
981 /*! @brief Read current value of the CRC_GPOLYHU_GPOLYHU field. */
982 #define BR_CRC_GPOLYHU_GPOLYHU(x) (HW_CRC_GPOLYHU(x).U)
984 /*! @brief Format value for bitfield CRC_GPOLYHU_GPOLYHU. */
985 #define BF_CRC_GPOLYHU_GPOLYHU(v) ((uint8_t)((uint8_t)(v) << BP_CRC_GPOLYHU_GPOLYHU) & BM_CRC_GPOLYHU_GPOLYHU)
987 /*! @brief Set the GPOLYHU field to a new value. */
988 #define BW_CRC_GPOLYHU_GPOLYHU(x, v) (HW_CRC_GPOLYHU_WR(x, v))
991 /*******************************************************************************
992 * HW_CRC_CTRL - CRC Control register
993 ******************************************************************************/
996 * @brief HW_CRC_CTRL - CRC Control register (RW)
998 * Reset value: 0x00000000U
1000 * This register controls the configuration and working of the CRC module.
1001 * Appropriate bits must be set before starting a new CRC calculation. A new CRC
1002 * calculation is initialized by asserting CTRL[WAS] and then writing the seed into
1003 * the CRC data register.
1005 typedef union _hw_crc_ctrl
1008 struct _hw_crc_ctrl_bitfields
1010 uint32_t RESERVED0
: 24; /*!< [23:0] */
1011 uint32_t TCRC
: 1; /*!< [24] */
1012 uint32_t WAS
: 1; /*!< [25] Write CRC Data Register As Seed */
1013 uint32_t FXOR
: 1; /*!< [26] Complement Read Of CRC Data Register */
1014 uint32_t RESERVED1
: 1; /*!< [27] */
1015 uint32_t TOTR
: 2; /*!< [29:28] Type Of Transpose For Read */
1016 uint32_t TOT
: 2; /*!< [31:30] Type Of Transpose For Writes */
1021 * @name Constants and macros for entire CRC_CTRL register
1024 #define HW_CRC_CTRL_ADDR(x) ((x) + 0x8U)
1026 #define HW_CRC_CTRL(x) (*(__IO hw_crc_ctrl_t *) HW_CRC_CTRL_ADDR(x))
1027 #define HW_CRC_CTRL_RD(x) (HW_CRC_CTRL(x).U)
1028 #define HW_CRC_CTRL_WR(x, v) (HW_CRC_CTRL(x).U = (v))
1029 #define HW_CRC_CTRL_SET(x, v) (HW_CRC_CTRL_WR(x, HW_CRC_CTRL_RD(x) | (v)))
1030 #define HW_CRC_CTRL_CLR(x, v) (HW_CRC_CTRL_WR(x, HW_CRC_CTRL_RD(x) & ~(v)))
1031 #define HW_CRC_CTRL_TOG(x, v) (HW_CRC_CTRL_WR(x, HW_CRC_CTRL_RD(x) ^ (v)))
1035 * Constants & macros for individual CRC_CTRL bitfields
1039 * @name Register CRC_CTRL, field TCRC[24] (RW)
1041 * Width of CRC protocol.
1044 * - 0 - 16-bit CRC protocol.
1045 * - 1 - 32-bit CRC protocol.
1048 #define BP_CRC_CTRL_TCRC (24U) /*!< Bit position for CRC_CTRL_TCRC. */
1049 #define BM_CRC_CTRL_TCRC (0x01000000U) /*!< Bit mask for CRC_CTRL_TCRC. */
1050 #define BS_CRC_CTRL_TCRC (1U) /*!< Bit field size in bits for CRC_CTRL_TCRC. */
1052 /*! @brief Read current value of the CRC_CTRL_TCRC field. */
1053 #define BR_CRC_CTRL_TCRC(x) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_TCRC))
1055 /*! @brief Format value for bitfield CRC_CTRL_TCRC. */
1056 #define BF_CRC_CTRL_TCRC(v) ((uint32_t)((uint32_t)(v) << BP_CRC_CTRL_TCRC) & BM_CRC_CTRL_TCRC)
1058 /*! @brief Set the TCRC field to a new value. */
1059 #define BW_CRC_CTRL_TCRC(x, v) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_TCRC) = (v))
1063 * @name Register CRC_CTRL, field WAS[25] (RW)
1065 * When asserted, a value written to the CRC data register is considered a seed
1066 * value. When deasserted, a value written to the CRC data register is taken as
1067 * data for CRC computation.
1070 * - 0 - Writes to the CRC data register are data values.
1071 * - 1 - Writes to the CRC data register are seed values.
1074 #define BP_CRC_CTRL_WAS (25U) /*!< Bit position for CRC_CTRL_WAS. */
1075 #define BM_CRC_CTRL_WAS (0x02000000U) /*!< Bit mask for CRC_CTRL_WAS. */
1076 #define BS_CRC_CTRL_WAS (1U) /*!< Bit field size in bits for CRC_CTRL_WAS. */
1078 /*! @brief Read current value of the CRC_CTRL_WAS field. */
1079 #define BR_CRC_CTRL_WAS(x) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_WAS))
1081 /*! @brief Format value for bitfield CRC_CTRL_WAS. */
1082 #define BF_CRC_CTRL_WAS(v) ((uint32_t)((uint32_t)(v) << BP_CRC_CTRL_WAS) & BM_CRC_CTRL_WAS)
1084 /*! @brief Set the WAS field to a new value. */
1085 #define BW_CRC_CTRL_WAS(x, v) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_WAS) = (v))
1089 * @name Register CRC_CTRL, field FXOR[26] (RW)
1091 * Some CRC protocols require the final checksum to be XORed with 0xFFFFFFFF or
1092 * 0xFFFF. Asserting this bit enables on the fly complementing of read data.
1095 * - 0 - No XOR on reading.
1096 * - 1 - Invert or complement the read value of the CRC Data register.
1099 #define BP_CRC_CTRL_FXOR (26U) /*!< Bit position for CRC_CTRL_FXOR. */
1100 #define BM_CRC_CTRL_FXOR (0x04000000U) /*!< Bit mask for CRC_CTRL_FXOR. */
1101 #define BS_CRC_CTRL_FXOR (1U) /*!< Bit field size in bits for CRC_CTRL_FXOR. */
1103 /*! @brief Read current value of the CRC_CTRL_FXOR field. */
1104 #define BR_CRC_CTRL_FXOR(x) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_FXOR))
1106 /*! @brief Format value for bitfield CRC_CTRL_FXOR. */
1107 #define BF_CRC_CTRL_FXOR(v) ((uint32_t)((uint32_t)(v) << BP_CRC_CTRL_FXOR) & BM_CRC_CTRL_FXOR)
1109 /*! @brief Set the FXOR field to a new value. */
1110 #define BW_CRC_CTRL_FXOR(x, v) (BITBAND_ACCESS32(HW_CRC_CTRL_ADDR(x), BP_CRC_CTRL_FXOR) = (v))
1114 * @name Register CRC_CTRL, field TOTR[29:28] (RW)
1116 * Identifies the transpose configuration of the value read from the CRC Data
1117 * register. See the description of the transpose feature for the available
1118 * transpose options.
1121 * - 00 - No transposition.
1122 * - 01 - Bits in bytes are transposed; bytes are not transposed.
1123 * - 10 - Both bits in bytes and bytes are transposed.
1124 * - 11 - Only bytes are transposed; no bits in a byte are transposed.
1127 #define BP_CRC_CTRL_TOTR (28U) /*!< Bit position for CRC_CTRL_TOTR. */
1128 #define BM_CRC_CTRL_TOTR (0x30000000U) /*!< Bit mask for CRC_CTRL_TOTR. */
1129 #define BS_CRC_CTRL_TOTR (2U) /*!< Bit field size in bits for CRC_CTRL_TOTR. */
1131 /*! @brief Read current value of the CRC_CTRL_TOTR field. */
1132 #define BR_CRC_CTRL_TOTR(x) (HW_CRC_CTRL(x).B.TOTR)
1134 /*! @brief Format value for bitfield CRC_CTRL_TOTR. */
1135 #define BF_CRC_CTRL_TOTR(v) ((uint32_t)((uint32_t)(v) << BP_CRC_CTRL_TOTR) & BM_CRC_CTRL_TOTR)
1137 /*! @brief Set the TOTR field to a new value. */
1138 #define BW_CRC_CTRL_TOTR(x, v) (HW_CRC_CTRL_WR(x, (HW_CRC_CTRL_RD(x) & ~BM_CRC_CTRL_TOTR) | BF_CRC_CTRL_TOTR(v)))
1142 * @name Register CRC_CTRL, field TOT[31:30] (RW)
1144 * Defines the transpose configuration of the data written to the CRC data
1145 * register. See the description of the transpose feature for the available transpose
1149 * - 00 - No transposition.
1150 * - 01 - Bits in bytes are transposed; bytes are not transposed.
1151 * - 10 - Both bits in bytes and bytes are transposed.
1152 * - 11 - Only bytes are transposed; no bits in a byte are transposed.
1155 #define BP_CRC_CTRL_TOT (30U) /*!< Bit position for CRC_CTRL_TOT. */
1156 #define BM_CRC_CTRL_TOT (0xC0000000U) /*!< Bit mask for CRC_CTRL_TOT. */
1157 #define BS_CRC_CTRL_TOT (2U) /*!< Bit field size in bits for CRC_CTRL_TOT. */
1159 /*! @brief Read current value of the CRC_CTRL_TOT field. */
1160 #define BR_CRC_CTRL_TOT(x) (HW_CRC_CTRL(x).B.TOT)
1162 /*! @brief Format value for bitfield CRC_CTRL_TOT. */
1163 #define BF_CRC_CTRL_TOT(v) ((uint32_t)((uint32_t)(v) << BP_CRC_CTRL_TOT) & BM_CRC_CTRL_TOT)
1165 /*! @brief Set the TOT field to a new value. */
1166 #define BW_CRC_CTRL_TOT(x, v) (HW_CRC_CTRL_WR(x, (HW_CRC_CTRL_RD(x) & ~BM_CRC_CTRL_TOT) | BF_CRC_CTRL_TOT(v)))
1168 /*******************************************************************************
1169 * HW_CRC_CTRLHU - CRC_CTRLHU register.
1170 ******************************************************************************/
1173 * @brief HW_CRC_CTRLHU - CRC_CTRLHU register. (RW)
1175 * Reset value: 0x00U
1177 typedef union _hw_crc_ctrlhu
1180 struct _hw_crc_ctrlhu_bitfields
1182 uint8_t TCRC
: 1; /*!< [0] */
1183 uint8_t WAS
: 1; /*!< [1] */
1184 uint8_t FXOR
: 1; /*!< [2] */
1185 uint8_t RESERVED0
: 1; /*!< [3] */
1186 uint8_t TOTR
: 2; /*!< [5:4] */
1187 uint8_t TOT
: 2; /*!< [7:6] */
1192 * @name Constants and macros for entire CRC_CTRLHU register
1195 #define HW_CRC_CTRLHU_ADDR(x) ((x) + 0xBU)
1197 #define HW_CRC_CTRLHU(x) (*(__IO hw_crc_ctrlhu_t *) HW_CRC_CTRLHU_ADDR(x))
1198 #define HW_CRC_CTRLHU_RD(x) (HW_CRC_CTRLHU(x).U)
1199 #define HW_CRC_CTRLHU_WR(x, v) (HW_CRC_CTRLHU(x).U = (v))
1200 #define HW_CRC_CTRLHU_SET(x, v) (HW_CRC_CTRLHU_WR(x, HW_CRC_CTRLHU_RD(x) | (v)))
1201 #define HW_CRC_CTRLHU_CLR(x, v) (HW_CRC_CTRLHU_WR(x, HW_CRC_CTRLHU_RD(x) & ~(v)))
1202 #define HW_CRC_CTRLHU_TOG(x, v) (HW_CRC_CTRLHU_WR(x, HW_CRC_CTRLHU_RD(x) ^ (v)))
1206 * Constants & macros for individual CRC_CTRLHU bitfields
1210 * @name Register CRC_CTRLHU, field TCRC[0] (RW)
1213 * - 0 - 16-bit CRC protocol.
1214 * - 1 - 32-bit CRC protocol.
1217 #define BP_CRC_CTRLHU_TCRC (0U) /*!< Bit position for CRC_CTRLHU_TCRC. */
1218 #define BM_CRC_CTRLHU_TCRC (0x01U) /*!< Bit mask for CRC_CTRLHU_TCRC. */
1219 #define BS_CRC_CTRLHU_TCRC (1U) /*!< Bit field size in bits for CRC_CTRLHU_TCRC. */
1221 /*! @brief Read current value of the CRC_CTRLHU_TCRC field. */
1222 #define BR_CRC_CTRLHU_TCRC(x) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_TCRC))
1224 /*! @brief Format value for bitfield CRC_CTRLHU_TCRC. */
1225 #define BF_CRC_CTRLHU_TCRC(v) ((uint8_t)((uint8_t)(v) << BP_CRC_CTRLHU_TCRC) & BM_CRC_CTRLHU_TCRC)
1227 /*! @brief Set the TCRC field to a new value. */
1228 #define BW_CRC_CTRLHU_TCRC(x, v) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_TCRC) = (v))
1232 * @name Register CRC_CTRLHU, field WAS[1] (RW)
1235 * - 0 - Writes to CRC data register are data values.
1236 * - 1 - Writes to CRC data reguster are seed values.
1239 #define BP_CRC_CTRLHU_WAS (1U) /*!< Bit position for CRC_CTRLHU_WAS. */
1240 #define BM_CRC_CTRLHU_WAS (0x02U) /*!< Bit mask for CRC_CTRLHU_WAS. */
1241 #define BS_CRC_CTRLHU_WAS (1U) /*!< Bit field size in bits for CRC_CTRLHU_WAS. */
1243 /*! @brief Read current value of the CRC_CTRLHU_WAS field. */
1244 #define BR_CRC_CTRLHU_WAS(x) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_WAS))
1246 /*! @brief Format value for bitfield CRC_CTRLHU_WAS. */
1247 #define BF_CRC_CTRLHU_WAS(v) ((uint8_t)((uint8_t)(v) << BP_CRC_CTRLHU_WAS) & BM_CRC_CTRLHU_WAS)
1249 /*! @brief Set the WAS field to a new value. */
1250 #define BW_CRC_CTRLHU_WAS(x, v) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_WAS) = (v))
1254 * @name Register CRC_CTRLHU, field FXOR[2] (RW)
1257 * - 0 - No XOR on reading.
1258 * - 1 - Invert or complement the read value of CRC data register.
1261 #define BP_CRC_CTRLHU_FXOR (2U) /*!< Bit position for CRC_CTRLHU_FXOR. */
1262 #define BM_CRC_CTRLHU_FXOR (0x04U) /*!< Bit mask for CRC_CTRLHU_FXOR. */
1263 #define BS_CRC_CTRLHU_FXOR (1U) /*!< Bit field size in bits for CRC_CTRLHU_FXOR. */
1265 /*! @brief Read current value of the CRC_CTRLHU_FXOR field. */
1266 #define BR_CRC_CTRLHU_FXOR(x) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_FXOR))
1268 /*! @brief Format value for bitfield CRC_CTRLHU_FXOR. */
1269 #define BF_CRC_CTRLHU_FXOR(v) ((uint8_t)((uint8_t)(v) << BP_CRC_CTRLHU_FXOR) & BM_CRC_CTRLHU_FXOR)
1271 /*! @brief Set the FXOR field to a new value. */
1272 #define BW_CRC_CTRLHU_FXOR(x, v) (BITBAND_ACCESS8(HW_CRC_CTRLHU_ADDR(x), BP_CRC_CTRLHU_FXOR) = (v))
1276 * @name Register CRC_CTRLHU, field TOTR[5:4] (RW)
1279 * - 00 - No Transposition.
1280 * - 01 - Bits in bytes are transposed, bytes are not transposed.
1281 * - 10 - Both bits in bytes and bytes are transposed.
1282 * - 11 - Only bytes are transposed; no bits in a byte are transposed.
1285 #define BP_CRC_CTRLHU_TOTR (4U) /*!< Bit position for CRC_CTRLHU_TOTR. */
1286 #define BM_CRC_CTRLHU_TOTR (0x30U) /*!< Bit mask for CRC_CTRLHU_TOTR. */
1287 #define BS_CRC_CTRLHU_TOTR (2U) /*!< Bit field size in bits for CRC_CTRLHU_TOTR. */
1289 /*! @brief Read current value of the CRC_CTRLHU_TOTR field. */
1290 #define BR_CRC_CTRLHU_TOTR(x) (HW_CRC_CTRLHU(x).B.TOTR)
1292 /*! @brief Format value for bitfield CRC_CTRLHU_TOTR. */
1293 #define BF_CRC_CTRLHU_TOTR(v) ((uint8_t)((uint8_t)(v) << BP_CRC_CTRLHU_TOTR) & BM_CRC_CTRLHU_TOTR)
1295 /*! @brief Set the TOTR field to a new value. */
1296 #define BW_CRC_CTRLHU_TOTR(x, v) (HW_CRC_CTRLHU_WR(x, (HW_CRC_CTRLHU_RD(x) & ~BM_CRC_CTRLHU_TOTR) | BF_CRC_CTRLHU_TOTR(v)))
1300 * @name Register CRC_CTRLHU, field TOT[7:6] (RW)
1303 * - 00 - No Transposition.
1304 * - 01 - Bits in bytes are transposed, bytes are not transposed.
1305 * - 10 - Both bits in bytes and bytes are transposed.
1306 * - 11 - Only bytes are transposed; no bits in a byte are transposed.
1309 #define BP_CRC_CTRLHU_TOT (6U) /*!< Bit position for CRC_CTRLHU_TOT. */
1310 #define BM_CRC_CTRLHU_TOT (0xC0U) /*!< Bit mask for CRC_CTRLHU_TOT. */
1311 #define BS_CRC_CTRLHU_TOT (2U) /*!< Bit field size in bits for CRC_CTRLHU_TOT. */
1313 /*! @brief Read current value of the CRC_CTRLHU_TOT field. */
1314 #define BR_CRC_CTRLHU_TOT(x) (HW_CRC_CTRLHU(x).B.TOT)
1316 /*! @brief Format value for bitfield CRC_CTRLHU_TOT. */
1317 #define BF_CRC_CTRLHU_TOT(v) ((uint8_t)((uint8_t)(v) << BP_CRC_CTRLHU_TOT) & BM_CRC_CTRLHU_TOT)
1319 /*! @brief Set the TOT field to a new value. */
1320 #define BW_CRC_CTRLHU_TOT(x, v) (HW_CRC_CTRLHU_WR(x, (HW_CRC_CTRLHU_RD(x) & ~BM_CRC_CTRLHU_TOT) | BF_CRC_CTRLHU_TOT(v)))
1324 ** Start of section using anonymous unions
1327 #if defined(__ARMCC_VERSION)
1330 #elif defined(__CWCC__)
1332 #pragma cpp_extensions on
1333 #elif defined(__GNUC__)
1334 /* anonymous unions are enabled by default */
1335 #elif defined(__IAR_SYSTEMS_ICC__)
1336 #pragma language=extended
1338 #error Not supported compiler type
1341 /*******************************************************************************
1342 * hw_crc_t - module struct
1343 ******************************************************************************/
1345 * @brief All CRC module registers.
1348 typedef struct _hw_crc
1352 __IO hw_crc_datal_t DATAL
; /*!< [0x0] CRC_DATAL register. */
1353 __IO hw_crc_datah_t DATAH
; /*!< [0x2] CRC_DATAH register. */
1356 __IO hw_crc_datall_t DATALL
; /*!< [0x0] CRC_DATALL register. */
1357 __IO hw_crc_datalu_t DATALU
; /*!< [0x1] CRC_DATALU register. */
1358 __IO hw_crc_datahl_t DATAHL
; /*!< [0x2] CRC_DATAHL register. */
1359 __IO hw_crc_datahu_t DATAHU
; /*!< [0x3] CRC_DATAHU register. */
1361 __IO hw_crc_data_t DATA
; /*!< [0x0] CRC Data register */
1364 __IO hw_crc_gpoly_t GPOLY
; /*!< [0x4] CRC Polynomial register */
1366 __IO hw_crc_gpolyl_t GPOLYL
; /*!< [0x4] CRC_GPOLYL register. */
1367 __IO hw_crc_gpolyh_t GPOLYH
; /*!< [0x6] CRC_GPOLYH register. */
1368 } GPOLY_ACCESS16BIT
;
1370 __IO hw_crc_gpolyll_t GPOLYLL
; /*!< [0x4] CRC_GPOLYLL register. */
1371 __IO hw_crc_gpolylu_t GPOLYLU
; /*!< [0x5] CRC_GPOLYLU register. */
1372 __IO hw_crc_gpolyhl_t GPOLYHL
; /*!< [0x6] CRC_GPOLYHL register. */
1373 __IO hw_crc_gpolyhu_t GPOLYHU
; /*!< [0x7] CRC_GPOLYHU register. */
1377 __IO hw_crc_ctrl_t CTRL
; /*!< [0x8] CRC Control register */
1379 uint8_t _reserved0
[3];
1380 __IO hw_crc_ctrlhu_t CTRLHU
; /*!< [0xB] CRC_CTRLHU register. */
1386 /*! @brief Macro to access all CRC registers. */
1387 /*! @param x CRC module instance base address. */
1388 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1389 * use the '&' operator, like <code>&HW_CRC(CRC_BASE)</code>. */
1390 #define HW_CRC(x) (*(hw_crc_t *)(x))
1393 ** End of section using anonymous unions
1396 #if defined(__ARMCC_VERSION)
1398 #elif defined(__CWCC__)
1400 #elif defined(__GNUC__)
1401 /* leave anonymous unions enabled */
1402 #elif defined(__IAR_SYSTEMS_ICC__)
1403 #pragma language=default
1405 #error Not supported compiler type
1408 #endif /* __HW_CRC_REGISTERS_H__ */