reg_crc.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /// @file reg_crc.h
  3. /// @author AE TEAM
  4. /// @brief THIS FILE CONTAINS ALL THE FUNCTIONS PROTOTYPES FOR THE SERIES OF
  5. /// MM32 FIRMWARE LIBRARY.
  6. ////////////////////////////////////////////////////////////////////////////////
  7. /// @attention
  8. ///
  9. /// THE EXISTING FIRMWARE IS ONLY FOR REFERENCE, WHICH IS DESIGNED TO PROVIDE
  10. /// CUSTOMERS WITH CODING INFORMATION ABOUT THEIR PRODUCTS SO THEY CAN SAVE
  11. /// TIME. THEREFORE, MINDMOTION SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT OR
  12. /// CONSEQUENTIAL DAMAGES ABOUT ANY CLAIMS ARISING OUT OF THE CONTENT OF SUCH
  13. /// HARDWARE AND/OR THE USE OF THE CODING INFORMATION CONTAINED HEREIN IN
  14. /// CONNECTION WITH PRODUCTS MADE BY CUSTOMERS.
  15. ///
  16. /// <H2><CENTER>&COPY; COPYRIGHT MINDMOTION </CENTER></H2>
  17. ////////////////////////////////////////////////////////////////////////////////
  18. // Define to prevent recursive inclusion
  19. #ifndef __REG_CRC_H
  20. #define __REG_CRC_H
  21. // Files includes
  22. #include <stdint.h>
  23. #include <stdbool.h>
  24. #include "types.h"
  25. #if defined ( __CC_ARM )
  26. #pragma anon_unions
  27. #endif
  28. ////////////////////////////////////////////////////////////////////////////////
  29. /// @brief CRC Base Address Definition
  30. ////////////////////////////////////////////////////////////////////////////////
  31. #define CRC_BASE (AHBPERIPH_BASE + 0x3000) ///< Base Address: 0x40023000
  32. ////////////////////////////////////////////////////////////////////////////////
  33. /// @brief CRC Register Structure Definition
  34. ////////////////////////////////////////////////////////////////////////////////
  35. typedef struct {
  36. __IO u32 DR; ///< CRC data register, offset: 0x00
  37. __IO u32 IDR; ///< CRC independent data register, offset: 0x04
  38. __IO u32 CR; ///< CRC control register, offset: 0x08
  39. __IO u32 MIR; ///< Middle data register, offset: 0x08
  40. } CRC_TypeDef;
  41. ////////////////////////////////////////////////////////////////////////////////
  42. /// @brief CRC type pointer Definition
  43. ////////////////////////////////////////////////////////////////////////////////
  44. #define CRC ((CRC_TypeDef*) CRC_BASE)
  45. ////////////////////////////////////////////////////////////////////////////////
  46. /// @brief CRC_DR Register Bit Definition
  47. ////////////////////////////////////////////////////////////////////////////////
  48. #define CRC_DR_DATA_Pos (0)
  49. #define CRC_DR_DATA (0xFFFFFFFFU << CRC_DR_DATA_Pos) ///< Data register bits
  50. ////////////////////////////////////////////////////////////////////////////////
  51. /// @brief CRC_IDR Register Bit Definition
  52. ////////////////////////////////////////////////////////////////////////////////
  53. #define CRC_IDR_DATA_Pos (0)
  54. #define CRC_IDR_DATA (0xFFU << CRC_IDR_DATA_Pos) ///< General-purpose 8-bit data register bits
  55. ////////////////////////////////////////////////////////////////////////////////
  56. /// @brief CRC_CTRL Register Bit Definition
  57. ////////////////////////////////////////////////////////////////////////////////
  58. #define CRC_CR_RESET_Pos (0)
  59. #define CRC_CR_RESET (0x01U << CRC_CR_RESET_Pos) ///< RESET bit
  60. ////////////////////////////////////////////////////////////////////////////////
  61. /// @brief CRC_MIR Register Bit Definition
  62. ////////////////////////////////////////////////////////////////////////////////
  63. #define CRC_MIR_Pos (0)
  64. #define CRC_MIR (0xFFFFFFFFU << CRC_MIR_Pos) ///< Middle data register
  65. /// @}
  66. /// @}
  67. /// @}
  68. ////////////////////////////////////////////////////////////////////////////////
  69. #endif
  70. ////////////////////////////////////////////////////////////////////////////////