Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 493.25 KB | None | 0 0
  1. #ifndef __STM32F407xx_H_
  2. #define __STM32F407xx_H_
  3.  
  4. #include <stdint.h>
  5.  
  6. template <std::uint32_t... bitmask>
  7. inline constexpr std::uint32_t SetBits()
  8. {
  9.     return (bitmask | ...);
  10. }
  11.  
  12. #define __CM4_REV                     0x0001U
  13. #define __MPU_PRESENT                 1U
  14. #define __NVIC_PRIO_BITS              4U
  15. #define __Vendor_SysTickConfig        0U
  16. #define __FPU_PRESENT                 1U
  17.  
  18. namespace STM32_REGS
  19. {
  20.     enum class IRQn: std::int32_t
  21.     {
  22.         NonMaskableInt                 = -14,
  23.         MemoryManagement               = -12,
  24.         BusFault                       = -11,
  25.         UsageFault                     = -10,
  26.         SVCall                         = -5,
  27.         DebugMonitor                   = -4,
  28.         PendSV                         = -2,
  29.         SysTick                        = -1,
  30.         WWDG                           = 0,
  31.         PVD                            = 1,
  32.         TAMP_STAMP                     = 2,
  33.         RTC_WKUP                       = 3,
  34.         FLASH                          = 4,
  35.         RCC                            = 5,
  36.         EXTI0                          = 6,
  37.         EXTI1                          = 7,
  38.         EXTI2                          = 8,
  39.         EXTI3                          = 9,
  40.         EXTI4                          = 10,
  41.         DMA1_Stream0                   = 11,
  42.         DMA1_Stream1                   = 12,
  43.         DMA1_Stream2                   = 13,
  44.         DMA1_Stream3                   = 14,
  45.         DMA1_Stream4                   = 15,
  46.         DMA1_Stream5                   = 16,
  47.         DMA1_Stream6                   = 17,
  48.         ADC                            = 18,
  49.         CAN1_TX                        = 19,
  50.         CAN1_RX0                       = 20,
  51.         CAN1_RX1                       = 21,
  52.         CAN1_SCE                       = 22,
  53.         EXTI9_5                        = 23,
  54.         TIM1_BRK_TIM9                  = 24,
  55.         TIM1_UP_TIM10                  = 25,
  56.         TIM1_TRG_COM_TIM11             = 26,
  57.         TIM1_CC                        = 27,
  58.         TIM2                           = 28,
  59.         TIM3                           = 29,
  60.         TIM4                           = 30,
  61.         I2C1_EV                        = 31,
  62.         I2C1_ER                        = 32,
  63.         I2C2_EV                        = 33,
  64.         I2C2_ER                        = 34,
  65.         SPI1                           = 35,
  66.         SPI2                           = 36,
  67.         USART1                         = 37,
  68.         USART2                         = 38,
  69.         USART3                         = 39,
  70.         EXTI15_10                      = 40,
  71.         RTC_Alarm                      = 41,
  72.         OTG_FS_WKUP                    = 42,
  73.         TIM8_BRK_TIM12                 = 43,
  74.         TIM8_UP_TIM13                  = 44,
  75.         TIM8_TRG_COM_TIM14             = 45,
  76.         TIM8_CC                        = 46,
  77.         DMA1_Stream7                   = 47,
  78.         FSMC                           = 48,
  79.         SDIO                           = 49,
  80.         TIM5                           = 50,
  81.         SPI3                           = 51,
  82.         UART4                          = 52,
  83.         UART5                          = 53,
  84.         TIM6_DAC                       = 54,
  85.         TIM7                           = 55,
  86.         DMA2_Stream0                   = 56,
  87.         DMA2_Stream1                   = 57,
  88.         DMA2_Stream2                   = 58,
  89.         DMA2_Stream3                   = 59,
  90.         DMA2_Stream4                   = 60,
  91.         ETH                            = 61,
  92.         ETH_WKUP                       = 62,
  93.         CAN2_TX                        = 63,
  94.         CAN2_RX0                       = 64,
  95.         CAN2_RX1                       = 65,
  96.         CAN2_SCE                       = 66,
  97.         OTG_FS                         = 67,
  98.         DMA2_Stream5                   = 68,
  99.         DMA2_Stream6                   = 69,
  100.         DMA2_Stream7                   = 70,
  101.         USART6                         = 71,
  102.         I2C3_EV                        = 72,
  103.         I2C3_ER                        = 73,
  104.         OTG_HS_EP1_OUT                 = 74,
  105.         OTG_HS_EP1_IN                  = 75,
  106.         OTG_HS_WKUP                    = 76,
  107.         OTG_HS                         = 77,
  108.         DCMI                           = 78,
  109.         RNG                            = 80,
  110.         FPU                            = 81,
  111.     };
  112. }
  113.  
  114. //namespace ARM = STM32;
  115.  
  116. #ifdef __cplusplus
  117.   #define   __I     volatile             /*!< Defines 'read only' permissions */
  118. #else
  119.   #define   __I     volatile const       /*!< Defines 'read only' permissions */
  120. #endif
  121. #define     __O     volatile             /*!< Defines 'write only' permissions */
  122. #define     __IO    volatile             /*!< Defines 'read / write' permissions */
  123.  
  124. /* following defines should be used for structure members */
  125. #define     __IM     volatile const      /*! Defines 'read only' structure member permissions */
  126. #define     __OM     volatile            /*! Defines 'write only' structure member permissions */
  127. #define     __IOM    volatile            /*! Defines 'read / write' structure member permissions */
  128.  
  129. //#include "core_cm4.hpp"
  130. //#include "system_stm32f4xx.hpp"
  131. //#include "stdint.hpp"
  132.  
  133. //namespace CORTEX = CM4;
  134.  
  135. namespace STM32
  136. {
  137.     static constexpr std::uint32_t FLASH_BASE                     = 0x08000000U;
  138.     static constexpr std::uint32_t CCMDATARAM_BASE                = 0x10000000U;
  139.     static constexpr std::uint32_t SRAM1_BASE                     = 0x20000000U;
  140.     static constexpr std::uint32_t SRAM2_BASE                     = 0x2001C000U;
  141.     static constexpr std::uint32_t PERIPH_BASE                    = 0x40000000U;
  142.     static constexpr std::uint32_t BKPSRAM_BASE                   = 0x40024000U;
  143.     static constexpr std::uint32_t FSMC_R_BASE                    = 0xA0000000U;
  144.     static constexpr std::uint32_t SRAM1_BB_BASE                  = 0x22000000U;
  145.     static constexpr std::uint32_t SRAM2_BB_BASE                  = 0x22380000U;
  146.     static constexpr std::uint32_t PERIPH_BB_BASE                 = 0x42000000U;
  147.     static constexpr std::uint32_t BKPSRAM_BB_BASE                = 0x42480000U;
  148.     static constexpr std::uint32_t FLASH_END                      = 0x080FFFFFU;
  149.     static constexpr std::uint32_t FLASH_OTP_BASE                 = 0x1FFF7800U;
  150.     static constexpr std::uint32_t FLASH_OTP_END                  = 0x1FFF7A0FU;
  151.     static constexpr std::uint32_t CCMDATARAM_END                 = 0x1000FFFFU;
  152.     static constexpr std::uint32_t SRAM_BASE                      = SRAM1_BASE;
  153.     static constexpr std::uint32_t SRAM_BB_BASE                   = SRAM1_BB_BASE;
  154.     static constexpr std::uint32_t APB1PERIPH_BASE                = PERIPH_BASE;
  155.     static constexpr std::uint32_t APB2PERIPH_BASE                = (PERIPH_BASE + 0x00010000U);
  156.     static constexpr std::uint32_t AHB1PERIPH_BASE                = (PERIPH_BASE + 0x00020000U);
  157.     static constexpr std::uint32_t AHB2PERIPH_BASE                = (PERIPH_BASE + 0x10000000U);
  158.     static constexpr std::uint32_t TIM2_BASE                      = (APB1PERIPH_BASE + 0x0000U);
  159.     static constexpr std::uint32_t TIM3_BASE                      = (APB1PERIPH_BASE + 0x0400U);
  160.     static constexpr std::uint32_t TIM4_BASE                      = (APB1PERIPH_BASE + 0x0800U);
  161.     static constexpr std::uint32_t TIM5_BASE                      = (APB1PERIPH_BASE + 0x0C00U);
  162.     static constexpr std::uint32_t TIM6_BASE                      = (APB1PERIPH_BASE + 0x1000U);
  163.     static constexpr std::uint32_t TIM7_BASE                      = (APB1PERIPH_BASE + 0x1400U);
  164.     static constexpr std::uint32_t TIM12_BASE                     = (APB1PERIPH_BASE + 0x1800U);
  165.     static constexpr std::uint32_t TIM13_BASE                     = (APB1PERIPH_BASE + 0x1C00U);
  166.     static constexpr std::uint32_t TIM14_BASE                     = (APB1PERIPH_BASE + 0x2000U);
  167.     static constexpr std::uint32_t RTC_BASE                       = (APB1PERIPH_BASE + 0x2800U);
  168.     static constexpr std::uint32_t WWDG_BASE                      = (APB1PERIPH_BASE + 0x2C00U);
  169.     static constexpr std::uint32_t IWDG_BASE                      = (APB1PERIPH_BASE + 0x3000U);
  170.     static constexpr std::uint32_t I2S2ext_BASE                   = (APB1PERIPH_BASE + 0x3400U);
  171.     static constexpr std::uint32_t SPI2_BASE                      = (APB1PERIPH_BASE + 0x3800U);
  172.     static constexpr std::uint32_t SPI3_BASE                      = (APB1PERIPH_BASE + 0x3C00U);
  173.     static constexpr std::uint32_t I2S3ext_BASE                   = (APB1PERIPH_BASE + 0x4000U);
  174.     static constexpr std::uint32_t USART2_BASE                    = (APB1PERIPH_BASE + 0x4400U);
  175.     static constexpr std::uint32_t USART3_BASE                    = (APB1PERIPH_BASE + 0x4800U);
  176.     static constexpr std::uint32_t UART4_BASE                     = (APB1PERIPH_BASE + 0x4C00U);
  177.     static constexpr std::uint32_t UART5_BASE                     = (APB1PERIPH_BASE + 0x5000U);
  178.     static constexpr std::uint32_t I2C1_BASE                      = (APB1PERIPH_BASE + 0x5400U);
  179.     static constexpr std::uint32_t I2C2_BASE                      = (APB1PERIPH_BASE + 0x5800U);
  180.     static constexpr std::uint32_t I2C3_BASE                      = (APB1PERIPH_BASE + 0x5C00U);
  181.     static constexpr std::uint32_t CAN1_BASE                      = (APB1PERIPH_BASE + 0x6400U);
  182.     static constexpr std::uint32_t CAN2_BASE                      = (APB1PERIPH_BASE + 0x6800U);
  183.     static constexpr std::uint32_t PWR_BASE                       = (APB1PERIPH_BASE + 0x7000U);
  184.     static constexpr std::uint32_t DAC_BASE                       = (APB1PERIPH_BASE + 0x7400U);
  185.     static constexpr std::uint32_t TIM1_BASE                      = (APB2PERIPH_BASE + 0x0000U);
  186.     static constexpr std::uint32_t TIM8_BASE                      = (APB2PERIPH_BASE + 0x0400U);
  187.     static constexpr std::uint32_t USART1_BASE                    = (APB2PERIPH_BASE + 0x1000U);
  188.     static constexpr std::uint32_t USART6_BASE                    = (APB2PERIPH_BASE + 0x1400U);
  189.     static constexpr std::uint32_t ADC1_BASE                      = (APB2PERIPH_BASE + 0x2000U);
  190.     static constexpr std::uint32_t ADC2_BASE                      = (APB2PERIPH_BASE + 0x2100U);
  191.     static constexpr std::uint32_t ADC3_BASE                      = (APB2PERIPH_BASE + 0x2200U);
  192.     static constexpr std::uint32_t ADC123_COMMON_BASE             = (APB2PERIPH_BASE + 0x2300U);
  193.     static constexpr std::uint32_t ADC_BASE                       = ADC123_COMMON_BASE;
  194.     static constexpr std::uint32_t SDIO_BASE                      = (APB2PERIPH_BASE + 0x2C00U);
  195.     static constexpr std::uint32_t SPI1_BASE                      = (APB2PERIPH_BASE + 0x3000U);
  196.     static constexpr std::uint32_t SYSCFG_BASE                    = (APB2PERIPH_BASE + 0x3800U);
  197.     static constexpr std::uint32_t EXTI_BASE                      = (APB2PERIPH_BASE + 0x3C00U);
  198.     static constexpr std::uint32_t TIM9_BASE                      = (APB2PERIPH_BASE + 0x4000U);
  199.     static constexpr std::uint32_t TIM10_BASE                     = (APB2PERIPH_BASE + 0x4400U);
  200.     static constexpr std::uint32_t TIM11_BASE                     = (APB2PERIPH_BASE + 0x4800U);
  201.     static constexpr std::uint32_t GPIOA_BASE                     = (AHB1PERIPH_BASE + 0x0000U);
  202.     static constexpr std::uint32_t GPIOB_BASE                     = (AHB1PERIPH_BASE + 0x0400U);
  203.     static constexpr std::uint32_t GPIOC_BASE                     = (AHB1PERIPH_BASE + 0x0800U);
  204.     static constexpr std::uint32_t GPIOD_BASE                     = (AHB1PERIPH_BASE + 0x0C00U);
  205.     static constexpr std::uint32_t GPIOE_BASE                     = (AHB1PERIPH_BASE + 0x1000U);
  206.     static constexpr std::uint32_t GPIOF_BASE                     = (AHB1PERIPH_BASE + 0x1400U);
  207.     static constexpr std::uint32_t GPIOG_BASE                     = (AHB1PERIPH_BASE + 0x1800U);
  208.     static constexpr std::uint32_t GPIOH_BASE                     = (AHB1PERIPH_BASE + 0x1C00U);
  209.     static constexpr std::uint32_t GPIOI_BASE                     = (AHB1PERIPH_BASE + 0x2000U);
  210.     static constexpr std::uint32_t CRC_BASE                       = (AHB1PERIPH_BASE + 0x3000U);
  211.     static constexpr std::uint32_t RCC_BASE                       = (AHB1PERIPH_BASE + 0x3800U);
  212.     static constexpr std::uint32_t FLASH_R_BASE                   = (AHB1PERIPH_BASE + 0x3C00U);
  213.     static constexpr std::uint32_t DMA1_BASE                      = (AHB1PERIPH_BASE + 0x6000U);
  214.     static constexpr std::uint32_t DMA1_Stream0_BASE              = (DMA1_BASE + 0x010U);
  215.     static constexpr std::uint32_t DMA1_Stream1_BASE              = (DMA1_BASE + 0x028U);
  216.     static constexpr std::uint32_t DMA1_Stream2_BASE              = (DMA1_BASE + 0x040U);
  217.     static constexpr std::uint32_t DMA1_Stream3_BASE              = (DMA1_BASE + 0x058U);
  218.     static constexpr std::uint32_t DMA1_Stream4_BASE              = (DMA1_BASE + 0x070U);
  219.     static constexpr std::uint32_t DMA1_Stream5_BASE              = (DMA1_BASE + 0x088U);
  220.     static constexpr std::uint32_t DMA1_Stream6_BASE              = (DMA1_BASE + 0x0A0U);
  221.     static constexpr std::uint32_t DMA1_Stream7_BASE              = (DMA1_BASE + 0x0B8U);
  222.     static constexpr std::uint32_t DMA2_BASE                      = (AHB1PERIPH_BASE + 0x6400U);
  223.     static constexpr std::uint32_t DMA2_Stream0_BASE              = (DMA2_BASE + 0x010U);
  224.     static constexpr std::uint32_t DMA2_Stream1_BASE              = (DMA2_BASE + 0x028U);
  225.     static constexpr std::uint32_t DMA2_Stream2_BASE              = (DMA2_BASE + 0x040U);
  226.     static constexpr std::uint32_t DMA2_Stream3_BASE              = (DMA2_BASE + 0x058U);
  227.     static constexpr std::uint32_t DMA2_Stream4_BASE              = (DMA2_BASE + 0x070U);
  228.     static constexpr std::uint32_t DMA2_Stream5_BASE              = (DMA2_BASE + 0x088U);
  229.     static constexpr std::uint32_t DMA2_Stream6_BASE              = (DMA2_BASE + 0x0A0U);
  230.     static constexpr std::uint32_t DMA2_Stream7_BASE              = (DMA2_BASE + 0x0B8U);
  231.     static constexpr std::uint32_t ETH_BASE                       = (AHB1PERIPH_BASE + 0x8000U);
  232.     static constexpr std::uint32_t ETH_MAC_BASE                   = (ETH_BASE);
  233.     static constexpr std::uint32_t ETH_MMC_BASE                   = (ETH_BASE + 0x0100U);
  234.     static constexpr std::uint32_t ETH_PTP_BASE                   = (ETH_BASE + 0x0700U);
  235.     static constexpr std::uint32_t ETH_DMA_BASE                   = (ETH_BASE + 0x1000U);
  236.     static constexpr std::uint32_t DCMI_BASE                      = (AHB2PERIPH_BASE + 0x50000U);
  237.     static constexpr std::uint32_t RNG_BASE                       = (AHB2PERIPH_BASE + 0x60800U);
  238.     static constexpr std::uint32_t FSMC_Bank1_R_BASE              = (FSMC_R_BASE + 0x0000U);
  239.     static constexpr std::uint32_t FSMC_Bank1E_R_BASE             = (FSMC_R_BASE + 0x0104U);
  240.     static constexpr std::uint32_t FSMC_Bank2_3_R_BASE            = (FSMC_R_BASE + 0x0060U);
  241.     static constexpr std::uint32_t FSMC_Bank4_R_BASE              = (FSMC_R_BASE + 0x00A0U);
  242.     static constexpr std::uint32_t DBGMCU_BASE                    = 0xE0042000U;
  243.     static constexpr std::uint32_t USB_OTG_HS_PERIPH_BASE         = 0x40040000U;
  244.     static constexpr std::uint32_t USB_OTG_FS_PERIPH_BASE         = 0x50000000U;
  245.     static constexpr std::uint32_t USB_OTG_GLOBAL_BASE            = 0x000U;
  246.     static constexpr std::uint32_t USB_OTG_DEVICE_BASE            = 0x800U;
  247.     static constexpr std::uint32_t USB_OTG_IN_ENDPOINT_BASE       = 0x900U;
  248.     static constexpr std::uint32_t USB_OTG_OUT_ENDPOINT_BASE      = 0xB00U;
  249.     static constexpr std::uint32_t USB_OTG_EP_REG_SIZE            = 0x20U;
  250.     static constexpr std::uint32_t USB_OTG_HOST_BASE              = 0x400U;
  251.     static constexpr std::uint32_t USB_OTG_HOST_PORT_BASE         = 0x440U;
  252.     static constexpr std::uint32_t USB_OTG_HOST_CHANNEL_BASE      = 0x500U;
  253.     static constexpr std::uint32_t USB_OTG_HOST_CHANNEL_SIZE      = 0x20U;
  254.     static constexpr std::uint32_t USB_OTG_PCGCCTL_BASE           = 0xE00U;
  255.     static constexpr std::uint32_t USB_OTG_FIFO_BASE              = 0x1000U;
  256.     static constexpr std::uint32_t USB_OTG_FIFO_SIZE              = 0x1000U;
  257.     static constexpr std::uint32_t UID_BASE                       = 0x1FFF7A10U;
  258.     static constexpr std::uint32_t FLASHSIZE_BASE                 = 0x1FFF7A22U;
  259.     static constexpr std::uint32_t PACKAGE_BASE                   = 0x1FFF7BF0U;
  260. }
  261.  
  262. namespace STM32_REGS
  263. {
  264.     #define DAC_CHANNEL2_SUPPORT
  265.     #define RCC_PLLI2S_SUPPORT
  266.     #define RCC_AHB2_SUPPORT
  267.     #define RCC_AHB3_SUPPORT
  268.     #define RTC_TAMPER2_SUPPORT
  269.     #define RTC_AF2_SUPPORT
  270.     #define SPI_I2S_FULLDUPLEX_SUPPORT
  271.  
  272.     /* ADC DEFINITION */
  273.     class ADC
  274.     {
  275.     private:
  276.         struct ADC_t
  277.         {
  278.             __IO uint32_t                 SR;
  279.             __IO uint32_t                 CR1;
  280.             __IO uint32_t                 CR2;
  281.             __IO uint32_t                 SMPR1;
  282.             __IO uint32_t                 SMPR2;
  283.             __IO uint32_t                 JOFR1;
  284.             __IO uint32_t                 JOFR2;
  285.             __IO uint32_t                 JOFR3;
  286.             __IO uint32_t                 JOFR4;
  287.             __IO uint32_t                 HTR;
  288.             __IO uint32_t                 LTR;
  289.             __IO uint32_t                 SQR1;
  290.             __IO uint32_t                 SQR2;
  291.             __IO uint32_t                 SQR3;
  292.             __IO uint32_t                 JSQR;
  293.             __IO uint32_t                 JDR1;
  294.             __IO uint32_t                 JDR2;
  295.             __IO uint32_t                 JDR3;
  296.             __IO uint32_t                 JDR4;
  297.             __IO uint32_t                 DR;
  298.         };
  299.     public:
  300.         class SR
  301.         {
  302.         private:
  303.             union SR_t
  304.             {
  305.                 struct
  306.                 {
  307.                     uint32_t AWD            : 1;
  308.                     uint32_t EOC            : 1;
  309.                     uint32_t JEOC           : 1;
  310.                     uint32_t JSTRT          : 1;
  311.                     uint32_t STRT           : 1;
  312.                     uint32_t OVR            : 1;
  313.                     uint32_t reserved6      : 26;
  314.                 };
  315.                 uint32_t RAW;
  316.             };
  317.         public:
  318.             enum class EMasks: uint32_t
  319.             {
  320.                 AWD                    = (0x1U << 0),
  321.                 EOC                    = (0x1U << 1),
  322.                 JEOC                   = (0x1U << 2),
  323.                 JSTRT                  = (0x1U << 3),
  324.                 STRT                   = (0x1U << 4),
  325.                 OVR                    = (0x1U << 5),
  326.             };
  327.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SR; }
  328.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SR = value; }
  329.             template <EMasks ... flags>
  330.             static inline void set_flags()
  331.             {
  332.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  333.             }
  334.             template <EMasks ... flags>
  335.             static inline void clear_flags()
  336.             {
  337.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  338.             }
  339.             template <EMasks ... flags>
  340.             static inline bool get_flags()
  341.             {
  342.                 return ((reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  343.             }
  344.         };
  345.         class CR1
  346.         {
  347.         private:
  348.             union CR1_t
  349.             {
  350.                 struct
  351.                 {
  352.                     uint32_t AWDCH          : 5;
  353.                     uint32_t EOCIE          : 1;
  354.                     uint32_t AWDIE          : 1;
  355.                     uint32_t JEOCIE         : 1;
  356.                     uint32_t SCAN           : 1;
  357.                     uint32_t AWDSGL         : 1;
  358.                     uint32_t JAUTO          : 1;
  359.                     uint32_t DISCEN         : 1;
  360.                     uint32_t JDISCEN        : 1;
  361.                     uint32_t DISCNUM        : 3;
  362.                     uint32_t reserved16     : 1;
  363.                     uint32_t reserved17     : 1;
  364.                     uint32_t reserved18     : 1;
  365.                     uint32_t reserved19     : 1;
  366.                     uint32_t reserved20     : 1;
  367.                     uint32_t reserved21     : 1;
  368.                     uint32_t JAWDEN         : 1;
  369.                     uint32_t AWDEN          : 1;
  370.                     uint32_t RES            : 2;
  371.                     uint32_t OVRIE          : 1;
  372.                     uint32_t reserved27     : 5;
  373.                 };
  374.                 uint32_t RAW;
  375.             };
  376.         public:
  377.             enum class EMasks: uint32_t
  378.             {
  379.                 AWDCH                  = (0x1FU << 0),
  380.                 EOCIE                  = (0x1U << 5),
  381.                 AWDIE                  = (0x1U << 6),
  382.                 JEOCIE                 = (0x1U << 7),
  383.                 SCAN                   = (0x1U << 8),
  384.                 AWDSGL                 = (0x1U << 9),
  385.                 JAUTO                  = (0x1U << 10),
  386.                 DISCEN                 = (0x1U << 11),
  387.                 JDISCEN                = (0x1U << 12),
  388.                 DISCNUM                = (0x7U << 13),
  389.                 JAWDEN                 = (0x1U << 22),
  390.                 AWDEN                  = (0x1U << 23),
  391.                 RES                    = (0x3U << 24),
  392.                 OVRIE                  = (0x1U << 26),
  393.             };
  394.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1; }
  395.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1 = value; }
  396.             template <EMasks ... flags>
  397.             static inline void set_flags()
  398.             {
  399.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1 |= SetBits<(std::uint32_t)flags...>();
  400.             }
  401.             template <EMasks ... flags>
  402.             static inline void clear_flags()
  403.             {
  404.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1 &= ~(SetBits<(std::uint32_t)flags...>());
  405.             }
  406.             template <EMasks ... flags>
  407.             static inline bool get_flags()
  408.             {
  409.                 return ((reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1 & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  410.             }
  411.             static inline uint32_t get_AWDCH() { return reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->AWDCH; }
  412.             static inline void set_AWDCH(uint32_t value) { reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->AWDCH = value; }
  413.             static inline uint32_t get_DISCNUM() { return reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->DISCNUM; }
  414.             static inline void set_DISCNUM(uint32_t value) { reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->DISCNUM = value; }
  415.             static inline uint32_t get_RES() { return reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->RES; }
  416.             static inline void set_RES(uint32_t value) { reinterpret_cast<__IO CR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR1)->RES = value; }
  417.         };
  418.         class CR2
  419.         {
  420.         private:
  421.             union CR2_t
  422.             {
  423.                 struct
  424.                 {
  425.                     uint32_t ADON           : 1;
  426.                     uint32_t CONT           : 1;
  427.                     uint32_t reserved2      : 1;
  428.                     uint32_t reserved3      : 1;
  429.                     uint32_t reserved4      : 1;
  430.                     uint32_t reserved5      : 1;
  431.                     uint32_t reserved6      : 1;
  432.                     uint32_t reserved7      : 1;
  433.                     uint32_t DMA            : 1;
  434.                     uint32_t DDS            : 1;
  435.                     uint32_t EOCS           : 1;
  436.                     uint32_t ALIGN          : 1;
  437.                     uint32_t reserved12     : 1;
  438.                     uint32_t reserved13     : 1;
  439.                     uint32_t reserved14     : 1;
  440.                     uint32_t reserved15     : 1;
  441.                     uint32_t JEXTSEL        : 4;
  442.                     uint32_t JEXTEN         : 2;
  443.                     uint32_t JSWSTART       : 1;
  444.                     uint32_t reserved23     : 1;
  445.                     uint32_t EXTSEL         : 4;
  446.                     uint32_t EXTEN          : 2;
  447.                     uint32_t SWSTART        : 1;
  448.                     uint32_t reserved31     : 1;
  449.                 };
  450.                 uint32_t RAW;
  451.             };
  452.         public:
  453.             enum class EMasks: uint32_t
  454.             {
  455.                 ADON                   = (0x1U << 0),
  456.                 CONT                   = (0x1U << 1),
  457.                 DMA                    = (0x1U << 8),
  458.                 DDS                    = (0x1U << 9),
  459.                 EOCS                   = (0x1U << 10),
  460.                 ALIGN                  = (0x1U << 11),
  461.                 JEXTSEL                = (0xFU << 16),
  462.                 JEXTEN                 = (0x3U << 20),
  463.                 JSWSTART               = (0x1U << 22),
  464.                 EXTSEL                 = (0xFU << 24),
  465.                 EXTEN                  = (0x3U << 28),
  466.                 SWSTART                = (0x1U << 30),
  467.             };
  468.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2; }
  469.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2 = value; }
  470.             template <EMasks ... flags>
  471.             static inline void set_flags()
  472.             {
  473.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2 |= SetBits<(std::uint32_t)flags...>();
  474.             }
  475.             template <EMasks ... flags>
  476.             static inline void clear_flags()
  477.             {
  478.                 reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2 &= ~(SetBits<(std::uint32_t)flags...>());
  479.             }
  480.             template <EMasks ... flags>
  481.             static inline bool get_flags()
  482.             {
  483.                 return ((reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2 & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  484.             }
  485.             static inline uint32_t get_JEXTSEL() { return reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->JEXTSEL; }
  486.             static inline void set_JEXTSEL(uint32_t value) { reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->JEXTSEL = value; }
  487.             static inline uint32_t get_JEXTEN() { return reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->JEXTEN; }
  488.             static inline void set_JEXTEN(uint32_t value) { reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->JEXTEN = value; }
  489.             static inline uint32_t get_EXTSEL() { return reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->EXTSEL; }
  490.             static inline void set_EXTSEL(uint32_t value) { reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->EXTSEL = value; }
  491.             static inline uint32_t get_EXTEN() { return reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->EXTEN; }
  492.             static inline void set_EXTEN(uint32_t value) { reinterpret_cast<__IO CR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->CR2)->EXTEN = value; }
  493.         };
  494.         class SMPR1
  495.         {
  496.         private:
  497.             union SMPR1_t
  498.             {
  499.                 struct
  500.                 {
  501.                     uint32_t SMP10          : 3;
  502.                     uint32_t SMP11          : 3;
  503.                     uint32_t SMP12          : 3;
  504.                     uint32_t SMP13          : 3;
  505.                     uint32_t SMP14          : 3;
  506.                     uint32_t SMP15          : 3;
  507.                     uint32_t SMP16          : 3;
  508.                     uint32_t SMP17          : 3;
  509.                     uint32_t SMP18          : 3;
  510.                     uint32_t reserved27     : 5;
  511.                 };
  512.                 uint32_t RAW;
  513.             };
  514.         public:
  515.             enum class EMasks: uint32_t
  516.             {
  517.                 SMP10                  = (0x7U << 0),
  518.                 SMP11                  = (0x7U << 3),
  519.                 SMP12                  = (0x7U << 6),
  520.                 SMP13                  = (0x7U << 9),
  521.                 SMP14                  = (0x7U << 12),
  522.                 SMP15                  = (0x7U << 15),
  523.                 SMP16                  = (0x7U << 18),
  524.                 SMP17                  = (0x7U << 21),
  525.                 SMP18                  = (0x7U << 24),
  526.             };
  527.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1; }
  528.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1 = value; }
  529.             static inline uint32_t get_SMP10() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP10; }
  530.             static inline void set_SMP10(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP10 = value; }
  531.             static inline uint32_t get_SMP11() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP11; }
  532.             static inline void set_SMP11(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP11 = value; }
  533.             static inline uint32_t get_SMP12() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP12; }
  534.             static inline void set_SMP12(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP12 = value; }
  535.             static inline uint32_t get_SMP13() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP13; }
  536.             static inline void set_SMP13(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP13 = value; }
  537.             static inline uint32_t get_SMP14() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP14; }
  538.             static inline void set_SMP14(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP14 = value; }
  539.             static inline uint32_t get_SMP15() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP15; }
  540.             static inline void set_SMP15(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP15 = value; }
  541.             static inline uint32_t get_SMP16() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP16; }
  542.             static inline void set_SMP16(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP16 = value; }
  543.             static inline uint32_t get_SMP17() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP17; }
  544.             static inline void set_SMP17(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP17 = value; }
  545.             static inline uint32_t get_SMP18() { return reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP18; }
  546.             static inline void set_SMP18(uint32_t value) { reinterpret_cast<__IO SMPR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR1)->SMP18 = value; }
  547.         };
  548.         class SMPR2
  549.         {
  550.         private:
  551.             union SMPR2_t
  552.             {
  553.                 struct
  554.                 {
  555.                     uint32_t SMP0           : 3;
  556.                     uint32_t SMP1           : 3;
  557.                     uint32_t SMP2           : 3;
  558.                     uint32_t SMP3           : 3;
  559.                     uint32_t SMP4           : 3;
  560.                     uint32_t SMP5           : 3;
  561.                     uint32_t SMP6           : 3;
  562.                     uint32_t SMP7           : 3;
  563.                     uint32_t SMP8           : 3;
  564.                     uint32_t SMP9           : 3;
  565.                     uint32_t reserved30     : 2;
  566.                 };
  567.                 uint32_t RAW;
  568.             };
  569.         public:
  570.             enum class EMasks: uint32_t
  571.             {
  572.                 SMP0                   = (0x7U << 0),
  573.                 SMP1                   = (0x7U << 3),
  574.                 SMP2                   = (0x7U << 6),
  575.                 SMP3                   = (0x7U << 9),
  576.                 SMP4                   = (0x7U << 12),
  577.                 SMP5                   = (0x7U << 15),
  578.                 SMP6                   = (0x7U << 18),
  579.                 SMP7                   = (0x7U << 21),
  580.                 SMP8                   = (0x7U << 24),
  581.                 SMP9                   = (0x7U << 27),
  582.             };
  583.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2; }
  584.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2 = value; }
  585.             static inline uint32_t get_SMP0() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP0; }
  586.             static inline void set_SMP0(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP0 = value; }
  587.             static inline uint32_t get_SMP1() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP1; }
  588.             static inline void set_SMP1(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP1 = value; }
  589.             static inline uint32_t get_SMP2() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP2; }
  590.             static inline void set_SMP2(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP2 = value; }
  591.             static inline uint32_t get_SMP3() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP3; }
  592.             static inline void set_SMP3(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP3 = value; }
  593.             static inline uint32_t get_SMP4() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP4; }
  594.             static inline void set_SMP4(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP4 = value; }
  595.             static inline uint32_t get_SMP5() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP5; }
  596.             static inline void set_SMP5(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP5 = value; }
  597.             static inline uint32_t get_SMP6() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP6; }
  598.             static inline void set_SMP6(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP6 = value; }
  599.             static inline uint32_t get_SMP7() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP7; }
  600.             static inline void set_SMP7(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP7 = value; }
  601.             static inline uint32_t get_SMP8() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP8; }
  602.             static inline void set_SMP8(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP8 = value; }
  603.             static inline uint32_t get_SMP9() { return reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP9; }
  604.             static inline void set_SMP9(uint32_t value) { reinterpret_cast<__IO SMPR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SMPR2)->SMP9 = value; }
  605.         };
  606.         class JOFR1
  607.         {
  608.         private:
  609.             union JOFR1_t
  610.             {
  611.                 struct
  612.                 {
  613.                     uint32_t JOFFSET1       : 12;
  614.                     uint32_t reserved12     : 20;
  615.                 };
  616.                 uint32_t RAW;
  617.             };
  618.         public:
  619.             enum class EMasks: uint32_t
  620.             {
  621.                 JOFFSET1               = (0xFFFU << 0),
  622.             };
  623.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR1; }
  624.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR1 = value; }
  625.             static inline uint32_t get_JOFFSET1() { return reinterpret_cast<__IO JOFR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR1)->JOFFSET1; }
  626.             static inline void set_JOFFSET1(uint32_t value) { reinterpret_cast<__IO JOFR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR1)->JOFFSET1 = value; }
  627.         };
  628.         class JOFR2
  629.         {
  630.         private:
  631.             union JOFR2_t
  632.             {
  633.                 struct
  634.                 {
  635.                     uint32_t JOFFSET2       : 12;
  636.                     uint32_t reserved12     : 20;
  637.                 };
  638.                 uint32_t RAW;
  639.             };
  640.         public:
  641.             enum class EMasks: uint32_t
  642.             {
  643.                 JOFFSET2               = (0xFFFU << 0),
  644.             };
  645.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR2; }
  646.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR2 = value; }
  647.             static inline uint32_t get_JOFFSET2() { return reinterpret_cast<__IO JOFR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR2)->JOFFSET2; }
  648.             static inline void set_JOFFSET2(uint32_t value) { reinterpret_cast<__IO JOFR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR2)->JOFFSET2 = value; }
  649.         };
  650.         class JOFR3
  651.         {
  652.         private:
  653.             union JOFR3_t
  654.             {
  655.                 struct
  656.                 {
  657.                     uint32_t JOFFSET3       : 12;
  658.                     uint32_t reserved12     : 20;
  659.                 };
  660.                 uint32_t RAW;
  661.             };
  662.         public:
  663.             enum class EMasks: uint32_t
  664.             {
  665.                 JOFFSET3               = (0xFFFU << 0),
  666.             };
  667.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR3; }
  668.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR3 = value; }
  669.             static inline uint32_t get_JOFFSET3() { return reinterpret_cast<__IO JOFR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR3)->JOFFSET3; }
  670.             static inline void set_JOFFSET3(uint32_t value) { reinterpret_cast<__IO JOFR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR3)->JOFFSET3 = value; }
  671.         };
  672.         class JOFR4
  673.         {
  674.         private:
  675.             union JOFR4_t
  676.             {
  677.                 struct
  678.                 {
  679.                     uint32_t JOFFSET4       : 12;
  680.                     uint32_t reserved12     : 20;
  681.                 };
  682.                 uint32_t RAW;
  683.             };
  684.         public:
  685.             enum class EMasks: uint32_t
  686.             {
  687.                 JOFFSET4               = (0xFFFU << 0),
  688.             };
  689.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR4; }
  690.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR4 = value; }
  691.             static inline uint32_t get_JOFFSET4() { return reinterpret_cast<__IO JOFR4_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR4)->JOFFSET4; }
  692.             static inline void set_JOFFSET4(uint32_t value) { reinterpret_cast<__IO JOFR4_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JOFR4)->JOFFSET4 = value; }
  693.         };
  694.         class HTR
  695.         {
  696.         private:
  697.             union HTR_t
  698.             {
  699.                 struct
  700.                 {
  701.                     uint32_t HT             : 12;
  702.                     uint32_t reserved12     : 20;
  703.                 };
  704.                 uint32_t RAW;
  705.             };
  706.         public:
  707.             enum class EMasks: uint32_t
  708.             {
  709.                 HT                     = (0xFFFU << 0),
  710.             };
  711.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->HTR; }
  712.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->HTR = value; }
  713.             static inline uint32_t get_HT() { return reinterpret_cast<__IO HTR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->HTR)->HT; }
  714.             static inline void set_HT(uint32_t value) { reinterpret_cast<__IO HTR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->HTR)->HT = value; }
  715.         };
  716.         class LTR
  717.         {
  718.         private:
  719.             union LTR_t
  720.             {
  721.                 struct
  722.                 {
  723.                     uint32_t LT             : 12;
  724.                     uint32_t reserved12     : 20;
  725.                 };
  726.                 uint32_t RAW;
  727.             };
  728.         public:
  729.             enum class EMasks: uint32_t
  730.             {
  731.                 LT                     = (0xFFFU << 0),
  732.             };
  733.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->LTR; }
  734.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->LTR = value; }
  735.             static inline uint32_t get_LT() { return reinterpret_cast<__IO LTR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->LTR)->LT; }
  736.             static inline void set_LT(uint32_t value) { reinterpret_cast<__IO LTR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->LTR)->LT = value; }
  737.         };
  738.         class SQR1
  739.         {
  740.         private:
  741.             union SQR1_t
  742.             {
  743.                 struct
  744.                 {
  745.                     uint32_t SQ13           : 5;
  746.                     uint32_t SQ14           : 5;
  747.                     uint32_t SQ15           : 5;
  748.                     uint32_t SQ16           : 5;
  749.                     uint32_t L              : 4;
  750.                     uint32_t reserved24     : 8;
  751.                 };
  752.                 uint32_t RAW;
  753.             };
  754.         public:
  755.             enum class EMasks: uint32_t
  756.             {
  757.                 SQ13                   = (0x1FU << 0),
  758.                 SQ14                   = (0x1FU << 5),
  759.                 SQ15                   = (0x1FU << 10),
  760.                 SQ16                   = (0x1FU << 15),
  761.                 L                      = (0xFU << 20),
  762.             };
  763.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1; }
  764.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1 = value; }
  765.             static inline uint32_t get_SQ13() { return reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ13; }
  766.             static inline void set_SQ13(uint32_t value) { reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ13 = value; }
  767.             static inline uint32_t get_SQ14() { return reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ14; }
  768.             static inline void set_SQ14(uint32_t value) { reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ14 = value; }
  769.             static inline uint32_t get_SQ15() { return reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ15; }
  770.             static inline void set_SQ15(uint32_t value) { reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ15 = value; }
  771.             static inline uint32_t get_SQ16() { return reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ16; }
  772.             static inline void set_SQ16(uint32_t value) { reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->SQ16 = value; }
  773.             static inline uint32_t get_L() { return reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->L; }
  774.             static inline void set_L(uint32_t value) { reinterpret_cast<__IO SQR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR1)->L = value; }
  775.         };
  776.         class SQR2
  777.         {
  778.         private:
  779.             union SQR2_t
  780.             {
  781.                 struct
  782.                 {
  783.                     uint32_t SQ7            : 5;
  784.                     uint32_t SQ8            : 5;
  785.                     uint32_t SQ9            : 5;
  786.                     uint32_t SQ10           : 5;
  787.                     uint32_t SQ11           : 5;
  788.                     uint32_t SQ12           : 5;
  789.                     uint32_t reserved30     : 2;
  790.                 };
  791.                 uint32_t RAW;
  792.             };
  793.         public:
  794.             enum class EMasks: uint32_t
  795.             {
  796.                 SQ7                    = (0x1FU << 0),
  797.                 SQ8                    = (0x1FU << 5),
  798.                 SQ9                    = (0x1FU << 10),
  799.                 SQ10                   = (0x1FU << 15),
  800.                 SQ11                   = (0x1FU << 20),
  801.                 SQ12                   = (0x1FU << 25),
  802.             };
  803.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2; }
  804.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2 = value; }
  805.             static inline uint32_t get_SQ7() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ7; }
  806.             static inline void set_SQ7(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ7 = value; }
  807.             static inline uint32_t get_SQ8() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ8; }
  808.             static inline void set_SQ8(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ8 = value; }
  809.             static inline uint32_t get_SQ9() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ9; }
  810.             static inline void set_SQ9(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ9 = value; }
  811.             static inline uint32_t get_SQ10() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ10; }
  812.             static inline void set_SQ10(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ10 = value; }
  813.             static inline uint32_t get_SQ11() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ11; }
  814.             static inline void set_SQ11(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ11 = value; }
  815.             static inline uint32_t get_SQ12() { return reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ12; }
  816.             static inline void set_SQ12(uint32_t value) { reinterpret_cast<__IO SQR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR2)->SQ12 = value; }
  817.         };
  818.         class SQR3
  819.         {
  820.         private:
  821.             union SQR3_t
  822.             {
  823.                 struct
  824.                 {
  825.                     uint32_t SQ1            : 5;
  826.                     uint32_t SQ2            : 5;
  827.                     uint32_t SQ3            : 5;
  828.                     uint32_t SQ4            : 5;
  829.                     uint32_t SQ5            : 5;
  830.                     uint32_t SQ6            : 5;
  831.                     uint32_t reserved30     : 2;
  832.                 };
  833.                 uint32_t RAW;
  834.             };
  835.         public:
  836.             enum class EMasks: uint32_t
  837.             {
  838.                 SQ1                    = (0x1FU << 0),
  839.                 SQ2                    = (0x1FU << 5),
  840.                 SQ3                    = (0x1FU << 10),
  841.                 SQ4                    = (0x1FU << 15),
  842.                 SQ5                    = (0x1FU << 20),
  843.                 SQ6                    = (0x1FU << 25),
  844.             };
  845.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3; }
  846.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3 = value; }
  847.             static inline uint32_t get_SQ1() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ1; }
  848.             static inline void set_SQ1(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ1 = value; }
  849.             static inline uint32_t get_SQ2() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ2; }
  850.             static inline void set_SQ2(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ2 = value; }
  851.             static inline uint32_t get_SQ3() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ3; }
  852.             static inline void set_SQ3(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ3 = value; }
  853.             static inline uint32_t get_SQ4() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ4; }
  854.             static inline void set_SQ4(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ4 = value; }
  855.             static inline uint32_t get_SQ5() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ5; }
  856.             static inline void set_SQ5(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ5 = value; }
  857.             static inline uint32_t get_SQ6() { return reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ6; }
  858.             static inline void set_SQ6(uint32_t value) { reinterpret_cast<__IO SQR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->SQR3)->SQ6 = value; }
  859.         };
  860.         class JSQR
  861.         {
  862.         private:
  863.             union JSQR_t
  864.             {
  865.                 struct
  866.                 {
  867.                     uint32_t JSQ1           : 5;
  868.                     uint32_t JSQ2           : 5;
  869.                     uint32_t JSQ3           : 5;
  870.                     uint32_t JSQ4           : 5;
  871.                     uint32_t JL             : 2;
  872.                     uint32_t reserved22     : 10;
  873.                 };
  874.                 uint32_t RAW;
  875.             };
  876.         public:
  877.             enum class EMasks: uint32_t
  878.             {
  879.                 JSQ1                   = (0x1FU << 0),
  880.                 JSQ2                   = (0x1FU << 5),
  881.                 JSQ3                   = (0x1FU << 10),
  882.                 JSQ4                   = (0x1FU << 15),
  883.                 JL                     = (0x3U << 20),
  884.             };
  885.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR; }
  886.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR = value; }
  887.             static inline uint32_t get_JSQ1() { return reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ1; }
  888.             static inline void set_JSQ1(uint32_t value) { reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ1 = value; }
  889.             static inline uint32_t get_JSQ2() { return reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ2; }
  890.             static inline void set_JSQ2(uint32_t value) { reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ2 = value; }
  891.             static inline uint32_t get_JSQ3() { return reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ3; }
  892.             static inline void set_JSQ3(uint32_t value) { reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ3 = value; }
  893.             static inline uint32_t get_JSQ4() { return reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ4; }
  894.             static inline void set_JSQ4(uint32_t value) { reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JSQ4 = value; }
  895.             static inline uint32_t get_JL() { return reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JL; }
  896.             static inline void set_JL(uint32_t value) { reinterpret_cast<__IO JSQR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JSQR)->JL = value; }
  897.         };
  898.         class JDR1
  899.         {
  900.         private:
  901.             union JDR1_t
  902.             {
  903.                 struct
  904.                 {
  905.                     uint32_t JDATA          : 16;
  906.                     uint32_t reserved16     : 16;
  907.                 };
  908.                 uint32_t RAW;
  909.             };
  910.         public:
  911.             enum class EMasks: uint32_t
  912.             {
  913.                 JDATA                  = (0xFFFFU << 0),
  914.             };
  915.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR1; }
  916.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR1 = value; }
  917.             static inline uint32_t get_JDATA() { return reinterpret_cast<__IO JDR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR1)->JDATA; }
  918.             static inline void set_JDATA(uint32_t value) { reinterpret_cast<__IO JDR1_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR1)->JDATA = value; }
  919.         };
  920.         class JDR2
  921.         {
  922.         private:
  923.             union JDR2_t
  924.             {
  925.                 struct
  926.                 {
  927.                     uint32_t JDATA          : 16;
  928.                     uint32_t reserved16     : 16;
  929.                 };
  930.                 uint32_t RAW;
  931.             };
  932.         public:
  933.             enum class EMasks: uint32_t
  934.             {
  935.                 JDATA                  = (0xFFFFU << 0),
  936.             };
  937.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR2; }
  938.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR2 = value; }
  939.             static inline uint32_t get_JDATA() { return reinterpret_cast<__IO JDR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR2)->JDATA; }
  940.             static inline void set_JDATA(uint32_t value) { reinterpret_cast<__IO JDR2_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR2)->JDATA = value; }
  941.         };
  942.         class JDR3
  943.         {
  944.         private:
  945.             union JDR3_t
  946.             {
  947.                 struct
  948.                 {
  949.                     uint32_t JDATA          : 16;
  950.                     uint32_t reserved16     : 16;
  951.                 };
  952.                 uint32_t RAW;
  953.             };
  954.         public:
  955.             enum class EMasks: uint32_t
  956.             {
  957.                 JDATA                  = (0xFFFFU << 0),
  958.             };
  959.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR3; }
  960.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR3 = value; }
  961.             static inline uint32_t get_JDATA() { return reinterpret_cast<__IO JDR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR3)->JDATA; }
  962.             static inline void set_JDATA(uint32_t value) { reinterpret_cast<__IO JDR3_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR3)->JDATA = value; }
  963.         };
  964.         class JDR4
  965.         {
  966.         private:
  967.             union JDR4_t
  968.             {
  969.                 struct
  970.                 {
  971.                     uint32_t JDATA          : 16;
  972.                     uint32_t reserved16     : 16;
  973.                 };
  974.                 uint32_t RAW;
  975.             };
  976.         public:
  977.             enum class EMasks: uint32_t
  978.             {
  979.                 JDATA                  = (0xFFFFU << 0),
  980.             };
  981.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR4; }
  982.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR4 = value; }
  983.             static inline uint32_t get_JDATA() { return reinterpret_cast<__IO JDR4_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR4)->JDATA; }
  984.             static inline void set_JDATA(uint32_t value) { reinterpret_cast<__IO JDR4_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->JDR4)->JDATA = value; }
  985.         };
  986.         class DR
  987.         {
  988.         private:
  989.             union DR_t
  990.             {
  991.                 struct
  992.                 {
  993.                     uint32_t DATA           : 16;
  994.                     uint32_t ADC2DATA       : 16;
  995.                 };
  996.                 uint32_t RAW;
  997.             };
  998.         public:
  999.             enum class EMasks: uint32_t
  1000.             {
  1001.                 DATA                   = (0xFFFFU << 0),
  1002.                 ADC2DATA               = (0xFFFFU << 16),
  1003.             };
  1004.             static inline uint32_t get() { return reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR; }
  1005.             static inline void set(uint32_t value) { reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR = value; }
  1006.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR)->DATA; }
  1007.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR)->DATA = value; }
  1008.             static inline uint32_t get_ADC2DATA() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR)->ADC2DATA; }
  1009.             static inline void set_ADC2DATA(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<ADC_t*>(STM32::ADC_BASE)->DR)->ADC2DATA = value; }
  1010.         };
  1011.     };
  1012.     /* ADC123_Common DEFINITION */
  1013.     template <uint32_t reg_base>
  1014.     class ADC123_Common
  1015.     {
  1016. #warning TODO: ADC123_Common
  1017.     };
  1018.     /* CAN_TxMailBox DEFINITION */
  1019.     template <uint32_t reg_base>
  1020.     class CAN_TxMailBox
  1021.     {
  1022. #warning TODO: CAN_TxMailBox
  1023.     };
  1024.     /* CAN_FIFOMailBox DEFINITION */
  1025.     template <uint32_t reg_base>
  1026.     class CAN_FIFOMailBox
  1027.     {
  1028. #warning TODO: CAN_FIFOMailBox
  1029.     };
  1030.     /* CAN_FilterRegister DEFINITION */
  1031.     template <uint32_t reg_base>
  1032.     class CAN_FilterRegister
  1033.     {
  1034. #warning TODO: CAN_FilterRegister
  1035.     };
  1036.     /* CAN DEFINITION */
  1037.     template <uint32_t reg_base>
  1038.     class CAN
  1039.     {
  1040. #warning TODO: CAN
  1041.     };
  1042.     /* CRC DEFINITION */
  1043.     class CRC
  1044.     {
  1045.     private:
  1046.         struct CRC_t
  1047.         {
  1048.             __IO uint32_t                 DR;
  1049.             __IO uint8_t                  IDR;
  1050.             uint8_t                       RESERVED0;
  1051.             uint16_t                      RESERVED1;
  1052.             __IO uint32_t                 CR;
  1053.         };
  1054.     public:
  1055.         class DR
  1056.         {
  1057.         private:
  1058.             union DR_t
  1059.             {
  1060.                 struct
  1061.                 {
  1062.                     uint32_t DR             : 32;
  1063.                 };
  1064.                 uint32_t RAW;
  1065.             };
  1066.         public:
  1067.             enum class EMasks: uint32_t
  1068.             {
  1069.                 DR                     = (0xFFFFFFFFU << 0),
  1070.             };
  1071.             static inline uint32_t get() { return reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->DR; }
  1072.             static inline void set(uint32_t value) { reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->DR = value; }
  1073.             static inline uint32_t get_DR() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->DR)->DR; }
  1074.             static inline void set_DR(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->DR)->DR = value; }
  1075.         };
  1076.         class IDR
  1077.         {
  1078.         public:
  1079.             enum class EMasks: uint32_t
  1080.             {
  1081.                 IDR                    = (0xFFU << 0),
  1082.             };
  1083.             static inline uint32_t get() { return reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->IDR; }
  1084.             static inline void set(uint32_t value) { reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->IDR = value; }
  1085.         };
  1086.         class CR
  1087.         {
  1088.         private:
  1089.             union CR_t
  1090.             {
  1091.                 struct
  1092.                 {
  1093.                     uint32_t RESET          : 1;
  1094.                     uint32_t reserved1      : 31;
  1095.                 };
  1096.                 uint32_t RAW;
  1097.             };
  1098.         public:
  1099.             enum class EMasks: uint32_t
  1100.             {
  1101.                 RESET                  = (0x1U << 0),
  1102.             };
  1103.             static inline uint32_t get() { return reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->CR; }
  1104.             static inline void set(uint32_t value) { reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->CR = value; }
  1105.             template <EMasks ... flags>
  1106.             static inline void set_flags()
  1107.             {
  1108.                 reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  1109.             }
  1110.             template <EMasks ... flags>
  1111.             static inline void clear_flags()
  1112.             {
  1113.                 reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  1114.             }
  1115.             template <EMasks ... flags>
  1116.             static inline bool get_flags()
  1117.             {
  1118.                 return ((reinterpret_cast<CRC_t*>(STM32::CRC_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1119.             }
  1120.         };
  1121.     };
  1122.     /* DAC DEFINITION */
  1123.     class DAC
  1124.     {
  1125.     private:
  1126.         struct DAC_t
  1127.         {
  1128.             __IO uint32_t                 CR;
  1129.             __IO uint32_t                 SWTRIGR;
  1130.             __IO uint32_t                 DHR12R1;
  1131.             __IO uint32_t                 DHR12L1;
  1132.             __IO uint32_t                 DHR8R1;
  1133.             __IO uint32_t                 DHR12R2;
  1134.             __IO uint32_t                 DHR12L2;
  1135.             __IO uint32_t                 DHR8R2;
  1136.             __IO uint32_t                 DHR12RD;
  1137.             __IO uint32_t                 DHR12LD;
  1138.             __IO uint32_t                 DHR8RD;
  1139.             __IO uint32_t                 DOR1;
  1140.             __IO uint32_t                 DOR2;
  1141.             __IO uint32_t                 SR;
  1142.         };
  1143.     public:
  1144.         class CR
  1145.         {
  1146.         private:
  1147.             union CR_t
  1148.             {
  1149.                 struct
  1150.                 {
  1151.                     uint32_t EN1            : 1;
  1152.                     uint32_t BOFF1          : 1;
  1153.                     uint32_t TEN1           : 1;
  1154.                     uint32_t TSEL1          : 3;
  1155.                     uint32_t WAVE1          : 2;
  1156.                     uint32_t MAMP1          : 4;
  1157.                     uint32_t DMAEN1         : 1;
  1158.                     uint32_t DMAUDRIE1      : 1;
  1159.                     uint32_t reserved14     : 1;
  1160.                     uint32_t reserved15     : 1;
  1161.                     uint32_t EN2            : 1;
  1162.                     uint32_t BOFF2          : 1;
  1163.                     uint32_t TEN2           : 1;
  1164.                     uint32_t TSEL2          : 3;
  1165.                     uint32_t WAVE2          : 2;
  1166.                     uint32_t MAMP2          : 4;
  1167.                     uint32_t DMAEN2         : 1;
  1168.                     uint32_t DMAUDRIE2      : 1;
  1169.                     uint32_t reserved30     : 2;
  1170.                 };
  1171.                 uint32_t RAW;
  1172.             };
  1173.         public:
  1174.             enum class EMasks: uint32_t
  1175.             {
  1176.                 EN1                    = (0x1U << 0),
  1177.                 BOFF1                  = (0x1U << 1),
  1178.                 TEN1                   = (0x1U << 2),
  1179.                 TSEL1                  = (0x7U << 3),
  1180.                 WAVE1                  = (0x3U << 6),
  1181.                 MAMP1                  = (0xFU << 8),
  1182.                 DMAEN1                 = (0x1U << 12),
  1183.                 DMAUDRIE1              = (0x1U << 13),
  1184.                 EN2                    = (0x1U << 16),
  1185.                 BOFF2                  = (0x1U << 17),
  1186.                 TEN2                   = (0x1U << 18),
  1187.                 TSEL2                  = (0x7U << 19),
  1188.                 WAVE2                  = (0x3U << 22),
  1189.                 MAMP2                  = (0xFU << 24),
  1190.                 DMAEN2                 = (0x1U << 28),
  1191.                 DMAUDRIE2              = (0x1U << 29),
  1192.             };
  1193.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR; }
  1194.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR = value; }
  1195.             template <EMasks ... flags>
  1196.             static inline void set_flags()
  1197.             {
  1198.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  1199.             }
  1200.             template <EMasks ... flags>
  1201.             static inline void clear_flags()
  1202.             {
  1203.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  1204.             }
  1205.             template <EMasks ... flags>
  1206.             static inline bool get_flags()
  1207.             {
  1208.                 return ((reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1209.             }
  1210.             static inline uint32_t get_TSEL1() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->TSEL1; }
  1211.             static inline void set_TSEL1(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->TSEL1 = value; }
  1212.             static inline uint32_t get_WAVE1() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->WAVE1; }
  1213.             static inline void set_WAVE1(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->WAVE1 = value; }
  1214.             static inline uint32_t get_MAMP1() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->MAMP1; }
  1215.             static inline void set_MAMP1(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->MAMP1 = value; }
  1216.             static inline uint32_t get_TSEL2() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->TSEL2; }
  1217.             static inline void set_TSEL2(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->TSEL2 = value; }
  1218.             static inline uint32_t get_WAVE2() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->WAVE2; }
  1219.             static inline void set_WAVE2(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->WAVE2 = value; }
  1220.             static inline uint32_t get_MAMP2() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->MAMP2; }
  1221.             static inline void set_MAMP2(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->CR)->MAMP2 = value; }
  1222.         };
  1223.         class SWTRIGR
  1224.         {
  1225.         private:
  1226.             union SWTRIGR_t
  1227.             {
  1228.                 struct
  1229.                 {
  1230.                     uint32_t SWTRIG1        : 1;
  1231.                     uint32_t SWTRIG2        : 1;
  1232.                     uint32_t reserved2      : 30;
  1233.                 };
  1234.                 uint32_t RAW;
  1235.             };
  1236.         public:
  1237.             enum class EMasks: uint32_t
  1238.             {
  1239.                 SWTRIG1                = (0x1U << 0),
  1240.                 SWTRIG2                = (0x1U << 1),
  1241.             };
  1242.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SWTRIGR; }
  1243.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SWTRIGR = value; }
  1244.             template <EMasks ... flags>
  1245.             static inline void set_flags()
  1246.             {
  1247.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SWTRIGR |= SetBits<(std::uint32_t)flags...>();
  1248.             }
  1249.             template <EMasks ... flags>
  1250.             static inline void clear_flags()
  1251.             {
  1252.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SWTRIGR &= ~(SetBits<(std::uint32_t)flags...>());
  1253.             }
  1254.             template <EMasks ... flags>
  1255.             static inline bool get_flags()
  1256.             {
  1257.                 return ((reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SWTRIGR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1258.             }
  1259.         };
  1260.         class DHR12R1
  1261.         {
  1262.         private:
  1263.             union DHR12R1_t
  1264.             {
  1265.                 struct
  1266.                 {
  1267.                     uint32_t DACC1DHR       : 12;
  1268.                     uint32_t reserved12     : 20;
  1269.                 };
  1270.                 uint32_t RAW;
  1271.             };
  1272.         public:
  1273.             enum class EMasks: uint32_t
  1274.             {
  1275.                 DACC1DHR               = (0xFFFU << 0),
  1276.             };
  1277.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R1; }
  1278.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R1 = value; }
  1279.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR12R1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R1)->DACC1DHR; }
  1280.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR12R1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R1)->DACC1DHR = value; }
  1281.         };
  1282.         class DHR12L1
  1283.         {
  1284.         private:
  1285.             union DHR12L1_t
  1286.             {
  1287.                 struct
  1288.                 {
  1289.                     uint32_t reserved0      : 1;
  1290.                     uint32_t reserved1      : 1;
  1291.                     uint32_t reserved2      : 1;
  1292.                     uint32_t reserved3      : 1;
  1293.                     uint32_t DACC1DHR       : 12;
  1294.                     uint32_t reserved16     : 16;
  1295.                 };
  1296.                 uint32_t RAW;
  1297.             };
  1298.         public:
  1299.             enum class EMasks: uint32_t
  1300.             {
  1301.                 DACC1DHR               = (0xFFFU << 4),
  1302.             };
  1303.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L1; }
  1304.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L1 = value; }
  1305.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR12L1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L1)->DACC1DHR; }
  1306.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR12L1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L1)->DACC1DHR = value; }
  1307.         };
  1308.         class DHR8R1
  1309.         {
  1310.         private:
  1311.             union DHR8R1_t
  1312.             {
  1313.                 struct
  1314.                 {
  1315.                     uint32_t DACC1DHR       : 8;
  1316.                     uint32_t reserved8      : 24;
  1317.                 };
  1318.                 uint32_t RAW;
  1319.             };
  1320.         public:
  1321.             enum class EMasks: uint32_t
  1322.             {
  1323.                 DACC1DHR               = (0xFFU << 0),
  1324.             };
  1325.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R1; }
  1326.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R1 = value; }
  1327.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR8R1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R1)->DACC1DHR; }
  1328.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR8R1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R1)->DACC1DHR = value; }
  1329.         };
  1330.         class DHR12R2
  1331.         {
  1332.         private:
  1333.             union DHR12R2_t
  1334.             {
  1335.                 struct
  1336.                 {
  1337.                     uint32_t DACC2DHR       : 12;
  1338.                     uint32_t reserved12     : 20;
  1339.                 };
  1340.                 uint32_t RAW;
  1341.             };
  1342.         public:
  1343.             enum class EMasks: uint32_t
  1344.             {
  1345.                 DACC2DHR               = (0xFFFU << 0),
  1346.             };
  1347.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R2; }
  1348.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R2 = value; }
  1349.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR12R2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R2)->DACC2DHR; }
  1350.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR12R2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12R2)->DACC2DHR = value; }
  1351.         };
  1352.         class DHR12L2
  1353.         {
  1354.         private:
  1355.             union DHR12L2_t
  1356.             {
  1357.                 struct
  1358.                 {
  1359.                     uint32_t reserved0      : 1;
  1360.                     uint32_t reserved1      : 1;
  1361.                     uint32_t reserved2      : 1;
  1362.                     uint32_t reserved3      : 1;
  1363.                     uint32_t DACC2DHR       : 12;
  1364.                     uint32_t reserved16     : 16;
  1365.                 };
  1366.                 uint32_t RAW;
  1367.             };
  1368.         public:
  1369.             enum class EMasks: uint32_t
  1370.             {
  1371.                 DACC2DHR               = (0xFFFU << 4),
  1372.             };
  1373.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L2; }
  1374.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L2 = value; }
  1375.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR12L2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L2)->DACC2DHR; }
  1376.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR12L2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12L2)->DACC2DHR = value; }
  1377.         };
  1378.         class DHR8R2
  1379.         {
  1380.         private:
  1381.             union DHR8R2_t
  1382.             {
  1383.                 struct
  1384.                 {
  1385.                     uint32_t DACC2DHR       : 8;
  1386.                     uint32_t reserved8      : 24;
  1387.                 };
  1388.                 uint32_t RAW;
  1389.             };
  1390.         public:
  1391.             enum class EMasks: uint32_t
  1392.             {
  1393.                 DACC2DHR               = (0xFFU << 0),
  1394.             };
  1395.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R2; }
  1396.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R2 = value; }
  1397.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR8R2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R2)->DACC2DHR; }
  1398.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR8R2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8R2)->DACC2DHR = value; }
  1399.         };
  1400.         class DHR12RD
  1401.         {
  1402.         private:
  1403.             union DHR12RD_t
  1404.             {
  1405.                 struct
  1406.                 {
  1407.                     uint32_t DACC1DHR       : 12;
  1408.                     uint32_t reserved12     : 1;
  1409.                     uint32_t reserved13     : 1;
  1410.                     uint32_t reserved14     : 1;
  1411.                     uint32_t reserved15     : 1;
  1412.                     uint32_t DACC2DHR       : 12;
  1413.                     uint32_t reserved28     : 4;
  1414.                 };
  1415.                 uint32_t RAW;
  1416.             };
  1417.         public:
  1418.             enum class EMasks: uint32_t
  1419.             {
  1420.                 DACC1DHR               = (0xFFFU << 0),
  1421.                 DACC2DHR               = (0xFFFU << 16),
  1422.             };
  1423.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD; }
  1424.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD = value; }
  1425.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR12RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD)->DACC1DHR; }
  1426.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR12RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD)->DACC1DHR = value; }
  1427.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR12RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD)->DACC2DHR; }
  1428.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR12RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12RD)->DACC2DHR = value; }
  1429.         };
  1430.         class DHR12LD
  1431.         {
  1432.         private:
  1433.             union DHR12LD_t
  1434.             {
  1435.                 struct
  1436.                 {
  1437.                     uint32_t reserved0      : 1;
  1438.                     uint32_t reserved1      : 1;
  1439.                     uint32_t reserved2      : 1;
  1440.                     uint32_t reserved3      : 1;
  1441.                     uint32_t DACC1DHR       : 12;
  1442.                     uint32_t reserved16     : 1;
  1443.                     uint32_t reserved17     : 1;
  1444.                     uint32_t reserved18     : 1;
  1445.                     uint32_t reserved19     : 1;
  1446.                     uint32_t DACC2DHR       : 12;
  1447.                 };
  1448.                 uint32_t RAW;
  1449.             };
  1450.         public:
  1451.             enum class EMasks: uint32_t
  1452.             {
  1453.                 DACC1DHR               = (0xFFFU << 4),
  1454.                 DACC2DHR               = (0xFFFU << 20),
  1455.             };
  1456.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD; }
  1457.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD = value; }
  1458.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR12LD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD)->DACC1DHR; }
  1459.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR12LD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD)->DACC1DHR = value; }
  1460.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR12LD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD)->DACC2DHR; }
  1461.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR12LD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR12LD)->DACC2DHR = value; }
  1462.         };
  1463.         class DHR8RD
  1464.         {
  1465.         private:
  1466.             union DHR8RD_t
  1467.             {
  1468.                 struct
  1469.                 {
  1470.                     uint32_t DACC1DHR       : 8;
  1471.                     uint32_t DACC2DHR       : 8;
  1472.                     uint32_t reserved16     : 16;
  1473.                 };
  1474.                 uint32_t RAW;
  1475.             };
  1476.         public:
  1477.             enum class EMasks: uint32_t
  1478.             {
  1479.                 DACC1DHR               = (0xFFU << 0),
  1480.                 DACC2DHR               = (0xFFU << 8),
  1481.             };
  1482.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD; }
  1483.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD = value; }
  1484.             static inline uint32_t get_DACC1DHR() { return reinterpret_cast<__IO DHR8RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD)->DACC1DHR; }
  1485.             static inline void set_DACC1DHR(uint32_t value) { reinterpret_cast<__IO DHR8RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD)->DACC1DHR = value; }
  1486.             static inline uint32_t get_DACC2DHR() { return reinterpret_cast<__IO DHR8RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD)->DACC2DHR; }
  1487.             static inline void set_DACC2DHR(uint32_t value) { reinterpret_cast<__IO DHR8RD_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DHR8RD)->DACC2DHR = value; }
  1488.         };
  1489.         class DOR1
  1490.         {
  1491.         private:
  1492.             union DOR1_t
  1493.             {
  1494.                 struct
  1495.                 {
  1496.                     uint32_t DACC1DOR       : 12;
  1497.                     uint32_t reserved12     : 20;
  1498.                 };
  1499.                 uint32_t RAW;
  1500.             };
  1501.         public:
  1502.             enum class EMasks: uint32_t
  1503.             {
  1504.                 DACC1DOR               = (0xFFFU << 0),
  1505.             };
  1506.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR1; }
  1507.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR1 = value; }
  1508.             static inline uint32_t get_DACC1DOR() { return reinterpret_cast<__IO DOR1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR1)->DACC1DOR; }
  1509.             static inline void set_DACC1DOR(uint32_t value) { reinterpret_cast<__IO DOR1_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR1)->DACC1DOR = value; }
  1510.         };
  1511.         class DOR2
  1512.         {
  1513.         private:
  1514.             union DOR2_t
  1515.             {
  1516.                 struct
  1517.                 {
  1518.                     uint32_t DACC2DOR       : 12;
  1519.                     uint32_t reserved12     : 20;
  1520.                 };
  1521.                 uint32_t RAW;
  1522.             };
  1523.         public:
  1524.             enum class EMasks: uint32_t
  1525.             {
  1526.                 DACC2DOR               = (0xFFFU << 0),
  1527.             };
  1528.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR2; }
  1529.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR2 = value; }
  1530.             static inline uint32_t get_DACC2DOR() { return reinterpret_cast<__IO DOR2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR2)->DACC2DOR; }
  1531.             static inline void set_DACC2DOR(uint32_t value) { reinterpret_cast<__IO DOR2_t*>(&reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->DOR2)->DACC2DOR = value; }
  1532.         };
  1533.         class SR
  1534.         {
  1535.         private:
  1536.             union SR_t
  1537.             {
  1538.                 struct
  1539.                 {
  1540.                     uint32_t reserved0      : 1;
  1541.                     uint32_t reserved1      : 1;
  1542.                     uint32_t reserved2      : 1;
  1543.                     uint32_t reserved3      : 1;
  1544.                     uint32_t reserved4      : 1;
  1545.                     uint32_t reserved5      : 1;
  1546.                     uint32_t reserved6      : 1;
  1547.                     uint32_t reserved7      : 1;
  1548.                     uint32_t reserved8      : 1;
  1549.                     uint32_t reserved9      : 1;
  1550.                     uint32_t reserved10     : 1;
  1551.                     uint32_t reserved11     : 1;
  1552.                     uint32_t reserved12     : 1;
  1553.                     uint32_t DMAUDR1        : 1;
  1554.                     uint32_t reserved14     : 1;
  1555.                     uint32_t reserved15     : 1;
  1556.                     uint32_t reserved16     : 1;
  1557.                     uint32_t reserved17     : 1;
  1558.                     uint32_t reserved18     : 1;
  1559.                     uint32_t reserved19     : 1;
  1560.                     uint32_t reserved20     : 1;
  1561.                     uint32_t reserved21     : 1;
  1562.                     uint32_t reserved22     : 1;
  1563.                     uint32_t reserved23     : 1;
  1564.                     uint32_t reserved24     : 1;
  1565.                     uint32_t reserved25     : 1;
  1566.                     uint32_t reserved26     : 1;
  1567.                     uint32_t reserved27     : 1;
  1568.                     uint32_t reserved28     : 1;
  1569.                     uint32_t DMAUDR2        : 1;
  1570.                     uint32_t reserved30     : 2;
  1571.                 };
  1572.                 uint32_t RAW;
  1573.             };
  1574.         public:
  1575.             enum class EMasks: uint32_t
  1576.             {
  1577.                 DMAUDR1                = (0x1U << 13),
  1578.                 DMAUDR2                = (0x1U << 29),
  1579.             };
  1580.             static inline uint32_t get() { return reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SR; }
  1581.             static inline void set(uint32_t value) { reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SR = value; }
  1582.             template <EMasks ... flags>
  1583.             static inline void set_flags()
  1584.             {
  1585.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  1586.             }
  1587.             template <EMasks ... flags>
  1588.             static inline void clear_flags()
  1589.             {
  1590.                 reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  1591.             }
  1592.             template <EMasks ... flags>
  1593.             static inline bool get_flags()
  1594.             {
  1595.                 return ((reinterpret_cast<DAC_t*>(STM32::DAC_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1596.             }
  1597.         };
  1598.     };
  1599.     /* DBGMCU DEFINITION */
  1600.     class DBGMCU
  1601.     {
  1602.     private:
  1603.         struct DBGMCU_t
  1604.         {
  1605.             __IO uint32_t                 IDCODE;
  1606.             __IO uint32_t                 CR;
  1607.             __IO uint32_t                 APB1FZ;
  1608.             __IO uint32_t                 APB2FZ;
  1609.         };
  1610.     public:
  1611.         class IDCODE
  1612.         {
  1613.         private:
  1614.             union IDCODE_t
  1615.             {
  1616.                 struct
  1617.                 {
  1618.                     uint32_t DEV_ID         : 12;
  1619.                     uint32_t reserved12     : 1;
  1620.                     uint32_t reserved13     : 1;
  1621.                     uint32_t reserved14     : 1;
  1622.                     uint32_t reserved15     : 1;
  1623.                     uint32_t REV_ID         : 16;
  1624.                 };
  1625.                 uint32_t RAW;
  1626.             };
  1627.         public:
  1628.             enum class EMasks: uint32_t
  1629.             {
  1630.                 DEV_ID                 = (0xFFFU << 0),
  1631.                 REV_ID                 = (0xFFFFU << 16),
  1632.             };
  1633.             static inline uint32_t get() { return reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE; }
  1634.             static inline void set(uint32_t value) { reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE = value; }
  1635.             static inline uint32_t get_DEV_ID() { return reinterpret_cast<__IO IDCODE_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE)->DEV_ID; }
  1636.             static inline void set_DEV_ID(uint32_t value) { reinterpret_cast<__IO IDCODE_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE)->DEV_ID = value; }
  1637.             static inline uint32_t get_REV_ID() { return reinterpret_cast<__IO IDCODE_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE)->REV_ID; }
  1638.             static inline void set_REV_ID(uint32_t value) { reinterpret_cast<__IO IDCODE_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->IDCODE)->REV_ID = value; }
  1639.         };
  1640.         class CR
  1641.         {
  1642.         private:
  1643.             union CR_t
  1644.             {
  1645.                 struct
  1646.                 {
  1647.                     uint32_t DBG_SLEEP      : 1;
  1648.                     uint32_t DBG_STOP       : 1;
  1649.                     uint32_t DBG_STANDBY    : 1;
  1650.                     uint32_t reserved3      : 1;
  1651.                     uint32_t reserved4      : 1;
  1652.                     uint32_t TRACE_IOEN     : 1;
  1653.                     uint32_t TRACE_MODE     : 2;
  1654.                     uint32_t reserved8      : 24;
  1655.                 };
  1656.                 uint32_t RAW;
  1657.             };
  1658.         public:
  1659.             enum class EMasks: uint32_t
  1660.             {
  1661.                 DBG_SLEEP              = (0x1U << 0),
  1662.                 DBG_STOP               = (0x1U << 1),
  1663.                 DBG_STANDBY            = (0x1U << 2),
  1664.                 TRACE_IOEN             = (0x1U << 5),
  1665.                 TRACE_MODE             = (0x3U << 6),
  1666.             };
  1667.             static inline uint32_t get() { return reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR; }
  1668.             static inline void set(uint32_t value) { reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR = value; }
  1669.             template <EMasks ... flags>
  1670.             static inline void set_flags()
  1671.             {
  1672.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  1673.             }
  1674.             template <EMasks ... flags>
  1675.             static inline void clear_flags()
  1676.             {
  1677.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  1678.             }
  1679.             template <EMasks ... flags>
  1680.             static inline bool get_flags()
  1681.             {
  1682.                 return ((reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1683.             }
  1684.             static inline uint32_t get_TRACE_MODE() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR)->TRACE_MODE; }
  1685.             static inline void set_TRACE_MODE(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->CR)->TRACE_MODE = value; }
  1686.         };
  1687.         class APB1FZ
  1688.         {
  1689.         private:
  1690.             union APB1FZ_t
  1691.             {
  1692.                 struct
  1693.                 {
  1694.                     uint32_t FZ_DBG_TIM2_STOP: 1;
  1695.                     uint32_t FZ_DBG_TIM3_STOP: 1;
  1696.                     uint32_t FZ_DBG_TIM4_STOP: 1;
  1697.                     uint32_t FZ_DBG_TIM5_STOP: 1;
  1698.                     uint32_t FZ_DBG_TIM6_STOP: 1;
  1699.                     uint32_t FZ_DBG_TIM7_STOP: 1;
  1700.                     uint32_t FZ_DBG_TIM12_STOP: 1;
  1701.                     uint32_t FZ_DBG_TIM13_STOP: 1;
  1702.                     uint32_t FZ_DBG_TIM14_STOP: 1;
  1703.                     uint32_t reserved9      : 1;
  1704.                     uint32_t FZ_DBG_RTC_STOP: 1;
  1705.                     uint32_t FZ_DBG_WWDG_STOP: 1;
  1706.                     uint32_t FZ_DBG_IWDG_STOP: 1;
  1707.                     uint32_t reserved13     : 1;
  1708.                     uint32_t reserved14     : 1;
  1709.                     uint32_t reserved15     : 1;
  1710.                     uint32_t reserved16     : 1;
  1711.                     uint32_t reserved17     : 1;
  1712.                     uint32_t reserved18     : 1;
  1713.                     uint32_t reserved19     : 1;
  1714.                     uint32_t reserved20     : 1;
  1715.                     uint32_t FZ_DBG_I2C1_SMBUS_TIMEOUT: 1;
  1716.                     uint32_t FZ_DBG_I2C2_SMBUS_TIMEOUT: 1;
  1717.                     uint32_t FZ_DBG_I2C3_SMBUS_TIMEOUT: 1;
  1718.                     uint32_t reserved24     : 1;
  1719.                     uint32_t FZ_DBG_CAN1_STOP: 1;
  1720.                     uint32_t FZ_DBG_CAN2_STOP: 1;
  1721.                     uint32_t reserved27     : 5;
  1722.                 };
  1723.                 uint32_t RAW;
  1724.             };
  1725.         public:
  1726.             enum class EMasks: uint32_t
  1727.             {
  1728.                 FZ_DBG_TIM2_STOP       = (0x1U << 0),
  1729.                 FZ_DBG_TIM3_STOP       = (0x1U << 1),
  1730.                 FZ_DBG_TIM4_STOP       = (0x1U << 2),
  1731.                 FZ_DBG_TIM5_STOP       = (0x1U << 3),
  1732.                 FZ_DBG_TIM6_STOP       = (0x1U << 4),
  1733.                 FZ_DBG_TIM7_STOP       = (0x1U << 5),
  1734.                 FZ_DBG_TIM12_STOP      = (0x1U << 6),
  1735.                 FZ_DBG_TIM13_STOP      = (0x1U << 7),
  1736.                 FZ_DBG_TIM14_STOP      = (0x1U << 8),
  1737.                 FZ_DBG_RTC_STOP        = (0x1U << 10),
  1738.                 FZ_DBG_WWDG_STOP       = (0x1U << 11),
  1739.                 FZ_DBG_IWDG_STOP       = (0x1U << 12),
  1740.                 FZ_DBG_I2C1_SMBUS_TIMEOUT = (0x1U << 21),
  1741.                 FZ_DBG_I2C2_SMBUS_TIMEOUT = (0x1U << 22),
  1742.                 FZ_DBG_I2C3_SMBUS_TIMEOUT = (0x1U << 23),
  1743.                 FZ_DBG_CAN1_STOP       = (0x1U << 25),
  1744.                 FZ_DBG_CAN2_STOP       = (0x1U << 26),
  1745.             };
  1746.             static inline uint32_t get() { return reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB1FZ; }
  1747.             static inline void set(uint32_t value) { reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB1FZ = value; }
  1748.             template <EMasks ... flags>
  1749.             static inline void set_flags()
  1750.             {
  1751.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB1FZ |= SetBits<(std::uint32_t)flags...>();
  1752.             }
  1753.             template <EMasks ... flags>
  1754.             static inline void clear_flags()
  1755.             {
  1756.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB1FZ &= ~(SetBits<(std::uint32_t)flags...>());
  1757.             }
  1758.             template <EMasks ... flags>
  1759.             static inline bool get_flags()
  1760.             {
  1761.                 return ((reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB1FZ & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1762.             }
  1763.         };
  1764.         class APB2FZ
  1765.         {
  1766.         private:
  1767.             union APB2FZ_t
  1768.             {
  1769.                 struct
  1770.                 {
  1771.                     uint32_t FZ_DBG_TIM1_STOP: 1;
  1772.                     uint32_t FZ_DBG_TIM8_STOP: 1;
  1773.                     uint32_t reserved2      : 1;
  1774.                     uint32_t reserved3      : 1;
  1775.                     uint32_t reserved4      : 1;
  1776.                     uint32_t reserved5      : 1;
  1777.                     uint32_t reserved6      : 1;
  1778.                     uint32_t reserved7      : 1;
  1779.                     uint32_t reserved8      : 1;
  1780.                     uint32_t reserved9      : 1;
  1781.                     uint32_t reserved10     : 1;
  1782.                     uint32_t reserved11     : 1;
  1783.                     uint32_t reserved12     : 1;
  1784.                     uint32_t reserved13     : 1;
  1785.                     uint32_t reserved14     : 1;
  1786.                     uint32_t reserved15     : 1;
  1787.                     uint32_t FZ_DBG_TIM9_STOP: 1;
  1788.                     uint32_t FZ_DBG_TIM10_STOP: 1;
  1789.                     uint32_t FZ_DBG_TIM11_STOP: 1;
  1790.                     uint32_t reserved19     : 13;
  1791.                 };
  1792.                 uint32_t RAW;
  1793.             };
  1794.         public:
  1795.             enum class EMasks: uint32_t
  1796.             {
  1797.                 FZ_DBG_TIM1_STOP       = (0x1U << 0),
  1798.                 FZ_DBG_TIM8_STOP       = (0x1U << 1),
  1799.                 FZ_DBG_TIM9_STOP       = (0x1U << 16),
  1800.                 FZ_DBG_TIM10_STOP      = (0x1U << 17),
  1801.                 FZ_DBG_TIM11_STOP      = (0x1U << 18),
  1802.             };
  1803.             static inline uint32_t get() { return reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB2FZ; }
  1804.             static inline void set(uint32_t value) { reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB2FZ = value; }
  1805.             template <EMasks ... flags>
  1806.             static inline void set_flags()
  1807.             {
  1808.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB2FZ |= SetBits<(std::uint32_t)flags...>();
  1809.             }
  1810.             template <EMasks ... flags>
  1811.             static inline void clear_flags()
  1812.             {
  1813.                 reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB2FZ &= ~(SetBits<(std::uint32_t)flags...>());
  1814.             }
  1815.             template <EMasks ... flags>
  1816.             static inline bool get_flags()
  1817.             {
  1818.                 return ((reinterpret_cast<DBGMCU_t*>(STM32::DBGMCU_BASE)->APB2FZ & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1819.             }
  1820.         };
  1821.     };
  1822.     /* DCMI DEFINITION */
  1823.     class DCMI
  1824.     {
  1825.     private:
  1826.         struct DCMI_t
  1827.         {
  1828.             __IO uint32_t                 CR;
  1829.             __IO uint32_t                 SR;
  1830.             __IO uint32_t                 RISR;
  1831.             __IO uint32_t                 IER;
  1832.             __IO uint32_t                 MISR;
  1833.             __IO uint32_t                 ICR;
  1834.             __IO uint32_t                 ESCR;
  1835.             __IO uint32_t                 ESUR;
  1836.             __IO uint32_t                 CWSTRTR;
  1837.             __IO uint32_t                 CWSIZER;
  1838.             __IO uint32_t                 DR;
  1839.         };
  1840.     public:
  1841.         class CR
  1842.         {
  1843.         private:
  1844.             union CR_t
  1845.             {
  1846.                 struct
  1847.                 {
  1848.                     uint32_t CAPTURE        : 1;
  1849.                     uint32_t CM             : 1;
  1850.                     uint32_t CROP           : 1;
  1851.                     uint32_t JPEG           : 1;
  1852.                     uint32_t ESS            : 1;
  1853.                     uint32_t PCKPOL         : 1;
  1854.                     uint32_t HSPOL          : 1;
  1855.                     uint32_t VSPOL          : 1;
  1856.                     uint32_t reserved8      : 1;
  1857.                     uint32_t reserved9      : 1;
  1858.                     uint32_t reserved10     : 1;
  1859.                     uint32_t reserved11     : 1;
  1860.                     uint32_t CRE            : 1;
  1861.                     uint32_t reserved13     : 1;
  1862.                     uint32_t ENABLE         : 1;
  1863.                     uint32_t reserved15     : 17;
  1864.                 };
  1865.                 uint32_t RAW;
  1866.             };
  1867.         public:
  1868.             enum class EMasks: uint32_t
  1869.             {
  1870.                 CAPTURE                = (0x1U << 0),
  1871.                 CM                     = (0x1U << 1),
  1872.                 CROP                   = (0x1U << 2),
  1873.                 JPEG                   = (0x1U << 3),
  1874.                 ESS                    = (0x1U << 4),
  1875.                 PCKPOL                 = (0x1U << 5),
  1876.                 HSPOL                  = (0x1U << 6),
  1877.                 VSPOL                  = (0x1U << 7),
  1878.                 CRE                    = (0x1U << 12),
  1879.                 ENABLE                 = (0x1U << 14),
  1880.             };
  1881.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CR; }
  1882.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CR = value; }
  1883.             template <EMasks ... flags>
  1884.             static inline void set_flags()
  1885.             {
  1886.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  1887.             }
  1888.             template <EMasks ... flags>
  1889.             static inline void clear_flags()
  1890.             {
  1891.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  1892.             }
  1893.             template <EMasks ... flags>
  1894.             static inline bool get_flags()
  1895.             {
  1896.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1897.             }
  1898.         };
  1899.         class SR
  1900.         {
  1901.         private:
  1902.             union SR_t
  1903.             {
  1904.                 struct
  1905.                 {
  1906.                     uint32_t HSYNC          : 1;
  1907.                     uint32_t VSYNC          : 1;
  1908.                     uint32_t FNE            : 1;
  1909.                     uint32_t reserved3      : 29;
  1910.                 };
  1911.                 uint32_t RAW;
  1912.             };
  1913.         public:
  1914.             enum class EMasks: uint32_t
  1915.             {
  1916.                 HSYNC                  = (0x1U << 0),
  1917.                 VSYNC                  = (0x1U << 1),
  1918.                 FNE                    = (0x1U << 2),
  1919.             };
  1920.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->SR; }
  1921.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->SR = value; }
  1922.             template <EMasks ... flags>
  1923.             static inline void set_flags()
  1924.             {
  1925.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  1926.             }
  1927.             template <EMasks ... flags>
  1928.             static inline void clear_flags()
  1929.             {
  1930.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  1931.             }
  1932.             template <EMasks ... flags>
  1933.             static inline bool get_flags()
  1934.             {
  1935.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1936.             }
  1937.         };
  1938.         class RISR
  1939.         {
  1940.         private:
  1941.             union RISR_t
  1942.             {
  1943.                 struct
  1944.                 {
  1945.                     uint32_t FRAME_RIS      : 1;
  1946.                     uint32_t OVR_RIS        : 1;
  1947.                     uint32_t ERR_RIS        : 1;
  1948.                     uint32_t VSYNC_RIS      : 1;
  1949.                     uint32_t LINE_RIS       : 1;
  1950.                     uint32_t reserved5      : 27;
  1951.                 };
  1952.                 uint32_t RAW;
  1953.             };
  1954.         public:
  1955.             enum class EMasks: uint32_t
  1956.             {
  1957.                 FRAME_RIS              = (0x1U << 0),
  1958.                 OVR_RIS                = (0x1U << 1),
  1959.                 ERR_RIS                = (0x1U << 2),
  1960.                 VSYNC_RIS              = (0x1U << 3),
  1961.                 LINE_RIS               = (0x1U << 4),
  1962.             };
  1963.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->RISR; }
  1964.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->RISR = value; }
  1965.             template <EMasks ... flags>
  1966.             static inline void set_flags()
  1967.             {
  1968.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->RISR |= SetBits<(std::uint32_t)flags...>();
  1969.             }
  1970.             template <EMasks ... flags>
  1971.             static inline void clear_flags()
  1972.             {
  1973.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->RISR &= ~(SetBits<(std::uint32_t)flags...>());
  1974.             }
  1975.             template <EMasks ... flags>
  1976.             static inline bool get_flags()
  1977.             {
  1978.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->RISR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  1979.             }
  1980.         };
  1981.         class IER
  1982.         {
  1983.         private:
  1984.             union IER_t
  1985.             {
  1986.                 struct
  1987.                 {
  1988.                     uint32_t FRAME_IE       : 1;
  1989.                     uint32_t OVR_IE         : 1;
  1990.                     uint32_t ERR_IE         : 1;
  1991.                     uint32_t VSYNC_IE       : 1;
  1992.                     uint32_t LINE_IE        : 1;
  1993.                     uint32_t reserved5      : 27;
  1994.                 };
  1995.                 uint32_t RAW;
  1996.             };
  1997.         public:
  1998.             enum class EMasks: uint32_t
  1999.             {
  2000.                 FRAME_IE               = (0x1U << 0),
  2001.                 OVR_IE                 = (0x1U << 1),
  2002.                 ERR_IE                 = (0x1U << 2),
  2003.                 VSYNC_IE               = (0x1U << 3),
  2004.                 LINE_IE                = (0x1U << 4),
  2005.             };
  2006.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->IER; }
  2007.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->IER = value; }
  2008.             template <EMasks ... flags>
  2009.             static inline void set_flags()
  2010.             {
  2011.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->IER |= SetBits<(std::uint32_t)flags...>();
  2012.             }
  2013.             template <EMasks ... flags>
  2014.             static inline void clear_flags()
  2015.             {
  2016.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->IER &= ~(SetBits<(std::uint32_t)flags...>());
  2017.             }
  2018.             template <EMasks ... flags>
  2019.             static inline bool get_flags()
  2020.             {
  2021.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->IER & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2022.             }
  2023.         };
  2024.         class MISR
  2025.         {
  2026.         private:
  2027.             union MISR_t
  2028.             {
  2029.                 struct
  2030.                 {
  2031.                     uint32_t FRAME_MIS      : 1;
  2032.                     uint32_t OVR_MIS        : 1;
  2033.                     uint32_t ERR_MIS        : 1;
  2034.                     uint32_t VSYNC_MIS      : 1;
  2035.                     uint32_t LINE_MIS       : 1;
  2036.                     uint32_t reserved5      : 27;
  2037.                 };
  2038.                 uint32_t RAW;
  2039.             };
  2040.         public:
  2041.             enum class EMasks: uint32_t
  2042.             {
  2043.                 FRAME_MIS              = (0x1U << 0),
  2044.                 OVR_MIS                = (0x1U << 1),
  2045.                 ERR_MIS                = (0x1U << 2),
  2046.                 VSYNC_MIS              = (0x1U << 3),
  2047.                 LINE_MIS               = (0x1U << 4),
  2048.             };
  2049.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->MISR; }
  2050.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->MISR = value; }
  2051.             template <EMasks ... flags>
  2052.             static inline void set_flags()
  2053.             {
  2054.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->MISR |= SetBits<(std::uint32_t)flags...>();
  2055.             }
  2056.             template <EMasks ... flags>
  2057.             static inline void clear_flags()
  2058.             {
  2059.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->MISR &= ~(SetBits<(std::uint32_t)flags...>());
  2060.             }
  2061.             template <EMasks ... flags>
  2062.             static inline bool get_flags()
  2063.             {
  2064.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->MISR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2065.             }
  2066.         };
  2067.         class ICR
  2068.         {
  2069.         private:
  2070.             union ICR_t
  2071.             {
  2072.                 struct
  2073.                 {
  2074.                     uint32_t FRAME_ISC      : 1;
  2075.                     uint32_t OVR_ISC        : 1;
  2076.                     uint32_t ERR_ISC        : 1;
  2077.                     uint32_t VSYNC_ISC      : 1;
  2078.                     uint32_t LINE_ISC       : 1;
  2079.                     uint32_t reserved5      : 27;
  2080.                 };
  2081.                 uint32_t RAW;
  2082.             };
  2083.         public:
  2084.             enum class EMasks: uint32_t
  2085.             {
  2086.                 FRAME_ISC              = (0x1U << 0),
  2087.                 OVR_ISC                = (0x1U << 1),
  2088.                 ERR_ISC                = (0x1U << 2),
  2089.                 VSYNC_ISC              = (0x1U << 3),
  2090.                 LINE_ISC               = (0x1U << 4),
  2091.             };
  2092.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ICR; }
  2093.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ICR = value; }
  2094.             template <EMasks ... flags>
  2095.             static inline void set_flags()
  2096.             {
  2097.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ICR |= SetBits<(std::uint32_t)flags...>();
  2098.             }
  2099.             template <EMasks ... flags>
  2100.             static inline void clear_flags()
  2101.             {
  2102.                 reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ICR &= ~(SetBits<(std::uint32_t)flags...>());
  2103.             }
  2104.             template <EMasks ... flags>
  2105.             static inline bool get_flags()
  2106.             {
  2107.                 return ((reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ICR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2108.             }
  2109.         };
  2110.         class ESCR
  2111.         {
  2112.         private:
  2113.             union ESCR_t
  2114.             {
  2115.                 struct
  2116.                 {
  2117.                     uint32_t FSC            : 8;
  2118.                     uint32_t LSC            : 8;
  2119.                     uint32_t LEC            : 8;
  2120.                     uint32_t FEC            : 8;
  2121.                 };
  2122.                 uint32_t RAW;
  2123.             };
  2124.         public:
  2125.             enum class EMasks: uint32_t
  2126.             {
  2127.                 FSC                    = (0xFFU << 0),
  2128.                 LSC                    = (0xFFU << 8),
  2129.                 LEC                    = (0xFFU << 16),
  2130.                 FEC                    = (0xFFU << 24),
  2131.             };
  2132.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR; }
  2133.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR = value; }
  2134.             static inline uint32_t get_FSC() { return reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->FSC; }
  2135.             static inline void set_FSC(uint32_t value) { reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->FSC = value; }
  2136.             static inline uint32_t get_LSC() { return reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->LSC; }
  2137.             static inline void set_LSC(uint32_t value) { reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->LSC = value; }
  2138.             static inline uint32_t get_LEC() { return reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->LEC; }
  2139.             static inline void set_LEC(uint32_t value) { reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->LEC = value; }
  2140.             static inline uint32_t get_FEC() { return reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->FEC; }
  2141.             static inline void set_FEC(uint32_t value) { reinterpret_cast<__IO ESCR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESCR)->FEC = value; }
  2142.         };
  2143.         class ESUR
  2144.         {
  2145.         private:
  2146.             union ESUR_t
  2147.             {
  2148.                 struct
  2149.                 {
  2150.                     uint32_t FSU            : 8;
  2151.                     uint32_t LSU            : 8;
  2152.                     uint32_t LEU            : 8;
  2153.                     uint32_t FEU            : 8;
  2154.                 };
  2155.                 uint32_t RAW;
  2156.             };
  2157.         public:
  2158.             enum class EMasks: uint32_t
  2159.             {
  2160.                 FSU                    = (0xFFU << 0),
  2161.                 LSU                    = (0xFFU << 8),
  2162.                 LEU                    = (0xFFU << 16),
  2163.                 FEU                    = (0xFFU << 24),
  2164.             };
  2165.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR; }
  2166.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR = value; }
  2167.             static inline uint32_t get_FSU() { return reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->FSU; }
  2168.             static inline void set_FSU(uint32_t value) { reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->FSU = value; }
  2169.             static inline uint32_t get_LSU() { return reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->LSU; }
  2170.             static inline void set_LSU(uint32_t value) { reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->LSU = value; }
  2171.             static inline uint32_t get_LEU() { return reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->LEU; }
  2172.             static inline void set_LEU(uint32_t value) { reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->LEU = value; }
  2173.             static inline uint32_t get_FEU() { return reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->FEU; }
  2174.             static inline void set_FEU(uint32_t value) { reinterpret_cast<__IO ESUR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->ESUR)->FEU = value; }
  2175.         };
  2176.         class CWSTRTR
  2177.         {
  2178.         private:
  2179.             union CWSTRTR_t
  2180.             {
  2181.                 struct
  2182.                 {
  2183.                     uint32_t HOFFCNT        : 14;
  2184.                     uint32_t reserved14     : 1;
  2185.                     uint32_t reserved15     : 1;
  2186.                     uint32_t VST            : 13;
  2187.                     uint32_t reserved29     : 3;
  2188.                 };
  2189.                 uint32_t RAW;
  2190.             };
  2191.         public:
  2192.             enum class EMasks: uint32_t
  2193.             {
  2194.                 HOFFCNT                = (0x3FFFU << 0),
  2195.                 VST                    = (0x1FFFU << 16),
  2196.             };
  2197.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR; }
  2198.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR = value; }
  2199.             static inline uint32_t get_HOFFCNT() { return reinterpret_cast<__IO CWSTRTR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR)->HOFFCNT; }
  2200.             static inline void set_HOFFCNT(uint32_t value) { reinterpret_cast<__IO CWSTRTR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR)->HOFFCNT = value; }
  2201.             static inline uint32_t get_VST() { return reinterpret_cast<__IO CWSTRTR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR)->VST; }
  2202.             static inline void set_VST(uint32_t value) { reinterpret_cast<__IO CWSTRTR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSTRTR)->VST = value; }
  2203.         };
  2204.         class CWSIZER
  2205.         {
  2206.         private:
  2207.             union CWSIZER_t
  2208.             {
  2209.                 struct
  2210.                 {
  2211.                     uint32_t CAPCNT         : 14;
  2212.                     uint32_t reserved14     : 1;
  2213.                     uint32_t reserved15     : 1;
  2214.                     uint32_t VLINE          : 14;
  2215.                     uint32_t reserved30     : 2;
  2216.                 };
  2217.                 uint32_t RAW;
  2218.             };
  2219.         public:
  2220.             enum class EMasks: uint32_t
  2221.             {
  2222.                 CAPCNT                 = (0x3FFFU << 0),
  2223.                 VLINE                  = (0x3FFFU << 16),
  2224.             };
  2225.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER; }
  2226.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER = value; }
  2227.             static inline uint32_t get_CAPCNT() { return reinterpret_cast<__IO CWSIZER_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER)->CAPCNT; }
  2228.             static inline void set_CAPCNT(uint32_t value) { reinterpret_cast<__IO CWSIZER_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER)->CAPCNT = value; }
  2229.             static inline uint32_t get_VLINE() { return reinterpret_cast<__IO CWSIZER_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER)->VLINE; }
  2230.             static inline void set_VLINE(uint32_t value) { reinterpret_cast<__IO CWSIZER_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->CWSIZER)->VLINE = value; }
  2231.         };
  2232.         class DR
  2233.         {
  2234.         private:
  2235.             union DR_t
  2236.             {
  2237.                 struct
  2238.                 {
  2239.                     uint32_t BYTE0          : 8;
  2240.                     uint32_t BYTE1          : 8;
  2241.                     uint32_t BYTE2          : 8;
  2242.                     uint32_t BYTE3          : 8;
  2243.                 };
  2244.                 uint32_t RAW;
  2245.             };
  2246.         public:
  2247.             enum class EMasks: uint32_t
  2248.             {
  2249.                 BYTE0                  = (0xFFU << 0),
  2250.                 BYTE1                  = (0xFFU << 8),
  2251.                 BYTE2                  = (0xFFU << 16),
  2252.                 BYTE3                  = (0xFFU << 24),
  2253.             };
  2254.             static inline uint32_t get() { return reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR; }
  2255.             static inline void set(uint32_t value) { reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR = value; }
  2256.             static inline uint32_t get_BYTE0() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE0; }
  2257.             static inline void set_BYTE0(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE0 = value; }
  2258.             static inline uint32_t get_BYTE1() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE1; }
  2259.             static inline void set_BYTE1(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE1 = value; }
  2260.             static inline uint32_t get_BYTE2() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE2; }
  2261.             static inline void set_BYTE2(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE2 = value; }
  2262.             static inline uint32_t get_BYTE3() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE3; }
  2263.             static inline void set_BYTE3(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<DCMI_t*>(STM32::DCMI_BASE)->DR)->BYTE3 = value; }
  2264.         };
  2265.     };
  2266.     /* DMA_Stream DEFINITION */
  2267.     template <uint32_t reg_base>
  2268.     class DMA_Stream
  2269.     {
  2270. #warning TODO: DMA_Stream
  2271.     };
  2272.     /* DMA DEFINITION */
  2273.     template <uint32_t reg_base>
  2274.     class DMA
  2275.     {
  2276. #warning TODO: DMA
  2277.     };
  2278.     /* ETH DEFINITION */
  2279.     class ETH
  2280.     {
  2281.     private:
  2282.         struct ETH_t
  2283.         {
  2284.             __IO uint32_t                 MACCR;
  2285.             __IO uint32_t                 MACFFR;
  2286.             __IO uint32_t                 MACHTHR;
  2287.             __IO uint32_t                 MACHTLR;
  2288.             __IO uint32_t                 MACMIIAR;
  2289.             __IO uint32_t                 MACMIIDR;
  2290.             __IO uint32_t                 MACFCR;
  2291.             __IO uint32_t                 MACVLANTR;
  2292.             uint32_t                      RESERVED0[2];
  2293.             __IO uint32_t                 MACRWUFFR;
  2294.             __IO uint32_t                 MACPMTCSR;
  2295.             uint32_t                      RESERVED1;
  2296.             __IO uint32_t                 MACDBGR;
  2297.             __IO uint32_t                 MACSR;
  2298.             __IO uint32_t                 MACIMR;
  2299.             __IO uint32_t                 MACA0HR;
  2300.             __IO uint32_t                 MACA0LR;
  2301.             __IO uint32_t                 MACA1HR;
  2302.             __IO uint32_t                 MACA1LR;
  2303.             __IO uint32_t                 MACA2HR;
  2304.             __IO uint32_t                 MACA2LR;
  2305.             __IO uint32_t                 MACA3HR;
  2306.             __IO uint32_t                 MACA3LR;
  2307.             uint32_t                      RESERVED2[40];
  2308.             __IO uint32_t                 MMCCR;
  2309.             __IO uint32_t                 MMCRIR;
  2310.             __IO uint32_t                 MMCTIR;
  2311.             __IO uint32_t                 MMCRIMR;
  2312.             __IO uint32_t                 MMCTIMR;
  2313.             uint32_t                      RESERVED3[14];
  2314.             __IO uint32_t                 MMCTGFSCCR;
  2315.             __IO uint32_t                 MMCTGFMSCCR;
  2316.             uint32_t                      RESERVED4[5];
  2317.             __IO uint32_t                 MMCTGFCR;
  2318.             uint32_t                      RESERVED5[10];
  2319.             __IO uint32_t                 MMCRFCECR;
  2320.             __IO uint32_t                 MMCRFAECR;
  2321.             uint32_t                      RESERVED6[10];
  2322.             __IO uint32_t                 MMCRGUFCR;
  2323.             uint32_t                      RESERVED7[334];
  2324.             __IO uint32_t                 PTPTSCR;
  2325.             __IO uint32_t                 PTPSSIR;
  2326.             __IO uint32_t                 PTPTSHR;
  2327.             __IO uint32_t                 PTPTSLR;
  2328.             __IO uint32_t                 PTPTSHUR;
  2329.             __IO uint32_t                 PTPTSLUR;
  2330.             __IO uint32_t                 PTPTSAR;
  2331.             __IO uint32_t                 PTPTTHR;
  2332.             __IO uint32_t                 PTPTTLR;
  2333.             __IO uint32_t                 RESERVED8;
  2334.             __IO uint32_t                 PTPTSSR;
  2335.             uint32_t                      RESERVED9[565];
  2336.             __IO uint32_t                 DMABMR;
  2337.             __IO uint32_t                 DMATPDR;
  2338.             __IO uint32_t                 DMARPDR;
  2339.             __IO uint32_t                 DMARDLAR;
  2340.             __IO uint32_t                 DMATDLAR;
  2341.             __IO uint32_t                 DMASR;
  2342.             __IO uint32_t                 DMAOMR;
  2343.             __IO uint32_t                 DMAIER;
  2344.             __IO uint32_t                 DMAMFBOCR;
  2345.             __IO uint32_t                 DMARSWTR;
  2346.             uint32_t                      RESERVED10[8];
  2347.             __IO uint32_t                 DMACHTDR;
  2348.             __IO uint32_t                 DMACHRDR;
  2349.             __IO uint32_t                 DMACHTBAR;
  2350.             __IO uint32_t                 DMACHRBAR;
  2351.         };
  2352.     public:
  2353.         class MACCR
  2354.         {
  2355.         private:
  2356.             union MACCR_t
  2357.             {
  2358.                 struct
  2359.                 {
  2360.                     uint32_t reserved0      : 1;
  2361.                     uint32_t reserved1      : 1;
  2362.                     uint32_t reserved2      : 1;
  2363.                     uint32_t reserved3      : 1;
  2364.                     uint32_t reserved4      : 1;
  2365.                     uint32_t reserved5      : 1;
  2366.                     uint32_t reserved6      : 1;
  2367.                     uint32_t reserved7      : 1;
  2368.                     uint32_t reserved8      : 1;
  2369.                     uint32_t reserved9      : 1;
  2370.                     uint32_t reserved10     : 1;
  2371.                     uint32_t reserved11     : 1;
  2372.                     uint32_t reserved12     : 1;
  2373.                     uint32_t reserved13     : 1;
  2374.                     uint32_t reserved14     : 1;
  2375.                     uint32_t reserved15     : 1;
  2376.                     uint32_t reserved16     : 1;
  2377.                     uint32_t reserved17     : 1;
  2378.                     uint32_t reserved18     : 1;
  2379.                     uint32_t reserved19     : 1;
  2380.                     uint32_t reserved20     : 1;
  2381.                     uint32_t reserved21     : 1;
  2382.                     uint32_t reserved22     : 1;
  2383.                     uint32_t WD             : 1;
  2384.                     uint32_t JD             : 1;
  2385.                     uint32_t IFG            : 3;
  2386.                     uint32_t CSD            : 1;
  2387.                     uint32_t FES            : 1;
  2388.                     uint32_t ROD            : 1;
  2389.                     uint32_t LM             : 1;
  2390.                     uint32_t DM             : 1;
  2391.                     uint32_t IPCO           : 1;
  2392.                     uint32_t RD             : 1;
  2393.                     uint32_t APCS           : 1;
  2394.                     uint32_t BL             : 2;
  2395.                     uint32_t DC             : 1;
  2396.                     uint32_t TE             : 1;
  2397.                     uint32_t RE             : 1;
  2398.                 };
  2399.                 uint32_t RAW;
  2400.             };
  2401.         public:
  2402.             enum class EMasks: uint32_t
  2403.             {
  2404.                 WD                     = (0x1U << 23),
  2405.                 JD                     = (0x1U << 22),
  2406.                 IFG                    = (0x7U << 17),
  2407.                 CSD                    = (0x1U << 16),
  2408.                 FES                    = (0x1U << 14),
  2409.                 ROD                    = (0x1U << 13),
  2410.                 LM                     = (0x1U << 12),
  2411.                 DM                     = (0x1U << 11),
  2412.                 IPCO                   = (0x1U << 10),
  2413.                 RD                     = (0x1U << 9),
  2414.                 APCS                   = (0x1U << 7),
  2415.                 BL                     = (0x3U << 5),
  2416.                 DC                     = (0x1U << 4),
  2417.                 TE                     = (0x1U << 3),
  2418.                 RE                     = (0x1U << 2),
  2419.             };
  2420.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR; }
  2421.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR = value; }
  2422.             template <EMasks ... flags>
  2423.             static inline void set_flags()
  2424.             {
  2425.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR |= SetBits<(std::uint32_t)flags...>();
  2426.             }
  2427.             template <EMasks ... flags>
  2428.             static inline void clear_flags()
  2429.             {
  2430.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR &= ~(SetBits<(std::uint32_t)flags...>());
  2431.             }
  2432.             template <EMasks ... flags>
  2433.             static inline bool get_flags()
  2434.             {
  2435.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2436.             }
  2437.             static inline uint32_t get_IFG() { return reinterpret_cast<__IO MACCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR)->IFG; }
  2438.             static inline void set_IFG(uint32_t value) { reinterpret_cast<__IO MACCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR)->IFG = value; }
  2439.             static inline uint32_t get_BL() { return reinterpret_cast<__IO MACCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR)->BL; }
  2440.             static inline void set_BL(uint32_t value) { reinterpret_cast<__IO MACCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACCR)->BL = value; }
  2441.         };
  2442.         class MACFFR
  2443.         {
  2444.         private:
  2445.             union MACFFR_t
  2446.             {
  2447.                 struct
  2448.                 {
  2449.                     uint32_t reserved0      : 1;
  2450.                     uint32_t reserved1      : 1;
  2451.                     uint32_t reserved2      : 1;
  2452.                     uint32_t reserved3      : 1;
  2453.                     uint32_t reserved4      : 1;
  2454.                     uint32_t reserved5      : 1;
  2455.                     uint32_t reserved6      : 1;
  2456.                     uint32_t reserved7      : 1;
  2457.                     uint32_t reserved8      : 1;
  2458.                     uint32_t reserved9      : 1;
  2459.                     uint32_t reserved10     : 1;
  2460.                     uint32_t reserved11     : 1;
  2461.                     uint32_t reserved12     : 1;
  2462.                     uint32_t reserved13     : 1;
  2463.                     uint32_t reserved14     : 1;
  2464.                     uint32_t reserved15     : 1;
  2465.                     uint32_t reserved16     : 1;
  2466.                     uint32_t reserved17     : 1;
  2467.                     uint32_t reserved18     : 1;
  2468.                     uint32_t reserved19     : 1;
  2469.                     uint32_t reserved20     : 1;
  2470.                     uint32_t reserved21     : 1;
  2471.                     uint32_t reserved22     : 1;
  2472.                     uint32_t reserved23     : 1;
  2473.                     uint32_t reserved24     : 1;
  2474.                     uint32_t reserved25     : 1;
  2475.                     uint32_t reserved26     : 1;
  2476.                     uint32_t reserved27     : 1;
  2477.                     uint32_t reserved28     : 1;
  2478.                     uint32_t reserved29     : 1;
  2479.                     uint32_t reserved30     : 1;
  2480.                     uint32_t RA             : 1;
  2481.                     uint32_t HPF            : 1;
  2482.                     uint32_t SAF            : 1;
  2483.                     uint32_t SAIF           : 1;
  2484.                     uint32_t PCF            : 2;
  2485.                     uint32_t PCF_BlockAll   : 1;
  2486.                     uint32_t PCF_ForwardAll : 1;
  2487.                     uint32_t PCF_ForwardPassedAddrFilter: 2;
  2488.                     uint32_t BFD            : 1;
  2489.                     uint32_t PAM            : 1;
  2490.                     uint32_t DAIF           : 1;
  2491.                     uint32_t HM             : 1;
  2492.                     uint32_t HU             : 1;
  2493.                     uint32_t PM             : 1;
  2494.                 };
  2495.                 uint32_t RAW;
  2496.             };
  2497.         public:
  2498.             enum class EMasks: uint32_t
  2499.             {
  2500.                 RA                     = (0x1U << 31),
  2501.                 HPF                    = (0x1U << 10),
  2502.                 SAF                    = (0x1U << 9),
  2503.                 SAIF                   = (0x1U << 8),
  2504.                 PCF                    = (0x3U << 6),
  2505.                 PCF_BlockAll           = (0x1U << 6),
  2506.                 PCF_ForwardAll         = (0x1U << 7),
  2507.                 PCF_ForwardPassedAddrFilter = (0x3U << 6),
  2508.                 BFD                    = (0x1U << 5),
  2509.                 PAM                    = (0x1U << 4),
  2510.                 DAIF                   = (0x1U << 3),
  2511.                 HM                     = (0x1U << 2),
  2512.                 HU                     = (0x1U << 1),
  2513.                 PM                     = (0x1U << 0),
  2514.             };
  2515.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR; }
  2516.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR = value; }
  2517.             template <EMasks ... flags>
  2518.             static inline void set_flags()
  2519.             {
  2520.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR |= SetBits<(std::uint32_t)flags...>();
  2521.             }
  2522.             template <EMasks ... flags>
  2523.             static inline void clear_flags()
  2524.             {
  2525.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR &= ~(SetBits<(std::uint32_t)flags...>());
  2526.             }
  2527.             template <EMasks ... flags>
  2528.             static inline bool get_flags()
  2529.             {
  2530.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2531.             }
  2532.             static inline uint32_t get_PCF() { return reinterpret_cast<__IO MACFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR)->PCF; }
  2533.             static inline void set_PCF(uint32_t value) { reinterpret_cast<__IO MACFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR)->PCF = value; }
  2534.             static inline uint32_t get_PCF_ForwardPassedAddrFilter() { return reinterpret_cast<__IO MACFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR)->PCF_ForwardPassedAddrFilter; }
  2535.             static inline void set_PCF_ForwardPassedAddrFilter(uint32_t value) { reinterpret_cast<__IO MACFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFFR)->PCF_ForwardPassedAddrFilter = value; }
  2536.         };
  2537.         class MACHTHR
  2538.         {
  2539.         private:
  2540.             union MACHTHR_t
  2541.             {
  2542.                 struct
  2543.                 {
  2544.                     uint32_t HTH            : 32;
  2545.                 };
  2546.                 uint32_t RAW;
  2547.             };
  2548.         public:
  2549.             enum class EMasks: uint32_t
  2550.             {
  2551.                 HTH                    = (0xFFFFFFFFU << 0),
  2552.             };
  2553.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTHR; }
  2554.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTHR = value; }
  2555.             static inline uint32_t get_HTH() { return reinterpret_cast<__IO MACHTHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTHR)->HTH; }
  2556.             static inline void set_HTH(uint32_t value) { reinterpret_cast<__IO MACHTHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTHR)->HTH = value; }
  2557.         };
  2558.         class MACHTLR
  2559.         {
  2560.         private:
  2561.             union MACHTLR_t
  2562.             {
  2563.                 struct
  2564.                 {
  2565.                     uint32_t HTL            : 32;
  2566.                 };
  2567.                 uint32_t RAW;
  2568.             };
  2569.         public:
  2570.             enum class EMasks: uint32_t
  2571.             {
  2572.                 HTL                    = (0xFFFFFFFFU << 0),
  2573.             };
  2574.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTLR; }
  2575.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTLR = value; }
  2576.             static inline uint32_t get_HTL() { return reinterpret_cast<__IO MACHTLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTLR)->HTL; }
  2577.             static inline void set_HTL(uint32_t value) { reinterpret_cast<__IO MACHTLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACHTLR)->HTL = value; }
  2578.         };
  2579.         class MACMIIAR
  2580.         {
  2581.         private:
  2582.             union MACMIIAR_t
  2583.             {
  2584.                 struct
  2585.                 {
  2586.                     uint32_t reserved0      : 1;
  2587.                     uint32_t reserved1      : 1;
  2588.                     uint32_t reserved2      : 1;
  2589.                     uint32_t reserved3      : 1;
  2590.                     uint32_t reserved4      : 1;
  2591.                     uint32_t reserved5      : 1;
  2592.                     uint32_t reserved6      : 1;
  2593.                     uint32_t reserved7      : 1;
  2594.                     uint32_t reserved8      : 1;
  2595.                     uint32_t reserved9      : 1;
  2596.                     uint32_t reserved10     : 1;
  2597.                     uint32_t PA             : 5;
  2598.                     uint32_t MR             : 5;
  2599.                     uint32_t CR             : 3;
  2600.                     uint32_t CR_Div62       : 1;
  2601.                     uint32_t CR_Div16       : 1;
  2602.                     uint32_t CR_Div26       : 2;
  2603.                     uint32_t CR_Div102      : 1;
  2604.                     uint32_t MW             : 1;
  2605.                     uint32_t MB             : 1;
  2606.                     uint32_t reserved31     : 1;
  2607.                 };
  2608.                 uint32_t RAW;
  2609.             };
  2610.         public:
  2611.             enum class EMasks: uint32_t
  2612.             {
  2613.                 PA                     = (0x1FU << 11),
  2614.                 MR                     = (0x1FU << 6),
  2615.                 CR                     = (0x7U << 2),
  2616.                 CR_Div62               = (0x1U << 2),
  2617.                 CR_Div16               = (0x1U << 3),
  2618.                 CR_Div26               = (0x3U << 2),
  2619.                 CR_Div102              = (0x1U << 4),
  2620.                 MW                     = (0x1U << 1),
  2621.                 MB                     = (0x1U << 0),
  2622.             };
  2623.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR; }
  2624.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR = value; }
  2625.             template <EMasks ... flags>
  2626.             static inline void set_flags()
  2627.             {
  2628.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR |= SetBits<(std::uint32_t)flags...>();
  2629.             }
  2630.             template <EMasks ... flags>
  2631.             static inline void clear_flags()
  2632.             {
  2633.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR &= ~(SetBits<(std::uint32_t)flags...>());
  2634.             }
  2635.             template <EMasks ... flags>
  2636.             static inline bool get_flags()
  2637.             {
  2638.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2639.             }
  2640.             static inline uint32_t get_PA() { return reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->PA; }
  2641.             static inline void set_PA(uint32_t value) { reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->PA = value; }
  2642.             static inline uint32_t get_MR() { return reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->MR; }
  2643.             static inline void set_MR(uint32_t value) { reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->MR = value; }
  2644.             static inline uint32_t get_CR() { return reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->CR; }
  2645.             static inline void set_CR(uint32_t value) { reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->CR = value; }
  2646.             static inline uint32_t get_CR_Div26() { return reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->CR_Div26; }
  2647.             static inline void set_CR_Div26(uint32_t value) { reinterpret_cast<__IO MACMIIAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIAR)->CR_Div26 = value; }
  2648.         };
  2649.         class MACMIIDR
  2650.         {
  2651.         private:
  2652.             union MACMIIDR_t
  2653.             {
  2654.                 struct
  2655.                 {
  2656.                     uint32_t MD             : 16;
  2657.                     uint32_t reserved16     : 16;
  2658.                 };
  2659.                 uint32_t RAW;
  2660.             };
  2661.         public:
  2662.             enum class EMasks: uint32_t
  2663.             {
  2664.                 MD                     = (0xFFFFU << 0),
  2665.             };
  2666.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIDR; }
  2667.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIDR = value; }
  2668.             static inline uint32_t get_MD() { return reinterpret_cast<__IO MACMIIDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIDR)->MD; }
  2669.             static inline void set_MD(uint32_t value) { reinterpret_cast<__IO MACMIIDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACMIIDR)->MD = value; }
  2670.         };
  2671.         class MACFCR
  2672.         {
  2673.         private:
  2674.             union MACFCR_t
  2675.             {
  2676.                 struct
  2677.                 {
  2678.                     uint32_t reserved0      : 1;
  2679.                     uint32_t reserved1      : 1;
  2680.                     uint32_t reserved2      : 1;
  2681.                     uint32_t reserved3      : 1;
  2682.                     uint32_t reserved4      : 1;
  2683.                     uint32_t reserved5      : 1;
  2684.                     uint32_t reserved6      : 1;
  2685.                     uint32_t reserved7      : 1;
  2686.                     uint32_t reserved8      : 1;
  2687.                     uint32_t reserved9      : 1;
  2688.                     uint32_t reserved10     : 1;
  2689.                     uint32_t reserved11     : 1;
  2690.                     uint32_t reserved12     : 1;
  2691.                     uint32_t reserved13     : 1;
  2692.                     uint32_t reserved14     : 1;
  2693.                     uint32_t reserved15     : 1;
  2694.                     uint32_t PT             : 16;
  2695.                     uint32_t ZQPD           : 1;
  2696.                     uint32_t PLT            : 2;
  2697.                     uint32_t PLT_Minus28    : 1;
  2698.                     uint32_t PLT_Minus144   : 1;
  2699.                     uint32_t PLT_Minus256   : 2;
  2700.                     uint32_t UPFD           : 1;
  2701.                     uint32_t RFCE           : 1;
  2702.                     uint32_t TFCE           : 1;
  2703.                     uint32_t FCBBPA         : 1;
  2704.                 };
  2705.                 uint32_t RAW;
  2706.             };
  2707.         public:
  2708.             enum class EMasks: uint32_t
  2709.             {
  2710.                 PT                     = (0xFFFFU << 16),
  2711.                 ZQPD                   = (0x1U << 7),
  2712.                 PLT                    = (0x3U << 4),
  2713.                 PLT_Minus28            = (0x1U << 4),
  2714.                 PLT_Minus144           = (0x1U << 5),
  2715.                 PLT_Minus256           = (0x3U << 4),
  2716.                 UPFD                   = (0x1U << 3),
  2717.                 RFCE                   = (0x1U << 2),
  2718.                 TFCE                   = (0x1U << 1),
  2719.                 FCBBPA                 = (0x1U << 0),
  2720.             };
  2721.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR; }
  2722.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR = value; }
  2723.             template <EMasks ... flags>
  2724.             static inline void set_flags()
  2725.             {
  2726.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR |= SetBits<(std::uint32_t)flags...>();
  2727.             }
  2728.             template <EMasks ... flags>
  2729.             static inline void clear_flags()
  2730.             {
  2731.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR &= ~(SetBits<(std::uint32_t)flags...>());
  2732.             }
  2733.             template <EMasks ... flags>
  2734.             static inline bool get_flags()
  2735.             {
  2736.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2737.             }
  2738.             static inline uint32_t get_PT() { return reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PT; }
  2739.             static inline void set_PT(uint32_t value) { reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PT = value; }
  2740.             static inline uint32_t get_PLT() { return reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PLT; }
  2741.             static inline void set_PLT(uint32_t value) { reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PLT = value; }
  2742.             static inline uint32_t get_PLT_Minus256() { return reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PLT_Minus256; }
  2743.             static inline void set_PLT_Minus256(uint32_t value) { reinterpret_cast<__IO MACFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACFCR)->PLT_Minus256 = value; }
  2744.         };
  2745.         class MACVLANTR
  2746.         {
  2747.         private:
  2748.             union MACVLANTR_t
  2749.             {
  2750.                 struct
  2751.                 {
  2752.                     uint32_t reserved0      : 1;
  2753.                     uint32_t reserved1      : 1;
  2754.                     uint32_t reserved2      : 1;
  2755.                     uint32_t reserved3      : 1;
  2756.                     uint32_t reserved4      : 1;
  2757.                     uint32_t reserved5      : 1;
  2758.                     uint32_t reserved6      : 1;
  2759.                     uint32_t reserved7      : 1;
  2760.                     uint32_t reserved8      : 1;
  2761.                     uint32_t reserved9      : 1;
  2762.                     uint32_t reserved10     : 1;
  2763.                     uint32_t reserved11     : 1;
  2764.                     uint32_t reserved12     : 1;
  2765.                     uint32_t reserved13     : 1;
  2766.                     uint32_t reserved14     : 1;
  2767.                     uint32_t reserved15     : 1;
  2768.                     uint32_t VLANTC         : 1;
  2769.                     uint32_t VLANTI         : 16;
  2770.                 };
  2771.                 uint32_t RAW;
  2772.             };
  2773.         public:
  2774.             enum class EMasks: uint32_t
  2775.             {
  2776.                 VLANTC                 = (0x1U << 16),
  2777.                 VLANTI                 = (0xFFFFU << 0),
  2778.             };
  2779.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR; }
  2780.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR = value; }
  2781.             template <EMasks ... flags>
  2782.             static inline void set_flags()
  2783.             {
  2784.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR |= SetBits<(std::uint32_t)flags...>();
  2785.             }
  2786.             template <EMasks ... flags>
  2787.             static inline void clear_flags()
  2788.             {
  2789.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR &= ~(SetBits<(std::uint32_t)flags...>());
  2790.             }
  2791.             template <EMasks ... flags>
  2792.             static inline bool get_flags()
  2793.             {
  2794.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2795.             }
  2796.             static inline uint32_t get_VLANTI() { return reinterpret_cast<__IO MACVLANTR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR)->VLANTI; }
  2797.             static inline void set_VLANTI(uint32_t value) { reinterpret_cast<__IO MACVLANTR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACVLANTR)->VLANTI = value; }
  2798.         };
  2799.         class MACRWUFFR
  2800.         {
  2801.         private:
  2802.             union MACRWUFFR_t
  2803.             {
  2804.                 struct
  2805.                 {
  2806.                     uint32_t D              : 32;
  2807.                 };
  2808.                 uint32_t RAW;
  2809.             };
  2810.         public:
  2811.             enum class EMasks: uint32_t
  2812.             {
  2813.                 D                      = (0xFFFFFFFFU << 0),
  2814.             };
  2815.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACRWUFFR; }
  2816.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACRWUFFR = value; }
  2817.             static inline uint32_t get_D() { return reinterpret_cast<__IO MACRWUFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACRWUFFR)->D; }
  2818.             static inline void set_D(uint32_t value) { reinterpret_cast<__IO MACRWUFFR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACRWUFFR)->D = value; }
  2819.         };
  2820.         class MACPMTCSR
  2821.         {
  2822.         private:
  2823.             union MACPMTCSR_t
  2824.             {
  2825.                 struct
  2826.                 {
  2827.                     uint32_t reserved0      : 1;
  2828.                     uint32_t reserved1      : 1;
  2829.                     uint32_t reserved2      : 1;
  2830.                     uint32_t reserved3      : 1;
  2831.                     uint32_t reserved4      : 1;
  2832.                     uint32_t reserved5      : 1;
  2833.                     uint32_t reserved6      : 1;
  2834.                     uint32_t reserved7      : 1;
  2835.                     uint32_t reserved8      : 1;
  2836.                     uint32_t reserved9      : 1;
  2837.                     uint32_t reserved10     : 1;
  2838.                     uint32_t reserved11     : 1;
  2839.                     uint32_t reserved12     : 1;
  2840.                     uint32_t reserved13     : 1;
  2841.                     uint32_t reserved14     : 1;
  2842.                     uint32_t reserved15     : 1;
  2843.                     uint32_t reserved16     : 1;
  2844.                     uint32_t reserved17     : 1;
  2845.                     uint32_t reserved18     : 1;
  2846.                     uint32_t reserved19     : 1;
  2847.                     uint32_t reserved20     : 1;
  2848.                     uint32_t reserved21     : 1;
  2849.                     uint32_t reserved22     : 1;
  2850.                     uint32_t reserved23     : 1;
  2851.                     uint32_t reserved24     : 1;
  2852.                     uint32_t reserved25     : 1;
  2853.                     uint32_t reserved26     : 1;
  2854.                     uint32_t reserved27     : 1;
  2855.                     uint32_t reserved28     : 1;
  2856.                     uint32_t reserved29     : 1;
  2857.                     uint32_t reserved30     : 1;
  2858.                     uint32_t WFFRPR         : 1;
  2859.                     uint32_t GU             : 1;
  2860.                     uint32_t WFR            : 1;
  2861.                     uint32_t MPR            : 1;
  2862.                     uint32_t WFE            : 1;
  2863.                     uint32_t MPE            : 1;
  2864.                     uint32_t PD             : 1;
  2865.                 };
  2866.                 uint32_t RAW;
  2867.             };
  2868.         public:
  2869.             enum class EMasks: uint32_t
  2870.             {
  2871.                 WFFRPR                 = (0x1U << 31),
  2872.                 GU                     = (0x1U << 9),
  2873.                 WFR                    = (0x1U << 6),
  2874.                 MPR                    = (0x1U << 5),
  2875.                 WFE                    = (0x1U << 2),
  2876.                 MPE                    = (0x1U << 1),
  2877.                 PD                     = (0x1U << 0),
  2878.             };
  2879.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACPMTCSR; }
  2880.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACPMTCSR = value; }
  2881.             template <EMasks ... flags>
  2882.             static inline void set_flags()
  2883.             {
  2884.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACPMTCSR |= SetBits<(std::uint32_t)flags...>();
  2885.             }
  2886.             template <EMasks ... flags>
  2887.             static inline void clear_flags()
  2888.             {
  2889.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACPMTCSR &= ~(SetBits<(std::uint32_t)flags...>());
  2890.             }
  2891.             template <EMasks ... flags>
  2892.             static inline bool get_flags()
  2893.             {
  2894.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACPMTCSR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  2895.             }
  2896.         };
  2897.         class MACDBGR
  2898.         {
  2899.         private:
  2900.             union MACDBGR_t
  2901.             {
  2902.                 struct
  2903.                 {
  2904.                     uint32_t reserved0      : 1;
  2905.                     uint32_t reserved1      : 1;
  2906.                     uint32_t reserved2      : 1;
  2907.                     uint32_t reserved3      : 1;
  2908.                     uint32_t reserved4      : 1;
  2909.                     uint32_t reserved5      : 1;
  2910.                     uint32_t reserved6      : 1;
  2911.                     uint32_t reserved7      : 1;
  2912.                     uint32_t reserved8      : 1;
  2913.                     uint32_t reserved9      : 1;
  2914.                     uint32_t reserved10     : 1;
  2915.                     uint32_t reserved11     : 1;
  2916.                     uint32_t reserved12     : 1;
  2917.                     uint32_t reserved13     : 1;
  2918.                     uint32_t reserved14     : 1;
  2919.                     uint32_t reserved15     : 1;
  2920.                     uint32_t reserved16     : 1;
  2921.                     uint32_t reserved17     : 1;
  2922.                     uint32_t reserved18     : 1;
  2923.                     uint32_t reserved19     : 1;
  2924.                     uint32_t reserved20     : 1;
  2925.                     uint32_t reserved21     : 1;
  2926.                     uint32_t reserved22     : 1;
  2927.                     uint32_t reserved23     : 1;
  2928.                     uint32_t reserved24     : 1;
  2929.                     uint32_t TFF            : 1;
  2930.                     uint32_t TFNE           : 1;
  2931.                     uint32_t TFWA           : 1;
  2932.                     uint32_t TFRS           : 2;
  2933.                     uint32_t TFRS_WRITING   : 2;
  2934.                     uint32_t TFRS_WAITING   : 1;
  2935.                     uint32_t TFRS_READ      : 1;
  2936.                     uint32_t MTP            : 1;
  2937.                     uint32_t MTFCS          : 2;
  2938.                     uint32_t MTFCS_TRANSFERRING: 2;
  2939.                     uint32_t MTFCS_GENERATINGPCF: 1;
  2940.                     uint32_t MTFCS_WAITING  : 1;
  2941.                     uint32_t MMTEA          : 1;
  2942.                     uint32_t RFFL           : 2;
  2943.                     uint32_t RFFL_FULL      : 2;
  2944.                     uint32_t RFFL_ABOVEFCT  : 1;
  2945.                     uint32_t RFFL_BELOWFCT  : 1;
  2946.                     uint32_t RFRCS          : 2;
  2947.                     uint32_t RFRCS_FLUSHING : 2;
  2948.                     uint32_t RFRCS_STATUSREADING: 1;
  2949.                     uint32_t RFRCS_DATAREADING: 1;
  2950.                     uint32_t RFWRA          : 1;
  2951.                     uint32_t MSFRWCS        : 2;
  2952.                     uint32_t MMRPEA         : 1;
  2953.                 };
  2954.                 uint32_t RAW;
  2955.             };
  2956.         public:
  2957.             enum class EMasks: uint32_t
  2958.             {
  2959.                 TFF                    = (0x1U << 25),
  2960.                 TFNE                   = (0x1U << 24),
  2961.                 TFWA                   = (0x1U << 22),
  2962.                 TFRS                   = (0x3U << 20),
  2963.                 TFRS_WRITING           = (0x3U << 20),
  2964.                 TFRS_WAITING           = (0x1U << 21),
  2965.                 TFRS_READ              = (0x1U << 20),
  2966.                 MTP                    = (0x1U << 19),
  2967.                 MTFCS                  = (0x3U << 17),
  2968.                 MTFCS_TRANSFERRING     = (0x3U << 17),
  2969.                 MTFCS_GENERATINGPCF    = (0x1U << 18),
  2970.                 MTFCS_WAITING          = (0x1U << 17),
  2971.                 MMTEA                  = (0x1U << 16),
  2972.                 RFFL                   = (0x3U << 8),
  2973.                 RFFL_FULL              = (0x3U << 8),
  2974.                 RFFL_ABOVEFCT          = (0x1U << 9),
  2975.                 RFFL_BELOWFCT          = (0x1U << 8),
  2976.                 RFRCS                  = (0x3U << 5),
  2977.                 RFRCS_FLUSHING         = (0x3U << 5),
  2978.                 RFRCS_STATUSREADING    = (0x1U << 6),
  2979.                 RFRCS_DATAREADING      = (0x1U << 5),
  2980.                 RFWRA                  = (0x1U << 4),
  2981.                 MSFRWCS                = (0x3U << 1),
  2982.                 MMRPEA                 = (0x1U << 0),
  2983.             };
  2984.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR; }
  2985.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR = value; }
  2986.             template <EMasks ... flags>
  2987.             static inline void set_flags()
  2988.             {
  2989.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR |= SetBits<(std::uint32_t)flags...>();
  2990.             }
  2991.             template <EMasks ... flags>
  2992.             static inline void clear_flags()
  2993.             {
  2994.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR &= ~(SetBits<(std::uint32_t)flags...>());
  2995.             }
  2996.             template <EMasks ... flags>
  2997.             static inline bool get_flags()
  2998.             {
  2999.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3000.             }
  3001.             static inline uint32_t get_TFRS() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->TFRS; }
  3002.             static inline void set_TFRS(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->TFRS = value; }
  3003.             static inline uint32_t get_TFRS_WRITING() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->TFRS_WRITING; }
  3004.             static inline void set_TFRS_WRITING(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->TFRS_WRITING = value; }
  3005.             static inline uint32_t get_MTFCS() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MTFCS; }
  3006.             static inline void set_MTFCS(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MTFCS = value; }
  3007.             static inline uint32_t get_MTFCS_TRANSFERRING() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MTFCS_TRANSFERRING; }
  3008.             static inline void set_MTFCS_TRANSFERRING(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MTFCS_TRANSFERRING = value; }
  3009.             static inline uint32_t get_RFFL() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFFL; }
  3010.             static inline void set_RFFL(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFFL = value; }
  3011.             static inline uint32_t get_RFFL_FULL() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFFL_FULL; }
  3012.             static inline void set_RFFL_FULL(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFFL_FULL = value; }
  3013.             static inline uint32_t get_RFRCS() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFRCS; }
  3014.             static inline void set_RFRCS(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFRCS = value; }
  3015.             static inline uint32_t get_RFRCS_FLUSHING() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFRCS_FLUSHING; }
  3016.             static inline void set_RFRCS_FLUSHING(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->RFRCS_FLUSHING = value; }
  3017.             static inline uint32_t get_MSFRWCS() { return reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MSFRWCS; }
  3018.             static inline void set_MSFRWCS(uint32_t value) { reinterpret_cast<__IO MACDBGR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACDBGR)->MSFRWCS = value; }
  3019.         };
  3020.         class MACSR
  3021.         {
  3022.         private:
  3023.             union MACSR_t
  3024.             {
  3025.                 struct
  3026.                 {
  3027.                     uint32_t reserved0      : 1;
  3028.                     uint32_t reserved1      : 1;
  3029.                     uint32_t reserved2      : 1;
  3030.                     uint32_t reserved3      : 1;
  3031.                     uint32_t reserved4      : 1;
  3032.                     uint32_t reserved5      : 1;
  3033.                     uint32_t reserved6      : 1;
  3034.                     uint32_t reserved7      : 1;
  3035.                     uint32_t reserved8      : 1;
  3036.                     uint32_t TSTS           : 1;
  3037.                     uint32_t MMCTS          : 1;
  3038.                     uint32_t MMMCRS         : 1;
  3039.                     uint32_t MMCS           : 1;
  3040.                     uint32_t PMTS           : 1;
  3041.                     uint32_t reserved14     : 18;
  3042.                 };
  3043.                 uint32_t RAW;
  3044.             };
  3045.         public:
  3046.             enum class EMasks: uint32_t
  3047.             {
  3048.                 TSTS                   = (0x1U << 9),
  3049.                 MMCTS                  = (0x1U << 6),
  3050.                 MMMCRS                 = (0x1U << 5),
  3051.                 MMCS                   = (0x1U << 4),
  3052.                 PMTS                   = (0x1U << 3),
  3053.             };
  3054.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACSR; }
  3055.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACSR = value; }
  3056.             template <EMasks ... flags>
  3057.             static inline void set_flags()
  3058.             {
  3059.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACSR |= SetBits<(std::uint32_t)flags...>();
  3060.             }
  3061.             template <EMasks ... flags>
  3062.             static inline void clear_flags()
  3063.             {
  3064.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACSR &= ~(SetBits<(std::uint32_t)flags...>());
  3065.             }
  3066.             template <EMasks ... flags>
  3067.             static inline bool get_flags()
  3068.             {
  3069.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACSR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3070.             }
  3071.         };
  3072.         class MACIMR
  3073.         {
  3074.         private:
  3075.             union MACIMR_t
  3076.             {
  3077.                 struct
  3078.                 {
  3079.                     uint32_t reserved0      : 1;
  3080.                     uint32_t reserved1      : 1;
  3081.                     uint32_t reserved2      : 1;
  3082.                     uint32_t reserved3      : 1;
  3083.                     uint32_t reserved4      : 1;
  3084.                     uint32_t reserved5      : 1;
  3085.                     uint32_t reserved6      : 1;
  3086.                     uint32_t reserved7      : 1;
  3087.                     uint32_t reserved8      : 1;
  3088.                     uint32_t TSTIM          : 1;
  3089.                     uint32_t PMTIM          : 1;
  3090.                     uint32_t reserved11     : 21;
  3091.                 };
  3092.                 uint32_t RAW;
  3093.             };
  3094.         public:
  3095.             enum class EMasks: uint32_t
  3096.             {
  3097.                 TSTIM                  = (0x1U << 9),
  3098.                 PMTIM                  = (0x1U << 3),
  3099.             };
  3100.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACIMR; }
  3101.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACIMR = value; }
  3102.             template <EMasks ... flags>
  3103.             static inline void set_flags()
  3104.             {
  3105.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACIMR |= SetBits<(std::uint32_t)flags...>();
  3106.             }
  3107.             template <EMasks ... flags>
  3108.             static inline void clear_flags()
  3109.             {
  3110.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACIMR &= ~(SetBits<(std::uint32_t)flags...>());
  3111.             }
  3112.             template <EMasks ... flags>
  3113.             static inline bool get_flags()
  3114.             {
  3115.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACIMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3116.             }
  3117.         };
  3118.         class MACA0HR
  3119.         {
  3120.         private:
  3121.             union MACA0HR_t
  3122.             {
  3123.                 struct
  3124.                 {
  3125.                     uint32_t MACA0H         : 16;
  3126.                     uint32_t reserved16     : 16;
  3127.                 };
  3128.                 uint32_t RAW;
  3129.             };
  3130.         public:
  3131.             enum class EMasks: uint32_t
  3132.             {
  3133.                 MACA0H                 = (0xFFFFU << 0),
  3134.             };
  3135.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0HR; }
  3136.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0HR = value; }
  3137.             static inline uint32_t get_MACA0H() { return reinterpret_cast<__IO MACA0HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0HR)->MACA0H; }
  3138.             static inline void set_MACA0H(uint32_t value) { reinterpret_cast<__IO MACA0HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0HR)->MACA0H = value; }
  3139.         };
  3140.         class MACA0LR
  3141.         {
  3142.         private:
  3143.             union MACA0LR_t
  3144.             {
  3145.                 struct
  3146.                 {
  3147.                     uint32_t MACA0L         : 32;
  3148.                 };
  3149.                 uint32_t RAW;
  3150.             };
  3151.         public:
  3152.             enum class EMasks: uint32_t
  3153.             {
  3154.                 MACA0L                 = (0xFFFFFFFFU << 0),
  3155.             };
  3156.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0LR; }
  3157.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0LR = value; }
  3158.             static inline uint32_t get_MACA0L() { return reinterpret_cast<__IO MACA0LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0LR)->MACA0L; }
  3159.             static inline void set_MACA0L(uint32_t value) { reinterpret_cast<__IO MACA0LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA0LR)->MACA0L = value; }
  3160.         };
  3161.         class MACA1HR
  3162.         {
  3163.         private:
  3164.             union MACA1HR_t
  3165.             {
  3166.                 struct
  3167.                 {
  3168.                     uint32_t reserved0      : 1;
  3169.                     uint32_t reserved1      : 1;
  3170.                     uint32_t reserved2      : 1;
  3171.                     uint32_t reserved3      : 1;
  3172.                     uint32_t reserved4      : 1;
  3173.                     uint32_t reserved5      : 1;
  3174.                     uint32_t reserved6      : 1;
  3175.                     uint32_t reserved7      : 1;
  3176.                     uint32_t reserved8      : 1;
  3177.                     uint32_t reserved9      : 1;
  3178.                     uint32_t reserved10     : 1;
  3179.                     uint32_t reserved11     : 1;
  3180.                     uint32_t reserved12     : 1;
  3181.                     uint32_t reserved13     : 1;
  3182.                     uint32_t reserved14     : 1;
  3183.                     uint32_t reserved15     : 1;
  3184.                     uint32_t reserved16     : 1;
  3185.                     uint32_t reserved17     : 1;
  3186.                     uint32_t reserved18     : 1;
  3187.                     uint32_t reserved19     : 1;
  3188.                     uint32_t reserved20     : 1;
  3189.                     uint32_t reserved21     : 1;
  3190.                     uint32_t reserved22     : 1;
  3191.                     uint32_t reserved23     : 1;
  3192.                     uint32_t reserved24     : 1;
  3193.                     uint32_t reserved25     : 1;
  3194.                     uint32_t reserved26     : 1;
  3195.                     uint32_t reserved27     : 1;
  3196.                     uint32_t reserved28     : 1;
  3197.                     uint32_t reserved29     : 1;
  3198.                     uint32_t reserved30     : 1;
  3199.                     uint32_t AE             : 1;
  3200.                     uint32_t SA             : 1;
  3201.                     uint32_t MBC            : 6;
  3202.                     uint32_t MACA1H         : 16;
  3203.                 };
  3204.                 uint32_t RAW;
  3205.             };
  3206.         public:
  3207.             enum class EMasks: uint32_t
  3208.             {
  3209.                 AE                     = (0x1U << 31),
  3210.                 SA                     = (0x1U << 30),
  3211.                 MBC                    = (0x3FU << 24),
  3212.                 MACA1H                 = (0xFFFFU << 0),
  3213.             };
  3214.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR; }
  3215.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR = value; }
  3216.             template <EMasks ... flags>
  3217.             static inline void set_flags()
  3218.             {
  3219.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR |= SetBits<(std::uint32_t)flags...>();
  3220.             }
  3221.             template <EMasks ... flags>
  3222.             static inline void clear_flags()
  3223.             {
  3224.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR &= ~(SetBits<(std::uint32_t)flags...>());
  3225.             }
  3226.             template <EMasks ... flags>
  3227.             static inline bool get_flags()
  3228.             {
  3229.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3230.             }
  3231.             static inline uint32_t get_MBC() { return reinterpret_cast<__IO MACA1HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR)->MBC; }
  3232.             static inline void set_MBC(uint32_t value) { reinterpret_cast<__IO MACA1HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR)->MBC = value; }
  3233.             static inline uint32_t get_MACA1H() { return reinterpret_cast<__IO MACA1HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR)->MACA1H; }
  3234.             static inline void set_MACA1H(uint32_t value) { reinterpret_cast<__IO MACA1HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1HR)->MACA1H = value; }
  3235.         };
  3236.         class MACA1LR
  3237.         {
  3238.         private:
  3239.             union MACA1LR_t
  3240.             {
  3241.                 struct
  3242.                 {
  3243.                     uint32_t MACA1L         : 32;
  3244.                 };
  3245.                 uint32_t RAW;
  3246.             };
  3247.         public:
  3248.             enum class EMasks: uint32_t
  3249.             {
  3250.                 MACA1L                 = (0xFFFFFFFFU << 0),
  3251.             };
  3252.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1LR; }
  3253.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1LR = value; }
  3254.             static inline uint32_t get_MACA1L() { return reinterpret_cast<__IO MACA1LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1LR)->MACA1L; }
  3255.             static inline void set_MACA1L(uint32_t value) { reinterpret_cast<__IO MACA1LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA1LR)->MACA1L = value; }
  3256.         };
  3257.         class MACA2HR
  3258.         {
  3259.         private:
  3260.             union MACA2HR_t
  3261.             {
  3262.                 struct
  3263.                 {
  3264.                     uint32_t reserved0      : 1;
  3265.                     uint32_t reserved1      : 1;
  3266.                     uint32_t reserved2      : 1;
  3267.                     uint32_t reserved3      : 1;
  3268.                     uint32_t reserved4      : 1;
  3269.                     uint32_t reserved5      : 1;
  3270.                     uint32_t reserved6      : 1;
  3271.                     uint32_t reserved7      : 1;
  3272.                     uint32_t reserved8      : 1;
  3273.                     uint32_t reserved9      : 1;
  3274.                     uint32_t reserved10     : 1;
  3275.                     uint32_t reserved11     : 1;
  3276.                     uint32_t reserved12     : 1;
  3277.                     uint32_t reserved13     : 1;
  3278.                     uint32_t reserved14     : 1;
  3279.                     uint32_t reserved15     : 1;
  3280.                     uint32_t reserved16     : 1;
  3281.                     uint32_t reserved17     : 1;
  3282.                     uint32_t reserved18     : 1;
  3283.                     uint32_t reserved19     : 1;
  3284.                     uint32_t reserved20     : 1;
  3285.                     uint32_t reserved21     : 1;
  3286.                     uint32_t reserved22     : 1;
  3287.                     uint32_t reserved23     : 1;
  3288.                     uint32_t reserved24     : 1;
  3289.                     uint32_t reserved25     : 1;
  3290.                     uint32_t reserved26     : 1;
  3291.                     uint32_t reserved27     : 1;
  3292.                     uint32_t reserved28     : 1;
  3293.                     uint32_t reserved29     : 1;
  3294.                     uint32_t reserved30     : 1;
  3295.                     uint32_t AE             : 1;
  3296.                     uint32_t SA             : 1;
  3297.                     uint32_t MBC            : 6;
  3298.                     uint32_t MACA2H         : 16;
  3299.                 };
  3300.                 uint32_t RAW;
  3301.             };
  3302.         public:
  3303.             enum class EMasks: uint32_t
  3304.             {
  3305.                 AE                     = (0x1U << 31),
  3306.                 SA                     = (0x1U << 30),
  3307.                 MBC                    = (0x3FU << 24),
  3308.                 MACA2H                 = (0xFFFFU << 0),
  3309.             };
  3310.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR; }
  3311.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR = value; }
  3312.             template <EMasks ... flags>
  3313.             static inline void set_flags()
  3314.             {
  3315.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR |= SetBits<(std::uint32_t)flags...>();
  3316.             }
  3317.             template <EMasks ... flags>
  3318.             static inline void clear_flags()
  3319.             {
  3320.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR &= ~(SetBits<(std::uint32_t)flags...>());
  3321.             }
  3322.             template <EMasks ... flags>
  3323.             static inline bool get_flags()
  3324.             {
  3325.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3326.             }
  3327.             static inline uint32_t get_MBC() { return reinterpret_cast<__IO MACA2HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR)->MBC; }
  3328.             static inline void set_MBC(uint32_t value) { reinterpret_cast<__IO MACA2HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR)->MBC = value; }
  3329.             static inline uint32_t get_MACA2H() { return reinterpret_cast<__IO MACA2HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR)->MACA2H; }
  3330.             static inline void set_MACA2H(uint32_t value) { reinterpret_cast<__IO MACA2HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2HR)->MACA2H = value; }
  3331.         };
  3332.         class MACA2LR
  3333.         {
  3334.         private:
  3335.             union MACA2LR_t
  3336.             {
  3337.                 struct
  3338.                 {
  3339.                     uint32_t MACA2L         : 32;
  3340.                 };
  3341.                 uint32_t RAW;
  3342.             };
  3343.         public:
  3344.             enum class EMasks: uint32_t
  3345.             {
  3346.                 MACA2L                 = (0xFFFFFFFFU << 0),
  3347.             };
  3348.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2LR; }
  3349.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2LR = value; }
  3350.             static inline uint32_t get_MACA2L() { return reinterpret_cast<__IO MACA2LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2LR)->MACA2L; }
  3351.             static inline void set_MACA2L(uint32_t value) { reinterpret_cast<__IO MACA2LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA2LR)->MACA2L = value; }
  3352.         };
  3353.         class MACA3HR
  3354.         {
  3355.         private:
  3356.             union MACA3HR_t
  3357.             {
  3358.                 struct
  3359.                 {
  3360.                     uint32_t reserved0      : 1;
  3361.                     uint32_t reserved1      : 1;
  3362.                     uint32_t reserved2      : 1;
  3363.                     uint32_t reserved3      : 1;
  3364.                     uint32_t reserved4      : 1;
  3365.                     uint32_t reserved5      : 1;
  3366.                     uint32_t reserved6      : 1;
  3367.                     uint32_t reserved7      : 1;
  3368.                     uint32_t reserved8      : 1;
  3369.                     uint32_t reserved9      : 1;
  3370.                     uint32_t reserved10     : 1;
  3371.                     uint32_t reserved11     : 1;
  3372.                     uint32_t reserved12     : 1;
  3373.                     uint32_t reserved13     : 1;
  3374.                     uint32_t reserved14     : 1;
  3375.                     uint32_t reserved15     : 1;
  3376.                     uint32_t reserved16     : 1;
  3377.                     uint32_t reserved17     : 1;
  3378.                     uint32_t reserved18     : 1;
  3379.                     uint32_t reserved19     : 1;
  3380.                     uint32_t reserved20     : 1;
  3381.                     uint32_t reserved21     : 1;
  3382.                     uint32_t reserved22     : 1;
  3383.                     uint32_t reserved23     : 1;
  3384.                     uint32_t reserved24     : 1;
  3385.                     uint32_t reserved25     : 1;
  3386.                     uint32_t reserved26     : 1;
  3387.                     uint32_t reserved27     : 1;
  3388.                     uint32_t reserved28     : 1;
  3389.                     uint32_t reserved29     : 1;
  3390.                     uint32_t reserved30     : 1;
  3391.                     uint32_t AE             : 1;
  3392.                     uint32_t SA             : 1;
  3393.                     uint32_t MBC            : 6;
  3394.                     uint32_t MACA3H         : 16;
  3395.                 };
  3396.                 uint32_t RAW;
  3397.             };
  3398.         public:
  3399.             enum class EMasks: uint32_t
  3400.             {
  3401.                 AE                     = (0x1U << 31),
  3402.                 SA                     = (0x1U << 30),
  3403.                 MBC                    = (0x3FU << 24),
  3404.                 MACA3H                 = (0xFFFFU << 0),
  3405.             };
  3406.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR; }
  3407.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR = value; }
  3408.             template <EMasks ... flags>
  3409.             static inline void set_flags()
  3410.             {
  3411.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR |= SetBits<(std::uint32_t)flags...>();
  3412.             }
  3413.             template <EMasks ... flags>
  3414.             static inline void clear_flags()
  3415.             {
  3416.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR &= ~(SetBits<(std::uint32_t)flags...>());
  3417.             }
  3418.             template <EMasks ... flags>
  3419.             static inline bool get_flags()
  3420.             {
  3421.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3422.             }
  3423.             static inline uint32_t get_MBC() { return reinterpret_cast<__IO MACA3HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR)->MBC; }
  3424.             static inline void set_MBC(uint32_t value) { reinterpret_cast<__IO MACA3HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR)->MBC = value; }
  3425.             static inline uint32_t get_MACA3H() { return reinterpret_cast<__IO MACA3HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR)->MACA3H; }
  3426.             static inline void set_MACA3H(uint32_t value) { reinterpret_cast<__IO MACA3HR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3HR)->MACA3H = value; }
  3427.         };
  3428.         class MACA3LR
  3429.         {
  3430.         private:
  3431.             union MACA3LR_t
  3432.             {
  3433.                 struct
  3434.                 {
  3435.                     uint32_t MACA3L         : 32;
  3436.                 };
  3437.                 uint32_t RAW;
  3438.             };
  3439.         public:
  3440.             enum class EMasks: uint32_t
  3441.             {
  3442.                 MACA3L                 = (0xFFFFFFFFU << 0),
  3443.             };
  3444.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3LR; }
  3445.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3LR = value; }
  3446.             static inline uint32_t get_MACA3L() { return reinterpret_cast<__IO MACA3LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3LR)->MACA3L; }
  3447.             static inline void set_MACA3L(uint32_t value) { reinterpret_cast<__IO MACA3LR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MACA3LR)->MACA3L = value; }
  3448.         };
  3449.         class MMCCR
  3450.         {
  3451.         private:
  3452.             union MMCCR_t
  3453.             {
  3454.                 struct
  3455.                 {
  3456.                     uint32_t reserved0      : 1;
  3457.                     uint32_t reserved1      : 1;
  3458.                     uint32_t reserved2      : 1;
  3459.                     uint32_t reserved3      : 1;
  3460.                     uint32_t reserved4      : 1;
  3461.                     uint32_t MCFHP          : 1;
  3462.                     uint32_t MCP            : 1;
  3463.                     uint32_t MCF            : 1;
  3464.                     uint32_t ROR            : 1;
  3465.                     uint32_t CSR            : 1;
  3466.                     uint32_t CR             : 1;
  3467.                     uint32_t reserved11     : 21;
  3468.                 };
  3469.                 uint32_t RAW;
  3470.             };
  3471.         public:
  3472.             enum class EMasks: uint32_t
  3473.             {
  3474.                 MCFHP                  = (0x1U << 5),
  3475.                 MCP                    = (0x1U << 4),
  3476.                 MCF                    = (0x1U << 3),
  3477.                 ROR                    = (0x1U << 2),
  3478.                 CSR                    = (0x1U << 1),
  3479.                 CR                     = (0x1U << 0),
  3480.             };
  3481.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCCR; }
  3482.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCCR = value; }
  3483.             template <EMasks ... flags>
  3484.             static inline void set_flags()
  3485.             {
  3486.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCCR |= SetBits<(std::uint32_t)flags...>();
  3487.             }
  3488.             template <EMasks ... flags>
  3489.             static inline void clear_flags()
  3490.             {
  3491.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCCR &= ~(SetBits<(std::uint32_t)flags...>());
  3492.             }
  3493.             template <EMasks ... flags>
  3494.             static inline bool get_flags()
  3495.             {
  3496.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3497.             }
  3498.         };
  3499.         class MMCRIR
  3500.         {
  3501.         private:
  3502.             union MMCRIR_t
  3503.             {
  3504.                 struct
  3505.                 {
  3506.                     uint32_t reserved0      : 1;
  3507.                     uint32_t reserved1      : 1;
  3508.                     uint32_t reserved2      : 1;
  3509.                     uint32_t reserved3      : 1;
  3510.                     uint32_t reserved4      : 1;
  3511.                     uint32_t reserved5      : 1;
  3512.                     uint32_t reserved6      : 1;
  3513.                     uint32_t reserved7      : 1;
  3514.                     uint32_t reserved8      : 1;
  3515.                     uint32_t reserved9      : 1;
  3516.                     uint32_t reserved10     : 1;
  3517.                     uint32_t reserved11     : 1;
  3518.                     uint32_t reserved12     : 1;
  3519.                     uint32_t reserved13     : 1;
  3520.                     uint32_t reserved14     : 1;
  3521.                     uint32_t reserved15     : 1;
  3522.                     uint32_t reserved16     : 1;
  3523.                     uint32_t RGUFS          : 1;
  3524.                     uint32_t RFAES          : 1;
  3525.                     uint32_t RFCES          : 1;
  3526.                     uint32_t reserved20     : 12;
  3527.                 };
  3528.                 uint32_t RAW;
  3529.             };
  3530.         public:
  3531.             enum class EMasks: uint32_t
  3532.             {
  3533.                 RGUFS                  = (0x1U << 17),
  3534.                 RFAES                  = (0x1U << 6),
  3535.                 RFCES                  = (0x1U << 5),
  3536.             };
  3537.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIR; }
  3538.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIR = value; }
  3539.             template <EMasks ... flags>
  3540.             static inline void set_flags()
  3541.             {
  3542.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIR |= SetBits<(std::uint32_t)flags...>();
  3543.             }
  3544.             template <EMasks ... flags>
  3545.             static inline void clear_flags()
  3546.             {
  3547.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIR &= ~(SetBits<(std::uint32_t)flags...>());
  3548.             }
  3549.             template <EMasks ... flags>
  3550.             static inline bool get_flags()
  3551.             {
  3552.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3553.             }
  3554.         };
  3555.         class MMCTIR
  3556.         {
  3557.         private:
  3558.             union MMCTIR_t
  3559.             {
  3560.                 struct
  3561.                 {
  3562.                     uint32_t reserved0      : 1;
  3563.                     uint32_t reserved1      : 1;
  3564.                     uint32_t reserved2      : 1;
  3565.                     uint32_t reserved3      : 1;
  3566.                     uint32_t reserved4      : 1;
  3567.                     uint32_t reserved5      : 1;
  3568.                     uint32_t reserved6      : 1;
  3569.                     uint32_t reserved7      : 1;
  3570.                     uint32_t reserved8      : 1;
  3571.                     uint32_t reserved9      : 1;
  3572.                     uint32_t reserved10     : 1;
  3573.                     uint32_t reserved11     : 1;
  3574.                     uint32_t reserved12     : 1;
  3575.                     uint32_t reserved13     : 1;
  3576.                     uint32_t reserved14     : 1;
  3577.                     uint32_t reserved15     : 1;
  3578.                     uint32_t reserved16     : 1;
  3579.                     uint32_t reserved17     : 1;
  3580.                     uint32_t reserved18     : 1;
  3581.                     uint32_t reserved19     : 1;
  3582.                     uint32_t reserved20     : 1;
  3583.                     uint32_t TGFS           : 1;
  3584.                     uint32_t TGFMSCS        : 1;
  3585.                     uint32_t TGFSCS         : 1;
  3586.                     uint32_t reserved24     : 8;
  3587.                 };
  3588.                 uint32_t RAW;
  3589.             };
  3590.         public:
  3591.             enum class EMasks: uint32_t
  3592.             {
  3593.                 TGFS                   = (0x1U << 21),
  3594.                 TGFMSCS                = (0x1U << 15),
  3595.                 TGFSCS                 = (0x1U << 14),
  3596.             };
  3597.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIR; }
  3598.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIR = value; }
  3599.             template <EMasks ... flags>
  3600.             static inline void set_flags()
  3601.             {
  3602.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIR |= SetBits<(std::uint32_t)flags...>();
  3603.             }
  3604.             template <EMasks ... flags>
  3605.             static inline void clear_flags()
  3606.             {
  3607.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIR &= ~(SetBits<(std::uint32_t)flags...>());
  3608.             }
  3609.             template <EMasks ... flags>
  3610.             static inline bool get_flags()
  3611.             {
  3612.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3613.             }
  3614.         };
  3615.         class MMCRIMR
  3616.         {
  3617.         private:
  3618.             union MMCRIMR_t
  3619.             {
  3620.                 struct
  3621.                 {
  3622.                     uint32_t reserved0      : 1;
  3623.                     uint32_t reserved1      : 1;
  3624.                     uint32_t reserved2      : 1;
  3625.                     uint32_t reserved3      : 1;
  3626.                     uint32_t reserved4      : 1;
  3627.                     uint32_t reserved5      : 1;
  3628.                     uint32_t reserved6      : 1;
  3629.                     uint32_t reserved7      : 1;
  3630.                     uint32_t reserved8      : 1;
  3631.                     uint32_t reserved9      : 1;
  3632.                     uint32_t reserved10     : 1;
  3633.                     uint32_t reserved11     : 1;
  3634.                     uint32_t reserved12     : 1;
  3635.                     uint32_t reserved13     : 1;
  3636.                     uint32_t reserved14     : 1;
  3637.                     uint32_t reserved15     : 1;
  3638.                     uint32_t reserved16     : 1;
  3639.                     uint32_t RGUFM          : 1;
  3640.                     uint32_t RFAEM          : 1;
  3641.                     uint32_t RFCEM          : 1;
  3642.                     uint32_t reserved20     : 12;
  3643.                 };
  3644.                 uint32_t RAW;
  3645.             };
  3646.         public:
  3647.             enum class EMasks: uint32_t
  3648.             {
  3649.                 RGUFM                  = (0x1U << 17),
  3650.                 RFAEM                  = (0x1U << 6),
  3651.                 RFCEM                  = (0x1U << 5),
  3652.             };
  3653.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIMR; }
  3654.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIMR = value; }
  3655.             template <EMasks ... flags>
  3656.             static inline void set_flags()
  3657.             {
  3658.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIMR |= SetBits<(std::uint32_t)flags...>();
  3659.             }
  3660.             template <EMasks ... flags>
  3661.             static inline void clear_flags()
  3662.             {
  3663.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIMR &= ~(SetBits<(std::uint32_t)flags...>());
  3664.             }
  3665.             template <EMasks ... flags>
  3666.             static inline bool get_flags()
  3667.             {
  3668.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRIMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3669.             }
  3670.         };
  3671.         class MMCTIMR
  3672.         {
  3673.         private:
  3674.             union MMCTIMR_t
  3675.             {
  3676.                 struct
  3677.                 {
  3678.                     uint32_t reserved0      : 1;
  3679.                     uint32_t reserved1      : 1;
  3680.                     uint32_t reserved2      : 1;
  3681.                     uint32_t reserved3      : 1;
  3682.                     uint32_t reserved4      : 1;
  3683.                     uint32_t reserved5      : 1;
  3684.                     uint32_t reserved6      : 1;
  3685.                     uint32_t reserved7      : 1;
  3686.                     uint32_t reserved8      : 1;
  3687.                     uint32_t reserved9      : 1;
  3688.                     uint32_t reserved10     : 1;
  3689.                     uint32_t reserved11     : 1;
  3690.                     uint32_t reserved12     : 1;
  3691.                     uint32_t reserved13     : 1;
  3692.                     uint32_t reserved14     : 1;
  3693.                     uint32_t reserved15     : 1;
  3694.                     uint32_t reserved16     : 1;
  3695.                     uint32_t reserved17     : 1;
  3696.                     uint32_t reserved18     : 1;
  3697.                     uint32_t reserved19     : 1;
  3698.                     uint32_t reserved20     : 1;
  3699.                     uint32_t TGFM           : 1;
  3700.                     uint32_t TGFMSCM        : 1;
  3701.                     uint32_t TGFSCM         : 1;
  3702.                     uint32_t reserved24     : 8;
  3703.                 };
  3704.                 uint32_t RAW;
  3705.             };
  3706.         public:
  3707.             enum class EMasks: uint32_t
  3708.             {
  3709.                 TGFM                   = (0x1U << 21),
  3710.                 TGFMSCM                = (0x1U << 15),
  3711.                 TGFSCM                 = (0x1U << 14),
  3712.             };
  3713.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIMR; }
  3714.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIMR = value; }
  3715.             template <EMasks ... flags>
  3716.             static inline void set_flags()
  3717.             {
  3718.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIMR |= SetBits<(std::uint32_t)flags...>();
  3719.             }
  3720.             template <EMasks ... flags>
  3721.             static inline void clear_flags()
  3722.             {
  3723.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIMR &= ~(SetBits<(std::uint32_t)flags...>());
  3724.             }
  3725.             template <EMasks ... flags>
  3726.             static inline bool get_flags()
  3727.             {
  3728.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTIMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3729.             }
  3730.         };
  3731.         class MMCTGFSCCR
  3732.         {
  3733.         private:
  3734.             union MMCTGFSCCR_t
  3735.             {
  3736.                 struct
  3737.                 {
  3738.                     uint32_t TGFSCC         : 32;
  3739.                 };
  3740.                 uint32_t RAW;
  3741.             };
  3742.         public:
  3743.             enum class EMasks: uint32_t
  3744.             {
  3745.                 TGFSCC                 = (0xFFFFFFFFU << 0),
  3746.             };
  3747.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFSCCR; }
  3748.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFSCCR = value; }
  3749.             static inline uint32_t get_TGFSCC() { return reinterpret_cast<__IO MMCTGFSCCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFSCCR)->TGFSCC; }
  3750.             static inline void set_TGFSCC(uint32_t value) { reinterpret_cast<__IO MMCTGFSCCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFSCCR)->TGFSCC = value; }
  3751.         };
  3752.         class MMCTGFMSCCR
  3753.         {
  3754.         private:
  3755.             union MMCTGFMSCCR_t
  3756.             {
  3757.                 struct
  3758.                 {
  3759.                     uint32_t TGFMSCC        : 32;
  3760.                 };
  3761.                 uint32_t RAW;
  3762.             };
  3763.         public:
  3764.             enum class EMasks: uint32_t
  3765.             {
  3766.                 TGFMSCC                = (0xFFFFFFFFU << 0),
  3767.             };
  3768.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFMSCCR; }
  3769.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFMSCCR = value; }
  3770.             static inline uint32_t get_TGFMSCC() { return reinterpret_cast<__IO MMCTGFMSCCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFMSCCR)->TGFMSCC; }
  3771.             static inline void set_TGFMSCC(uint32_t value) { reinterpret_cast<__IO MMCTGFMSCCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFMSCCR)->TGFMSCC = value; }
  3772.         };
  3773.         class MMCTGFCR
  3774.         {
  3775.         private:
  3776.             union MMCTGFCR_t
  3777.             {
  3778.                 struct
  3779.                 {
  3780.                     uint32_t TGFC           : 32;
  3781.                 };
  3782.                 uint32_t RAW;
  3783.             };
  3784.         public:
  3785.             enum class EMasks: uint32_t
  3786.             {
  3787.                 TGFC                   = (0xFFFFFFFFU << 0),
  3788.             };
  3789.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFCR; }
  3790.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFCR = value; }
  3791.             static inline uint32_t get_TGFC() { return reinterpret_cast<__IO MMCTGFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFCR)->TGFC; }
  3792.             static inline void set_TGFC(uint32_t value) { reinterpret_cast<__IO MMCTGFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCTGFCR)->TGFC = value; }
  3793.         };
  3794.         class MMCRFCECR
  3795.         {
  3796.         private:
  3797.             union MMCRFCECR_t
  3798.             {
  3799.                 struct
  3800.                 {
  3801.                     uint32_t RFCEC          : 32;
  3802.                 };
  3803.                 uint32_t RAW;
  3804.             };
  3805.         public:
  3806.             enum class EMasks: uint32_t
  3807.             {
  3808.                 RFCEC                  = (0xFFFFFFFFU << 0),
  3809.             };
  3810.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFCECR; }
  3811.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFCECR = value; }
  3812.             static inline uint32_t get_RFCEC() { return reinterpret_cast<__IO MMCRFCECR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFCECR)->RFCEC; }
  3813.             static inline void set_RFCEC(uint32_t value) { reinterpret_cast<__IO MMCRFCECR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFCECR)->RFCEC = value; }
  3814.         };
  3815.         class MMCRFAECR
  3816.         {
  3817.         private:
  3818.             union MMCRFAECR_t
  3819.             {
  3820.                 struct
  3821.                 {
  3822.                     uint32_t RFAEC          : 32;
  3823.                 };
  3824.                 uint32_t RAW;
  3825.             };
  3826.         public:
  3827.             enum class EMasks: uint32_t
  3828.             {
  3829.                 RFAEC                  = (0xFFFFFFFFU << 0),
  3830.             };
  3831.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFAECR; }
  3832.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFAECR = value; }
  3833.             static inline uint32_t get_RFAEC() { return reinterpret_cast<__IO MMCRFAECR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFAECR)->RFAEC; }
  3834.             static inline void set_RFAEC(uint32_t value) { reinterpret_cast<__IO MMCRFAECR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRFAECR)->RFAEC = value; }
  3835.         };
  3836.         class MMCRGUFCR
  3837.         {
  3838.         private:
  3839.             union MMCRGUFCR_t
  3840.             {
  3841.                 struct
  3842.                 {
  3843.                     uint32_t RGUFC          : 32;
  3844.                 };
  3845.                 uint32_t RAW;
  3846.             };
  3847.         public:
  3848.             enum class EMasks: uint32_t
  3849.             {
  3850.                 RGUFC                  = (0xFFFFFFFFU << 0),
  3851.             };
  3852.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRGUFCR; }
  3853.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRGUFCR = value; }
  3854.             static inline uint32_t get_RGUFC() { return reinterpret_cast<__IO MMCRGUFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRGUFCR)->RGUFC; }
  3855.             static inline void set_RGUFC(uint32_t value) { reinterpret_cast<__IO MMCRGUFCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->MMCRGUFCR)->RGUFC = value; }
  3856.         };
  3857.         class PTPTSCR
  3858.         {
  3859.         private:
  3860.             union PTPTSCR_t
  3861.             {
  3862.                 struct
  3863.                 {
  3864.                     uint32_t reserved0      : 1;
  3865.                     uint32_t reserved1      : 1;
  3866.                     uint32_t reserved2      : 1;
  3867.                     uint32_t reserved3      : 1;
  3868.                     uint32_t reserved4      : 1;
  3869.                     uint32_t reserved5      : 1;
  3870.                     uint32_t reserved6      : 1;
  3871.                     uint32_t reserved7      : 1;
  3872.                     uint32_t reserved8      : 1;
  3873.                     uint32_t reserved9      : 1;
  3874.                     uint32_t reserved10     : 1;
  3875.                     uint32_t reserved11     : 1;
  3876.                     uint32_t reserved12     : 1;
  3877.                     uint32_t reserved13     : 1;
  3878.                     uint32_t reserved14     : 1;
  3879.                     uint32_t reserved15     : 1;
  3880.                     uint32_t TSCNT          : 2;
  3881.                     uint32_t TSARU          : 1;
  3882.                     uint32_t TSITE          : 1;
  3883.                     uint32_t TSSTU          : 1;
  3884.                     uint32_t TSSTI          : 1;
  3885.                     uint32_t TSFCU          : 1;
  3886.                     uint32_t TSE            : 1;
  3887.                     uint32_t reserved24     : 8;
  3888.                 };
  3889.                 uint32_t RAW;
  3890.             };
  3891.         public:
  3892.             enum class EMasks: uint32_t
  3893.             {
  3894.                 TSCNT                  = (0x3U << 16),
  3895.                 TSARU                  = (0x1U << 5),
  3896.                 TSITE                  = (0x1U << 4),
  3897.                 TSSTU                  = (0x1U << 3),
  3898.                 TSSTI                  = (0x1U << 2),
  3899.                 TSFCU                  = (0x1U << 1),
  3900.                 TSE                    = (0x1U << 0),
  3901.             };
  3902.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR; }
  3903.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR = value; }
  3904.             template <EMasks ... flags>
  3905.             static inline void set_flags()
  3906.             {
  3907.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR |= SetBits<(std::uint32_t)flags...>();
  3908.             }
  3909.             template <EMasks ... flags>
  3910.             static inline void clear_flags()
  3911.             {
  3912.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR &= ~(SetBits<(std::uint32_t)flags...>());
  3913.             }
  3914.             template <EMasks ... flags>
  3915.             static inline bool get_flags()
  3916.             {
  3917.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  3918.             }
  3919.             static inline uint32_t get_TSCNT() { return reinterpret_cast<__IO PTPTSCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR)->TSCNT; }
  3920.             static inline void set_TSCNT(uint32_t value) { reinterpret_cast<__IO PTPTSCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSCR)->TSCNT = value; }
  3921.         };
  3922.         class PTPSSIR
  3923.         {
  3924.         private:
  3925.             union PTPSSIR_t
  3926.             {
  3927.                 struct
  3928.                 {
  3929.                     uint32_t STSSI          : 8;
  3930.                     uint32_t reserved8      : 24;
  3931.                 };
  3932.                 uint32_t RAW;
  3933.             };
  3934.         public:
  3935.             enum class EMasks: uint32_t
  3936.             {
  3937.                 STSSI                  = (0xFFU << 0),
  3938.             };
  3939.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPSSIR; }
  3940.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPSSIR = value; }
  3941.             static inline uint32_t get_STSSI() { return reinterpret_cast<__IO PTPSSIR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPSSIR)->STSSI; }
  3942.             static inline void set_STSSI(uint32_t value) { reinterpret_cast<__IO PTPSSIR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPSSIR)->STSSI = value; }
  3943.         };
  3944.         class PTPTSHR
  3945.         {
  3946.         private:
  3947.             union PTPTSHR_t
  3948.             {
  3949.                 struct
  3950.                 {
  3951.                     uint32_t STS            : 32;
  3952.                 };
  3953.                 uint32_t RAW;
  3954.             };
  3955.         public:
  3956.             enum class EMasks: uint32_t
  3957.             {
  3958.                 STS                    = (0xFFFFFFFFU << 0),
  3959.             };
  3960.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHR; }
  3961.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHR = value; }
  3962.             static inline uint32_t get_STS() { return reinterpret_cast<__IO PTPTSHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHR)->STS; }
  3963.             static inline void set_STS(uint32_t value) { reinterpret_cast<__IO PTPTSHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHR)->STS = value; }
  3964.         };
  3965.         class PTPTSLR
  3966.         {
  3967.         private:
  3968.             union PTPTSLR_t
  3969.             {
  3970.                 struct
  3971.                 {
  3972.                     uint32_t reserved0      : 1;
  3973.                     uint32_t reserved1      : 1;
  3974.                     uint32_t reserved2      : 1;
  3975.                     uint32_t reserved3      : 1;
  3976.                     uint32_t reserved4      : 1;
  3977.                     uint32_t reserved5      : 1;
  3978.                     uint32_t reserved6      : 1;
  3979.                     uint32_t reserved7      : 1;
  3980.                     uint32_t reserved8      : 1;
  3981.                     uint32_t reserved9      : 1;
  3982.                     uint32_t reserved10     : 1;
  3983.                     uint32_t reserved11     : 1;
  3984.                     uint32_t reserved12     : 1;
  3985.                     uint32_t reserved13     : 1;
  3986.                     uint32_t reserved14     : 1;
  3987.                     uint32_t reserved15     : 1;
  3988.                     uint32_t reserved16     : 1;
  3989.                     uint32_t reserved17     : 1;
  3990.                     uint32_t reserved18     : 1;
  3991.                     uint32_t reserved19     : 1;
  3992.                     uint32_t reserved20     : 1;
  3993.                     uint32_t reserved21     : 1;
  3994.                     uint32_t reserved22     : 1;
  3995.                     uint32_t reserved23     : 1;
  3996.                     uint32_t reserved24     : 1;
  3997.                     uint32_t reserved25     : 1;
  3998.                     uint32_t reserved26     : 1;
  3999.                     uint32_t reserved27     : 1;
  4000.                     uint32_t reserved28     : 1;
  4001.                     uint32_t reserved29     : 1;
  4002.                     uint32_t reserved30     : 1;
  4003.                     uint32_t STPNS          : 1;
  4004.                     uint32_t STSS           : 31;
  4005.                 };
  4006.                 uint32_t RAW;
  4007.             };
  4008.         public:
  4009.             enum class EMasks: uint32_t
  4010.             {
  4011.                 STPNS                  = (0x1U << 31),
  4012.                 STSS                   = (0x7FFFFFFFU << 0),
  4013.             };
  4014.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR; }
  4015.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR = value; }
  4016.             template <EMasks ... flags>
  4017.             static inline void set_flags()
  4018.             {
  4019.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR |= SetBits<(std::uint32_t)flags...>();
  4020.             }
  4021.             template <EMasks ... flags>
  4022.             static inline void clear_flags()
  4023.             {
  4024.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR &= ~(SetBits<(std::uint32_t)flags...>());
  4025.             }
  4026.             template <EMasks ... flags>
  4027.             static inline bool get_flags()
  4028.             {
  4029.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4030.             }
  4031.             static inline uint32_t get_STSS() { return reinterpret_cast<__IO PTPTSLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR)->STSS; }
  4032.             static inline void set_STSS(uint32_t value) { reinterpret_cast<__IO PTPTSLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLR)->STSS = value; }
  4033.         };
  4034.         class PTPTSHUR
  4035.         {
  4036.         private:
  4037.             union PTPTSHUR_t
  4038.             {
  4039.                 struct
  4040.                 {
  4041.                     uint32_t TSUS           : 32;
  4042.                 };
  4043.                 uint32_t RAW;
  4044.             };
  4045.         public:
  4046.             enum class EMasks: uint32_t
  4047.             {
  4048.                 TSUS                   = (0xFFFFFFFFU << 0),
  4049.             };
  4050.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHUR; }
  4051.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHUR = value; }
  4052.             static inline uint32_t get_TSUS() { return reinterpret_cast<__IO PTPTSHUR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHUR)->TSUS; }
  4053.             static inline void set_TSUS(uint32_t value) { reinterpret_cast<__IO PTPTSHUR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSHUR)->TSUS = value; }
  4054.         };
  4055.         class PTPTSLUR
  4056.         {
  4057.         private:
  4058.             union PTPTSLUR_t
  4059.             {
  4060.                 struct
  4061.                 {
  4062.                     uint32_t reserved0      : 1;
  4063.                     uint32_t reserved1      : 1;
  4064.                     uint32_t reserved2      : 1;
  4065.                     uint32_t reserved3      : 1;
  4066.                     uint32_t reserved4      : 1;
  4067.                     uint32_t reserved5      : 1;
  4068.                     uint32_t reserved6      : 1;
  4069.                     uint32_t reserved7      : 1;
  4070.                     uint32_t reserved8      : 1;
  4071.                     uint32_t reserved9      : 1;
  4072.                     uint32_t reserved10     : 1;
  4073.                     uint32_t reserved11     : 1;
  4074.                     uint32_t reserved12     : 1;
  4075.                     uint32_t reserved13     : 1;
  4076.                     uint32_t reserved14     : 1;
  4077.                     uint32_t reserved15     : 1;
  4078.                     uint32_t reserved16     : 1;
  4079.                     uint32_t reserved17     : 1;
  4080.                     uint32_t reserved18     : 1;
  4081.                     uint32_t reserved19     : 1;
  4082.                     uint32_t reserved20     : 1;
  4083.                     uint32_t reserved21     : 1;
  4084.                     uint32_t reserved22     : 1;
  4085.                     uint32_t reserved23     : 1;
  4086.                     uint32_t reserved24     : 1;
  4087.                     uint32_t reserved25     : 1;
  4088.                     uint32_t reserved26     : 1;
  4089.                     uint32_t reserved27     : 1;
  4090.                     uint32_t reserved28     : 1;
  4091.                     uint32_t reserved29     : 1;
  4092.                     uint32_t reserved30     : 1;
  4093.                     uint32_t TSUPNS         : 1;
  4094.                     uint32_t TSUSS          : 31;
  4095.                 };
  4096.                 uint32_t RAW;
  4097.             };
  4098.         public:
  4099.             enum class EMasks: uint32_t
  4100.             {
  4101.                 TSUPNS                 = (0x1U << 31),
  4102.                 TSUSS                  = (0x7FFFFFFFU << 0),
  4103.             };
  4104.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR; }
  4105.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR = value; }
  4106.             template <EMasks ... flags>
  4107.             static inline void set_flags()
  4108.             {
  4109.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR |= SetBits<(std::uint32_t)flags...>();
  4110.             }
  4111.             template <EMasks ... flags>
  4112.             static inline void clear_flags()
  4113.             {
  4114.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR &= ~(SetBits<(std::uint32_t)flags...>());
  4115.             }
  4116.             template <EMasks ... flags>
  4117.             static inline bool get_flags()
  4118.             {
  4119.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4120.             }
  4121.             static inline uint32_t get_TSUSS() { return reinterpret_cast<__IO PTPTSLUR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR)->TSUSS; }
  4122.             static inline void set_TSUSS(uint32_t value) { reinterpret_cast<__IO PTPTSLUR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSLUR)->TSUSS = value; }
  4123.         };
  4124.         class PTPTSAR
  4125.         {
  4126.         private:
  4127.             union PTPTSAR_t
  4128.             {
  4129.                 struct
  4130.                 {
  4131.                     uint32_t TSA            : 32;
  4132.                 };
  4133.                 uint32_t RAW;
  4134.             };
  4135.         public:
  4136.             enum class EMasks: uint32_t
  4137.             {
  4138.                 TSA                    = (0xFFFFFFFFU << 0),
  4139.             };
  4140.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSAR; }
  4141.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSAR = value; }
  4142.             static inline uint32_t get_TSA() { return reinterpret_cast<__IO PTPTSAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSAR)->TSA; }
  4143.             static inline void set_TSA(uint32_t value) { reinterpret_cast<__IO PTPTSAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSAR)->TSA = value; }
  4144.         };
  4145.         class PTPTTHR
  4146.         {
  4147.         private:
  4148.             union PTPTTHR_t
  4149.             {
  4150.                 struct
  4151.                 {
  4152.                     uint32_t TTSH           : 32;
  4153.                 };
  4154.                 uint32_t RAW;
  4155.             };
  4156.         public:
  4157.             enum class EMasks: uint32_t
  4158.             {
  4159.                 TTSH                   = (0xFFFFFFFFU << 0),
  4160.             };
  4161.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTHR; }
  4162.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTHR = value; }
  4163.             static inline uint32_t get_TTSH() { return reinterpret_cast<__IO PTPTTHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTHR)->TTSH; }
  4164.             static inline void set_TTSH(uint32_t value) { reinterpret_cast<__IO PTPTTHR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTHR)->TTSH = value; }
  4165.         };
  4166.         class PTPTTLR
  4167.         {
  4168.         private:
  4169.             union PTPTTLR_t
  4170.             {
  4171.                 struct
  4172.                 {
  4173.                     uint32_t TTSL           : 32;
  4174.                 };
  4175.                 uint32_t RAW;
  4176.             };
  4177.         public:
  4178.             enum class EMasks: uint32_t
  4179.             {
  4180.                 TTSL                   = (0xFFFFFFFFU << 0),
  4181.             };
  4182.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTLR; }
  4183.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTLR = value; }
  4184.             static inline uint32_t get_TTSL() { return reinterpret_cast<__IO PTPTTLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTLR)->TTSL; }
  4185.             static inline void set_TTSL(uint32_t value) { reinterpret_cast<__IO PTPTTLR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTTLR)->TTSL = value; }
  4186.         };
  4187.         class PTPTSSR
  4188.         {
  4189.         private:
  4190.             union PTPTSSR_t
  4191.             {
  4192.                 struct
  4193.                 {
  4194.                     uint32_t reserved0      : 1;
  4195.                     uint32_t reserved1      : 1;
  4196.                     uint32_t reserved2      : 1;
  4197.                     uint32_t reserved3      : 1;
  4198.                     uint32_t reserved4      : 1;
  4199.                     uint32_t reserved5      : 1;
  4200.                     uint32_t reserved6      : 1;
  4201.                     uint32_t reserved7      : 1;
  4202.                     uint32_t reserved8      : 1;
  4203.                     uint32_t reserved9      : 1;
  4204.                     uint32_t reserved10     : 1;
  4205.                     uint32_t reserved11     : 1;
  4206.                     uint32_t reserved12     : 1;
  4207.                     uint32_t reserved13     : 1;
  4208.                     uint32_t reserved14     : 1;
  4209.                     uint32_t TSSMRME        : 1;
  4210.                     uint32_t TSSEME         : 1;
  4211.                     uint32_t TSSIPV4FE      : 1;
  4212.                     uint32_t TSSIPV6FE      : 1;
  4213.                     uint32_t TSSPTPOEFE     : 1;
  4214.                     uint32_t TSPTPPSV2E     : 1;
  4215.                     uint32_t TSSSR          : 1;
  4216.                     uint32_t TSSARFE        : 1;
  4217.                     uint32_t TSTTR          : 1;
  4218.                     uint32_t TSSO           : 1;
  4219.                     uint32_t reserved25     : 7;
  4220.                 };
  4221.                 uint32_t RAW;
  4222.             };
  4223.         public:
  4224.             enum class EMasks: uint32_t
  4225.             {
  4226.                 TSSMRME                = (0x1U << 15),
  4227.                 TSSEME                 = (0x1U << 14),
  4228.                 TSSIPV4FE              = (0x1U << 13),
  4229.                 TSSIPV6FE              = (0x1U << 12),
  4230.                 TSSPTPOEFE             = (0x1U << 11),
  4231.                 TSPTPPSV2E             = (0x1U << 10),
  4232.                 TSSSR                  = (0x1U << 9),
  4233.                 TSSARFE                = (0x1U << 8),
  4234.                 TSTTR                  = (0x1U << 5),
  4235.                 TSSO                   = (0x1U << 4),
  4236.             };
  4237.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSSR; }
  4238.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSSR = value; }
  4239.             template <EMasks ... flags>
  4240.             static inline void set_flags()
  4241.             {
  4242.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSSR |= SetBits<(std::uint32_t)flags...>();
  4243.             }
  4244.             template <EMasks ... flags>
  4245.             static inline void clear_flags()
  4246.             {
  4247.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSSR &= ~(SetBits<(std::uint32_t)flags...>());
  4248.             }
  4249.             template <EMasks ... flags>
  4250.             static inline bool get_flags()
  4251.             {
  4252.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->PTPTSSR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4253.             }
  4254.         };
  4255.         class DMABMR
  4256.         {
  4257.         private:
  4258.             union DMABMR_t
  4259.             {
  4260.                 struct
  4261.                 {
  4262.                     uint32_t reserved0      : 1;
  4263.                     uint32_t reserved1      : 1;
  4264.                     uint32_t reserved2      : 1;
  4265.                     uint32_t reserved3      : 1;
  4266.                     uint32_t reserved4      : 1;
  4267.                     uint32_t reserved5      : 1;
  4268.                     uint32_t reserved6      : 1;
  4269.                     uint32_t reserved7      : 1;
  4270.                     uint32_t reserved8      : 1;
  4271.                     uint32_t reserved9      : 1;
  4272.                     uint32_t reserved10     : 1;
  4273.                     uint32_t reserved11     : 1;
  4274.                     uint32_t reserved12     : 1;
  4275.                     uint32_t reserved13     : 1;
  4276.                     uint32_t reserved14     : 1;
  4277.                     uint32_t reserved15     : 1;
  4278.                     uint32_t reserved16     : 1;
  4279.                     uint32_t reserved17     : 1;
  4280.                     uint32_t reserved18     : 1;
  4281.                     uint32_t reserved19     : 1;
  4282.                     uint32_t reserved20     : 1;
  4283.                     uint32_t reserved21     : 1;
  4284.                     uint32_t reserved22     : 1;
  4285.                     uint32_t reserved23     : 1;
  4286.                     uint32_t reserved24     : 1;
  4287.                     uint32_t AAB            : 1;
  4288.                     uint32_t FPM            : 1;
  4289.                     uint32_t USP            : 1;
  4290.                     uint32_t RDP            : 6;
  4291.                     uint32_t FB             : 1;
  4292.                     uint32_t RTPR           : 2;
  4293.                     uint32_t PBL            : 6;
  4294.                     uint32_t EDE            : 1;
  4295.                     uint32_t DSL            : 5;
  4296.                     uint32_t DA             : 1;
  4297.                     uint32_t SR             : 1;
  4298.                 };
  4299.                 uint32_t RAW;
  4300.             };
  4301.         public:
  4302.             enum class EMasks: uint32_t
  4303.             {
  4304.                 AAB                    = (0x1U << 25),
  4305.                 FPM                    = (0x1U << 24),
  4306.                 USP                    = (0x1U << 23),
  4307.                 RDP                    = (0x3FU << 17),
  4308.                 FB                     = (0x1U << 16),
  4309.                 RTPR                   = (0x3U << 14),
  4310.                 PBL                    = (0x3FU << 8),
  4311.                 EDE                    = (0x1U << 7),
  4312.                 DSL                    = (0x1FU << 2),
  4313.                 DA                     = (0x1U << 1),
  4314.                 SR                     = (0x1U << 0),
  4315.             };
  4316.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR; }
  4317.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR = value; }
  4318.             template <EMasks ... flags>
  4319.             static inline void set_flags()
  4320.             {
  4321.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR |= SetBits<(std::uint32_t)flags...>();
  4322.             }
  4323.             template <EMasks ... flags>
  4324.             static inline void clear_flags()
  4325.             {
  4326.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR &= ~(SetBits<(std::uint32_t)flags...>());
  4327.             }
  4328.             template <EMasks ... flags>
  4329.             static inline bool get_flags()
  4330.             {
  4331.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4332.             }
  4333.             static inline uint32_t get_RDP() { return reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->RDP; }
  4334.             static inline void set_RDP(uint32_t value) { reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->RDP = value; }
  4335.             static inline uint32_t get_RTPR() { return reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->RTPR; }
  4336.             static inline void set_RTPR(uint32_t value) { reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->RTPR = value; }
  4337.             static inline uint32_t get_PBL() { return reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->PBL; }
  4338.             static inline void set_PBL(uint32_t value) { reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->PBL = value; }
  4339.             static inline uint32_t get_DSL() { return reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->DSL; }
  4340.             static inline void set_DSL(uint32_t value) { reinterpret_cast<__IO DMABMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMABMR)->DSL = value; }
  4341.         };
  4342.         class DMATPDR
  4343.         {
  4344.         private:
  4345.             union DMATPDR_t
  4346.             {
  4347.                 struct
  4348.                 {
  4349.                     uint32_t TPD            : 32;
  4350.                 };
  4351.                 uint32_t RAW;
  4352.             };
  4353.         public:
  4354.             enum class EMasks: uint32_t
  4355.             {
  4356.                 TPD                    = (0xFFFFFFFFU << 0),
  4357.             };
  4358.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATPDR; }
  4359.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATPDR = value; }
  4360.             static inline uint32_t get_TPD() { return reinterpret_cast<__IO DMATPDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATPDR)->TPD; }
  4361.             static inline void set_TPD(uint32_t value) { reinterpret_cast<__IO DMATPDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATPDR)->TPD = value; }
  4362.         };
  4363.         class DMARPDR
  4364.         {
  4365.         private:
  4366.             union DMARPDR_t
  4367.             {
  4368.                 struct
  4369.                 {
  4370.                     uint32_t RPD            : 32;
  4371.                 };
  4372.                 uint32_t RAW;
  4373.             };
  4374.         public:
  4375.             enum class EMasks: uint32_t
  4376.             {
  4377.                 RPD                    = (0xFFFFFFFFU << 0),
  4378.             };
  4379.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARPDR; }
  4380.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARPDR = value; }
  4381.             static inline uint32_t get_RPD() { return reinterpret_cast<__IO DMARPDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARPDR)->RPD; }
  4382.             static inline void set_RPD(uint32_t value) { reinterpret_cast<__IO DMARPDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARPDR)->RPD = value; }
  4383.         };
  4384.         class DMARDLAR
  4385.         {
  4386.         private:
  4387.             union DMARDLAR_t
  4388.             {
  4389.                 struct
  4390.                 {
  4391.                     uint32_t SRL            : 32;
  4392.                 };
  4393.                 uint32_t RAW;
  4394.             };
  4395.         public:
  4396.             enum class EMasks: uint32_t
  4397.             {
  4398.                 SRL                    = (0xFFFFFFFFU << 0),
  4399.             };
  4400.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARDLAR; }
  4401.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARDLAR = value; }
  4402.             static inline uint32_t get_SRL() { return reinterpret_cast<__IO DMARDLAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARDLAR)->SRL; }
  4403.             static inline void set_SRL(uint32_t value) { reinterpret_cast<__IO DMARDLAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARDLAR)->SRL = value; }
  4404.         };
  4405.         class DMATDLAR
  4406.         {
  4407.         private:
  4408.             union DMATDLAR_t
  4409.             {
  4410.                 struct
  4411.                 {
  4412.                     uint32_t STL            : 32;
  4413.                 };
  4414.                 uint32_t RAW;
  4415.             };
  4416.         public:
  4417.             enum class EMasks: uint32_t
  4418.             {
  4419.                 STL                    = (0xFFFFFFFFU << 0),
  4420.             };
  4421.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATDLAR; }
  4422.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATDLAR = value; }
  4423.             static inline uint32_t get_STL() { return reinterpret_cast<__IO DMATDLAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATDLAR)->STL; }
  4424.             static inline void set_STL(uint32_t value) { reinterpret_cast<__IO DMATDLAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMATDLAR)->STL = value; }
  4425.         };
  4426.         class DMASR
  4427.         {
  4428.         private:
  4429.             union DMASR_t
  4430.             {
  4431.                 struct
  4432.                 {
  4433.                     uint32_t reserved0      : 1;
  4434.                     uint32_t reserved1      : 1;
  4435.                     uint32_t reserved2      : 1;
  4436.                     uint32_t reserved3      : 1;
  4437.                     uint32_t reserved4      : 1;
  4438.                     uint32_t reserved5      : 1;
  4439.                     uint32_t reserved6      : 1;
  4440.                     uint32_t reserved7      : 1;
  4441.                     uint32_t reserved8      : 1;
  4442.                     uint32_t reserved9      : 1;
  4443.                     uint32_t reserved10     : 1;
  4444.                     uint32_t reserved11     : 1;
  4445.                     uint32_t reserved12     : 1;
  4446.                     uint32_t reserved13     : 1;
  4447.                     uint32_t reserved14     : 1;
  4448.                     uint32_t reserved15     : 1;
  4449.                     uint32_t reserved16     : 1;
  4450.                     uint32_t reserved17     : 1;
  4451.                     uint32_t reserved18     : 1;
  4452.                     uint32_t reserved19     : 1;
  4453.                     uint32_t reserved20     : 1;
  4454.                     uint32_t reserved21     : 1;
  4455.                     uint32_t reserved22     : 1;
  4456.                     uint32_t reserved23     : 1;
  4457.                     uint32_t reserved24     : 1;
  4458.                     uint32_t reserved25     : 1;
  4459.                     uint32_t reserved26     : 1;
  4460.                     uint32_t reserved27     : 1;
  4461.                     uint32_t reserved28     : 1;
  4462.                     uint32_t TSTS           : 1;
  4463.                     uint32_t PMTS           : 1;
  4464.                     uint32_t MMCS           : 1;
  4465.                     uint32_t EBS            : 3;
  4466.                     uint32_t EBS_DescAccess : 1;
  4467.                     uint32_t EBS_ReadTransf : 1;
  4468.                     uint32_t EBS_DataTransfTx: 1;
  4469.                     uint32_t TPS            : 3;
  4470.                     uint32_t TPS_Fetching   : 1;
  4471.                     uint32_t TPS_Waiting    : 1;
  4472.                     uint32_t TPS_Reading    : 2;
  4473.                     uint32_t TPS_Suspended  : 2;
  4474.                     uint32_t TPS_Closing    : 3;
  4475.                     uint32_t RPS            : 3;
  4476.                     uint32_t RPS_Fetching   : 1;
  4477.                     uint32_t RPS_Waiting    : 2;
  4478.                     uint32_t RPS_Suspended  : 1;
  4479.                     uint32_t RPS_Closing    : 1;
  4480.                     uint32_t RPS_Queuing    : 3;
  4481.                     uint32_t NIS            : 1;
  4482.                     uint32_t AIS            : 1;
  4483.                     uint32_t ERS            : 1;
  4484.                     uint32_t FBES           : 1;
  4485.                     uint32_t ETS            : 1;
  4486.                     uint32_t RWTS           : 1;
  4487.                     uint32_t RPSS           : 1;
  4488.                     uint32_t RBUS           : 1;
  4489.                     uint32_t RS             : 1;
  4490.                     uint32_t TUS            : 1;
  4491.                     uint32_t ROS            : 1;
  4492.                     uint32_t TJTS           : 1;
  4493.                     uint32_t TBUS           : 1;
  4494.                     uint32_t TPSS           : 1;
  4495.                     uint32_t TS             : 1;
  4496.                 };
  4497.                 uint32_t RAW;
  4498.             };
  4499.         public:
  4500.             enum class EMasks: uint32_t
  4501.             {
  4502.                 TSTS                   = (0x1U << 29),
  4503.                 PMTS                   = (0x1U << 28),
  4504.                 MMCS                   = (0x1U << 27),
  4505.                 EBS                    = (0x7U << 23),
  4506.                 EBS_DescAccess         = (0x1U << 25),
  4507.                 EBS_ReadTransf         = (0x1U << 24),
  4508.                 EBS_DataTransfTx       = (0x1U << 23),
  4509.                 TPS                    = (0x7U << 20),
  4510.                 TPS_Fetching           = (0x1U << 20),
  4511.                 TPS_Waiting            = (0x1U << 21),
  4512.                 TPS_Reading            = (0x3U << 20),
  4513.                 TPS_Suspended          = (0x3U << 21),
  4514.                 TPS_Closing            = (0x7U << 20),
  4515.                 RPS                    = (0x7U << 17),
  4516.                 RPS_Fetching           = (0x1U << 17),
  4517.                 RPS_Waiting            = (0x3U << 17),
  4518.                 RPS_Suspended          = (0x1U << 19),
  4519.                 RPS_Closing            = (0x5U << 17),
  4520.                 RPS_Queuing            = (0x7U << 17),
  4521.                 NIS                    = (0x1U << 16),
  4522.                 AIS                    = (0x1U << 15),
  4523.                 ERS                    = (0x1U << 14),
  4524.                 FBES                   = (0x1U << 13),
  4525.                 ETS                    = (0x1U << 10),
  4526.                 RWTS                   = (0x1U << 9),
  4527.                 RPSS                   = (0x1U << 8),
  4528.                 RBUS                   = (0x1U << 7),
  4529.                 RS                     = (0x1U << 6),
  4530.                 TUS                    = (0x1U << 5),
  4531.                 ROS                    = (0x1U << 4),
  4532.                 TJTS                   = (0x1U << 3),
  4533.                 TBUS                   = (0x1U << 2),
  4534.                 TPSS                   = (0x1U << 1),
  4535.                 TS                     = (0x1U << 0),
  4536.             };
  4537.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR; }
  4538.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR = value; }
  4539.             template <EMasks ... flags>
  4540.             static inline void set_flags()
  4541.             {
  4542.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR |= SetBits<(std::uint32_t)flags...>();
  4543.             }
  4544.             template <EMasks ... flags>
  4545.             static inline void clear_flags()
  4546.             {
  4547.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR &= ~(SetBits<(std::uint32_t)flags...>());
  4548.             }
  4549.             template <EMasks ... flags>
  4550.             static inline bool get_flags()
  4551.             {
  4552.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4553.             }
  4554.             static inline uint32_t get_EBS() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->EBS; }
  4555.             static inline void set_EBS(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->EBS = value; }
  4556.             static inline uint32_t get_TPS() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS; }
  4557.             static inline void set_TPS(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS = value; }
  4558.             static inline uint32_t get_TPS_Reading() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Reading; }
  4559.             static inline void set_TPS_Reading(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Reading = value; }
  4560.             static inline uint32_t get_TPS_Suspended() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Suspended; }
  4561.             static inline void set_TPS_Suspended(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Suspended = value; }
  4562.             static inline uint32_t get_TPS_Closing() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Closing; }
  4563.             static inline void set_TPS_Closing(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->TPS_Closing = value; }
  4564.             static inline uint32_t get_RPS() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS; }
  4565.             static inline void set_RPS(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS = value; }
  4566.             static inline uint32_t get_RPS_Waiting() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS_Waiting; }
  4567.             static inline void set_RPS_Waiting(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS_Waiting = value; }
  4568.             static inline uint32_t get_RPS_Queuing() { return reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS_Queuing; }
  4569.             static inline void set_RPS_Queuing(uint32_t value) { reinterpret_cast<__IO DMASR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMASR)->RPS_Queuing = value; }
  4570.         };
  4571.         class DMAOMR
  4572.         {
  4573.         private:
  4574.             union DMAOMR_t
  4575.             {
  4576.                 struct
  4577.                 {
  4578.                     uint32_t reserved0      : 1;
  4579.                     uint32_t reserved1      : 1;
  4580.                     uint32_t reserved2      : 1;
  4581.                     uint32_t reserved3      : 1;
  4582.                     uint32_t reserved4      : 1;
  4583.                     uint32_t reserved5      : 1;
  4584.                     uint32_t reserved6      : 1;
  4585.                     uint32_t reserved7      : 1;
  4586.                     uint32_t reserved8      : 1;
  4587.                     uint32_t reserved9      : 1;
  4588.                     uint32_t reserved10     : 1;
  4589.                     uint32_t reserved11     : 1;
  4590.                     uint32_t reserved12     : 1;
  4591.                     uint32_t reserved13     : 1;
  4592.                     uint32_t reserved14     : 1;
  4593.                     uint32_t reserved15     : 1;
  4594.                     uint32_t reserved16     : 1;
  4595.                     uint32_t reserved17     : 1;
  4596.                     uint32_t reserved18     : 1;
  4597.                     uint32_t reserved19     : 1;
  4598.                     uint32_t reserved20     : 1;
  4599.                     uint32_t reserved21     : 1;
  4600.                     uint32_t reserved22     : 1;
  4601.                     uint32_t reserved23     : 1;
  4602.                     uint32_t reserved24     : 1;
  4603.                     uint32_t reserved25     : 1;
  4604.                     uint32_t DTCEFD         : 1;
  4605.                     uint32_t RSF            : 1;
  4606.                     uint32_t DFRF           : 1;
  4607.                     uint32_t TSF            : 1;
  4608.                     uint32_t FTF            : 1;
  4609.                     uint32_t TTC            : 3;
  4610.                     uint32_t ST             : 1;
  4611.                     uint32_t FEF            : 1;
  4612.                     uint32_t FUGF           : 1;
  4613.                     uint32_t RTC            : 2;
  4614.                     uint32_t OSF            : 1;
  4615.                     uint32_t SR             : 1;
  4616.                 };
  4617.                 uint32_t RAW;
  4618.             };
  4619.         public:
  4620.             enum class EMasks: uint32_t
  4621.             {
  4622.                 DTCEFD                 = (0x1U << 26),
  4623.                 RSF                    = (0x1U << 25),
  4624.                 DFRF                   = (0x1U << 24),
  4625.                 TSF                    = (0x1U << 21),
  4626.                 FTF                    = (0x1U << 20),
  4627.                 TTC                    = (0x7U << 14),
  4628.                 ST                     = (0x1U << 13),
  4629.                 FEF                    = (0x1U << 7),
  4630.                 FUGF                   = (0x1U << 6),
  4631.                 RTC                    = (0x3U << 3),
  4632.                 OSF                    = (0x1U << 2),
  4633.                 SR                     = (0x1U << 1),
  4634.             };
  4635.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR; }
  4636.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR = value; }
  4637.             template <EMasks ... flags>
  4638.             static inline void set_flags()
  4639.             {
  4640.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR |= SetBits<(std::uint32_t)flags...>();
  4641.             }
  4642.             template <EMasks ... flags>
  4643.             static inline void clear_flags()
  4644.             {
  4645.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR &= ~(SetBits<(std::uint32_t)flags...>());
  4646.             }
  4647.             template <EMasks ... flags>
  4648.             static inline bool get_flags()
  4649.             {
  4650.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4651.             }
  4652.             static inline uint32_t get_TTC() { return reinterpret_cast<__IO DMAOMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR)->TTC; }
  4653.             static inline void set_TTC(uint32_t value) { reinterpret_cast<__IO DMAOMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR)->TTC = value; }
  4654.             static inline uint32_t get_RTC() { return reinterpret_cast<__IO DMAOMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR)->RTC; }
  4655.             static inline void set_RTC(uint32_t value) { reinterpret_cast<__IO DMAOMR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAOMR)->RTC = value; }
  4656.         };
  4657.         class DMAIER
  4658.         {
  4659.         private:
  4660.             union DMAIER_t
  4661.             {
  4662.                 struct
  4663.                 {
  4664.                     uint32_t reserved0      : 1;
  4665.                     uint32_t reserved1      : 1;
  4666.                     uint32_t reserved2      : 1;
  4667.                     uint32_t reserved3      : 1;
  4668.                     uint32_t reserved4      : 1;
  4669.                     uint32_t reserved5      : 1;
  4670.                     uint32_t reserved6      : 1;
  4671.                     uint32_t reserved7      : 1;
  4672.                     uint32_t reserved8      : 1;
  4673.                     uint32_t reserved9      : 1;
  4674.                     uint32_t reserved10     : 1;
  4675.                     uint32_t reserved11     : 1;
  4676.                     uint32_t reserved12     : 1;
  4677.                     uint32_t reserved13     : 1;
  4678.                     uint32_t reserved14     : 1;
  4679.                     uint32_t reserved15     : 1;
  4680.                     uint32_t NISE           : 1;
  4681.                     uint32_t AISE           : 1;
  4682.                     uint32_t ERIE           : 1;
  4683.                     uint32_t FBEIE          : 1;
  4684.                     uint32_t ETIE           : 1;
  4685.                     uint32_t RWTIE          : 1;
  4686.                     uint32_t RPSIE          : 1;
  4687.                     uint32_t RBUIE          : 1;
  4688.                     uint32_t RIE            : 1;
  4689.                     uint32_t TUIE           : 1;
  4690.                     uint32_t ROIE           : 1;
  4691.                     uint32_t TJTIE          : 1;
  4692.                     uint32_t TBUIE          : 1;
  4693.                     uint32_t TPSIE          : 1;
  4694.                     uint32_t TIE            : 1;
  4695.                     uint32_t reserved31     : 1;
  4696.                 };
  4697.                 uint32_t RAW;
  4698.             };
  4699.         public:
  4700.             enum class EMasks: uint32_t
  4701.             {
  4702.                 NISE                   = (0x1U << 16),
  4703.                 AISE                   = (0x1U << 15),
  4704.                 ERIE                   = (0x1U << 14),
  4705.                 FBEIE                  = (0x1U << 13),
  4706.                 ETIE                   = (0x1U << 10),
  4707.                 RWTIE                  = (0x1U << 9),
  4708.                 RPSIE                  = (0x1U << 8),
  4709.                 RBUIE                  = (0x1U << 7),
  4710.                 RIE                    = (0x1U << 6),
  4711.                 TUIE                   = (0x1U << 5),
  4712.                 ROIE                   = (0x1U << 4),
  4713.                 TJTIE                  = (0x1U << 3),
  4714.                 TBUIE                  = (0x1U << 2),
  4715.                 TPSIE                  = (0x1U << 1),
  4716.                 TIE                    = (0x1U << 0),
  4717.             };
  4718.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAIER; }
  4719.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAIER = value; }
  4720.             template <EMasks ... flags>
  4721.             static inline void set_flags()
  4722.             {
  4723.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAIER |= SetBits<(std::uint32_t)flags...>();
  4724.             }
  4725.             template <EMasks ... flags>
  4726.             static inline void clear_flags()
  4727.             {
  4728.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAIER &= ~(SetBits<(std::uint32_t)flags...>());
  4729.             }
  4730.             template <EMasks ... flags>
  4731.             static inline bool get_flags()
  4732.             {
  4733.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAIER & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4734.             }
  4735.         };
  4736.         class DMAMFBOCR
  4737.         {
  4738.         private:
  4739.             union DMAMFBOCR_t
  4740.             {
  4741.                 struct
  4742.                 {
  4743.                     uint32_t reserved0      : 1;
  4744.                     uint32_t reserved1      : 1;
  4745.                     uint32_t reserved2      : 1;
  4746.                     uint32_t reserved3      : 1;
  4747.                     uint32_t reserved4      : 1;
  4748.                     uint32_t reserved5      : 1;
  4749.                     uint32_t reserved6      : 1;
  4750.                     uint32_t reserved7      : 1;
  4751.                     uint32_t reserved8      : 1;
  4752.                     uint32_t reserved9      : 1;
  4753.                     uint32_t reserved10     : 1;
  4754.                     uint32_t reserved11     : 1;
  4755.                     uint32_t reserved12     : 1;
  4756.                     uint32_t reserved13     : 1;
  4757.                     uint32_t reserved14     : 1;
  4758.                     uint32_t reserved15     : 1;
  4759.                     uint32_t reserved16     : 1;
  4760.                     uint32_t reserved17     : 1;
  4761.                     uint32_t reserved18     : 1;
  4762.                     uint32_t reserved19     : 1;
  4763.                     uint32_t reserved20     : 1;
  4764.                     uint32_t reserved21     : 1;
  4765.                     uint32_t reserved22     : 1;
  4766.                     uint32_t reserved23     : 1;
  4767.                     uint32_t reserved24     : 1;
  4768.                     uint32_t reserved25     : 1;
  4769.                     uint32_t reserved26     : 1;
  4770.                     uint32_t reserved27     : 1;
  4771.                     uint32_t OFOC           : 1;
  4772.                     uint32_t MFA            : 11;
  4773.                     uint32_t OMFC           : 1;
  4774.                     uint32_t MFC            : 16;
  4775.                 };
  4776.                 uint32_t RAW;
  4777.             };
  4778.         public:
  4779.             enum class EMasks: uint32_t
  4780.             {
  4781.                 OFOC                   = (0x1U << 28),
  4782.                 MFA                    = (0x7FFU << 17),
  4783.                 OMFC                   = (0x1U << 16),
  4784.                 MFC                    = (0xFFFFU << 0),
  4785.             };
  4786.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR; }
  4787.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR = value; }
  4788.             template <EMasks ... flags>
  4789.             static inline void set_flags()
  4790.             {
  4791.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR |= SetBits<(std::uint32_t)flags...>();
  4792.             }
  4793.             template <EMasks ... flags>
  4794.             static inline void clear_flags()
  4795.             {
  4796.                 reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR &= ~(SetBits<(std::uint32_t)flags...>());
  4797.             }
  4798.             template <EMasks ... flags>
  4799.             static inline bool get_flags()
  4800.             {
  4801.                 return ((reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  4802.             }
  4803.             static inline uint32_t get_MFA() { return reinterpret_cast<__IO DMAMFBOCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR)->MFA; }
  4804.             static inline void set_MFA(uint32_t value) { reinterpret_cast<__IO DMAMFBOCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR)->MFA = value; }
  4805.             static inline uint32_t get_MFC() { return reinterpret_cast<__IO DMAMFBOCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR)->MFC; }
  4806.             static inline void set_MFC(uint32_t value) { reinterpret_cast<__IO DMAMFBOCR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMAMFBOCR)->MFC = value; }
  4807.         };
  4808.         class DMARSWTR
  4809.         {
  4810.         private:
  4811.             union DMARSWTR_t
  4812.             {
  4813.                 struct
  4814.                 {
  4815.                     uint32_t reserved0      : 32;
  4816.                 };
  4817.                 uint32_t RAW;
  4818.             };
  4819.         public:
  4820.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARSWTR; }
  4821.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMARSWTR = value; }
  4822.         };
  4823.         class DMACHTDR
  4824.         {
  4825.         private:
  4826.             union DMACHTDR_t
  4827.             {
  4828.                 struct
  4829.                 {
  4830.                     uint32_t HTDAP          : 32;
  4831.                 };
  4832.                 uint32_t RAW;
  4833.             };
  4834.         public:
  4835.             enum class EMasks: uint32_t
  4836.             {
  4837.                 HTDAP                  = (0xFFFFFFFFU << 0),
  4838.             };
  4839.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTDR; }
  4840.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTDR = value; }
  4841.             static inline uint32_t get_HTDAP() { return reinterpret_cast<__IO DMACHTDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTDR)->HTDAP; }
  4842.             static inline void set_HTDAP(uint32_t value) { reinterpret_cast<__IO DMACHTDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTDR)->HTDAP = value; }
  4843.         };
  4844.         class DMACHRDR
  4845.         {
  4846.         private:
  4847.             union DMACHRDR_t
  4848.             {
  4849.                 struct
  4850.                 {
  4851.                     uint32_t HRDAP          : 32;
  4852.                 };
  4853.                 uint32_t RAW;
  4854.             };
  4855.         public:
  4856.             enum class EMasks: uint32_t
  4857.             {
  4858.                 HRDAP                  = (0xFFFFFFFFU << 0),
  4859.             };
  4860.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRDR; }
  4861.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRDR = value; }
  4862.             static inline uint32_t get_HRDAP() { return reinterpret_cast<__IO DMACHRDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRDR)->HRDAP; }
  4863.             static inline void set_HRDAP(uint32_t value) { reinterpret_cast<__IO DMACHRDR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRDR)->HRDAP = value; }
  4864.         };
  4865.         class DMACHTBAR
  4866.         {
  4867.         private:
  4868.             union DMACHTBAR_t
  4869.             {
  4870.                 struct
  4871.                 {
  4872.                     uint32_t HTBAP          : 32;
  4873.                 };
  4874.                 uint32_t RAW;
  4875.             };
  4876.         public:
  4877.             enum class EMasks: uint32_t
  4878.             {
  4879.                 HTBAP                  = (0xFFFFFFFFU << 0),
  4880.             };
  4881.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTBAR; }
  4882.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTBAR = value; }
  4883.             static inline uint32_t get_HTBAP() { return reinterpret_cast<__IO DMACHTBAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTBAR)->HTBAP; }
  4884.             static inline void set_HTBAP(uint32_t value) { reinterpret_cast<__IO DMACHTBAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHTBAR)->HTBAP = value; }
  4885.         };
  4886.         class DMACHRBAR
  4887.         {
  4888.         private:
  4889.             union DMACHRBAR_t
  4890.             {
  4891.                 struct
  4892.                 {
  4893.                     uint32_t HRBAP          : 32;
  4894.                 };
  4895.                 uint32_t RAW;
  4896.             };
  4897.         public:
  4898.             enum class EMasks: uint32_t
  4899.             {
  4900.                 HRBAP                  = (0xFFFFFFFFU << 0),
  4901.             };
  4902.             static inline uint32_t get() { return reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRBAR; }
  4903.             static inline void set(uint32_t value) { reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRBAR = value; }
  4904.             static inline uint32_t get_HRBAP() { return reinterpret_cast<__IO DMACHRBAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRBAR)->HRBAP; }
  4905.             static inline void set_HRBAP(uint32_t value) { reinterpret_cast<__IO DMACHRBAR_t*>(&reinterpret_cast<ETH_t*>(STM32::ETH_BASE)->DMACHRBAR)->HRBAP = value; }
  4906.         };
  4907.     };
  4908.     /* EXTI DEFINITION */
  4909.     class EXTI
  4910.     {
  4911.     private:
  4912.         struct EXTI_t
  4913.         {
  4914.             __IO uint32_t                 IMR;
  4915.             __IO uint32_t                 EMR;
  4916.             __IO uint32_t                 RTSR;
  4917.             __IO uint32_t                 FTSR;
  4918.             __IO uint32_t                 SWIER;
  4919.             __IO uint32_t                 PR;
  4920.         };
  4921.     public:
  4922.         class IMR
  4923.         {
  4924.         private:
  4925.             union IMR_t
  4926.             {
  4927.                 struct
  4928.                 {
  4929.                     uint32_t MR0            : 1;
  4930.                     uint32_t MR1            : 1;
  4931.                     uint32_t MR2            : 1;
  4932.                     uint32_t MR3            : 1;
  4933.                     uint32_t MR4            : 1;
  4934.                     uint32_t MR5            : 1;
  4935.                     uint32_t MR6            : 1;
  4936.                     uint32_t MR7            : 1;
  4937.                     uint32_t MR8            : 1;
  4938.                     uint32_t MR9            : 1;
  4939.                     uint32_t MR10           : 1;
  4940.                     uint32_t MR11           : 1;
  4941.                     uint32_t MR12           : 1;
  4942.                     uint32_t MR13           : 1;
  4943.                     uint32_t MR14           : 1;
  4944.                     uint32_t MR15           : 1;
  4945.                     uint32_t MR16           : 1;
  4946.                     uint32_t MR17           : 1;
  4947.                     uint32_t MR18           : 1;
  4948.                     uint32_t MR19           : 1;
  4949.                     uint32_t MR20           : 1;
  4950.                     uint32_t MR21           : 1;
  4951.                     uint32_t MR22           : 1;
  4952.                     uint32_t IM             : 23;
  4953.                 };
  4954.                 uint32_t RAW;
  4955.             };
  4956.         public:
  4957.             enum class EMasks: uint32_t
  4958.             {
  4959.                 MR0                    = (0x1U << 0),
  4960.                 MR1                    = (0x1U << 1),
  4961.                 MR2                    = (0x1U << 2),
  4962.                 MR3                    = (0x1U << 3),
  4963.                 MR4                    = (0x1U << 4),
  4964.                 MR5                    = (0x1U << 5),
  4965.                 MR6                    = (0x1U << 6),
  4966.                 MR7                    = (0x1U << 7),
  4967.                 MR8                    = (0x1U << 8),
  4968.                 MR9                    = (0x1U << 9),
  4969.                 MR10                   = (0x1U << 10),
  4970.                 MR11                   = (0x1U << 11),
  4971.                 MR12                   = (0x1U << 12),
  4972.                 MR13                   = (0x1U << 13),
  4973.                 MR14                   = (0x1U << 14),
  4974.                 MR15                   = (0x1U << 15),
  4975.                 MR16                   = (0x1U << 16),
  4976.                 MR17                   = (0x1U << 17),
  4977.                 MR18                   = (0x1U << 18),
  4978.                 MR19                   = (0x1U << 19),
  4979.                 MR20                   = (0x1U << 20),
  4980.                 MR21                   = (0x1U << 21),
  4981.                 MR22                   = (0x1U << 22),
  4982.                 IM                     = (0x7FFFFFU << 0),
  4983.             };
  4984.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR; }
  4985.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR = value; }
  4986.             template <EMasks ... flags>
  4987.             static inline void set_flags()
  4988.             {
  4989.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR |= SetBits<(std::uint32_t)flags...>();
  4990.             }
  4991.             template <EMasks ... flags>
  4992.             static inline void clear_flags()
  4993.             {
  4994.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR &= ~(SetBits<(std::uint32_t)flags...>());
  4995.             }
  4996.             template <EMasks ... flags>
  4997.             static inline bool get_flags()
  4998.             {
  4999.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5000.             }
  5001.             static inline uint32_t get_IM() { return reinterpret_cast<__IO IMR_t*>(&reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR)->IM; }
  5002.             static inline void set_IM(uint32_t value) { reinterpret_cast<__IO IMR_t*>(&reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->IMR)->IM = value; }
  5003.         };
  5004.         class EMR
  5005.         {
  5006.         private:
  5007.             union EMR_t
  5008.             {
  5009.                 struct
  5010.                 {
  5011.                     uint32_t MR0            : 1;
  5012.                     uint32_t MR1            : 1;
  5013.                     uint32_t MR2            : 1;
  5014.                     uint32_t MR3            : 1;
  5015.                     uint32_t MR4            : 1;
  5016.                     uint32_t MR5            : 1;
  5017.                     uint32_t MR6            : 1;
  5018.                     uint32_t MR7            : 1;
  5019.                     uint32_t MR8            : 1;
  5020.                     uint32_t MR9            : 1;
  5021.                     uint32_t MR10           : 1;
  5022.                     uint32_t MR11           : 1;
  5023.                     uint32_t MR12           : 1;
  5024.                     uint32_t MR13           : 1;
  5025.                     uint32_t MR14           : 1;
  5026.                     uint32_t MR15           : 1;
  5027.                     uint32_t MR16           : 1;
  5028.                     uint32_t MR17           : 1;
  5029.                     uint32_t MR18           : 1;
  5030.                     uint32_t MR19           : 1;
  5031.                     uint32_t MR20           : 1;
  5032.                     uint32_t MR21           : 1;
  5033.                     uint32_t MR22           : 1;
  5034.                     uint32_t reserved23     : 9;
  5035.                 };
  5036.                 uint32_t RAW;
  5037.             };
  5038.         public:
  5039.             enum class EMasks: uint32_t
  5040.             {
  5041.                 MR0                    = (0x1U << 0),
  5042.                 MR1                    = (0x1U << 1),
  5043.                 MR2                    = (0x1U << 2),
  5044.                 MR3                    = (0x1U << 3),
  5045.                 MR4                    = (0x1U << 4),
  5046.                 MR5                    = (0x1U << 5),
  5047.                 MR6                    = (0x1U << 6),
  5048.                 MR7                    = (0x1U << 7),
  5049.                 MR8                    = (0x1U << 8),
  5050.                 MR9                    = (0x1U << 9),
  5051.                 MR10                   = (0x1U << 10),
  5052.                 MR11                   = (0x1U << 11),
  5053.                 MR12                   = (0x1U << 12),
  5054.                 MR13                   = (0x1U << 13),
  5055.                 MR14                   = (0x1U << 14),
  5056.                 MR15                   = (0x1U << 15),
  5057.                 MR16                   = (0x1U << 16),
  5058.                 MR17                   = (0x1U << 17),
  5059.                 MR18                   = (0x1U << 18),
  5060.                 MR19                   = (0x1U << 19),
  5061.                 MR20                   = (0x1U << 20),
  5062.                 MR21                   = (0x1U << 21),
  5063.                 MR22                   = (0x1U << 22),
  5064.             };
  5065.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->EMR; }
  5066.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->EMR = value; }
  5067.             template <EMasks ... flags>
  5068.             static inline void set_flags()
  5069.             {
  5070.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->EMR |= SetBits<(std::uint32_t)flags...>();
  5071.             }
  5072.             template <EMasks ... flags>
  5073.             static inline void clear_flags()
  5074.             {
  5075.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->EMR &= ~(SetBits<(std::uint32_t)flags...>());
  5076.             }
  5077.             template <EMasks ... flags>
  5078.             static inline bool get_flags()
  5079.             {
  5080.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->EMR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5081.             }
  5082.         };
  5083.         class RTSR
  5084.         {
  5085.         private:
  5086.             union RTSR_t
  5087.             {
  5088.                 struct
  5089.                 {
  5090.                     uint32_t TR0            : 1;
  5091.                     uint32_t TR1            : 1;
  5092.                     uint32_t TR2            : 1;
  5093.                     uint32_t TR3            : 1;
  5094.                     uint32_t TR4            : 1;
  5095.                     uint32_t TR5            : 1;
  5096.                     uint32_t TR6            : 1;
  5097.                     uint32_t TR7            : 1;
  5098.                     uint32_t TR8            : 1;
  5099.                     uint32_t TR9            : 1;
  5100.                     uint32_t TR10           : 1;
  5101.                     uint32_t TR11           : 1;
  5102.                     uint32_t TR12           : 1;
  5103.                     uint32_t TR13           : 1;
  5104.                     uint32_t TR14           : 1;
  5105.                     uint32_t TR15           : 1;
  5106.                     uint32_t TR16           : 1;
  5107.                     uint32_t TR17           : 1;
  5108.                     uint32_t TR18           : 1;
  5109.                     uint32_t TR19           : 1;
  5110.                     uint32_t TR20           : 1;
  5111.                     uint32_t TR21           : 1;
  5112.                     uint32_t TR22           : 1;
  5113.                     uint32_t reserved23     : 9;
  5114.                 };
  5115.                 uint32_t RAW;
  5116.             };
  5117.         public:
  5118.             enum class EMasks: uint32_t
  5119.             {
  5120.                 TR0                    = (0x1U << 0),
  5121.                 TR1                    = (0x1U << 1),
  5122.                 TR2                    = (0x1U << 2),
  5123.                 TR3                    = (0x1U << 3),
  5124.                 TR4                    = (0x1U << 4),
  5125.                 TR5                    = (0x1U << 5),
  5126.                 TR6                    = (0x1U << 6),
  5127.                 TR7                    = (0x1U << 7),
  5128.                 TR8                    = (0x1U << 8),
  5129.                 TR9                    = (0x1U << 9),
  5130.                 TR10                   = (0x1U << 10),
  5131.                 TR11                   = (0x1U << 11),
  5132.                 TR12                   = (0x1U << 12),
  5133.                 TR13                   = (0x1U << 13),
  5134.                 TR14                   = (0x1U << 14),
  5135.                 TR15                   = (0x1U << 15),
  5136.                 TR16                   = (0x1U << 16),
  5137.                 TR17                   = (0x1U << 17),
  5138.                 TR18                   = (0x1U << 18),
  5139.                 TR19                   = (0x1U << 19),
  5140.                 TR20                   = (0x1U << 20),
  5141.                 TR21                   = (0x1U << 21),
  5142.                 TR22                   = (0x1U << 22),
  5143.             };
  5144.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->RTSR; }
  5145.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->RTSR = value; }
  5146.             template <EMasks ... flags>
  5147.             static inline void set_flags()
  5148.             {
  5149.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->RTSR |= SetBits<(std::uint32_t)flags...>();
  5150.             }
  5151.             template <EMasks ... flags>
  5152.             static inline void clear_flags()
  5153.             {
  5154.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->RTSR &= ~(SetBits<(std::uint32_t)flags...>());
  5155.             }
  5156.             template <EMasks ... flags>
  5157.             static inline bool get_flags()
  5158.             {
  5159.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->RTSR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5160.             }
  5161.         };
  5162.         class FTSR
  5163.         {
  5164.         private:
  5165.             union FTSR_t
  5166.             {
  5167.                 struct
  5168.                 {
  5169.                     uint32_t TR0            : 1;
  5170.                     uint32_t TR1            : 1;
  5171.                     uint32_t TR2            : 1;
  5172.                     uint32_t TR3            : 1;
  5173.                     uint32_t TR4            : 1;
  5174.                     uint32_t TR5            : 1;
  5175.                     uint32_t TR6            : 1;
  5176.                     uint32_t TR7            : 1;
  5177.                     uint32_t TR8            : 1;
  5178.                     uint32_t TR9            : 1;
  5179.                     uint32_t TR10           : 1;
  5180.                     uint32_t TR11           : 1;
  5181.                     uint32_t TR12           : 1;
  5182.                     uint32_t TR13           : 1;
  5183.                     uint32_t TR14           : 1;
  5184.                     uint32_t TR15           : 1;
  5185.                     uint32_t TR16           : 1;
  5186.                     uint32_t TR17           : 1;
  5187.                     uint32_t TR18           : 1;
  5188.                     uint32_t TR19           : 1;
  5189.                     uint32_t TR20           : 1;
  5190.                     uint32_t TR21           : 1;
  5191.                     uint32_t TR22           : 1;
  5192.                     uint32_t reserved23     : 9;
  5193.                 };
  5194.                 uint32_t RAW;
  5195.             };
  5196.         public:
  5197.             enum class EMasks: uint32_t
  5198.             {
  5199.                 TR0                    = (0x1U << 0),
  5200.                 TR1                    = (0x1U << 1),
  5201.                 TR2                    = (0x1U << 2),
  5202.                 TR3                    = (0x1U << 3),
  5203.                 TR4                    = (0x1U << 4),
  5204.                 TR5                    = (0x1U << 5),
  5205.                 TR6                    = (0x1U << 6),
  5206.                 TR7                    = (0x1U << 7),
  5207.                 TR8                    = (0x1U << 8),
  5208.                 TR9                    = (0x1U << 9),
  5209.                 TR10                   = (0x1U << 10),
  5210.                 TR11                   = (0x1U << 11),
  5211.                 TR12                   = (0x1U << 12),
  5212.                 TR13                   = (0x1U << 13),
  5213.                 TR14                   = (0x1U << 14),
  5214.                 TR15                   = (0x1U << 15),
  5215.                 TR16                   = (0x1U << 16),
  5216.                 TR17                   = (0x1U << 17),
  5217.                 TR18                   = (0x1U << 18),
  5218.                 TR19                   = (0x1U << 19),
  5219.                 TR20                   = (0x1U << 20),
  5220.                 TR21                   = (0x1U << 21),
  5221.                 TR22                   = (0x1U << 22),
  5222.             };
  5223.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->FTSR; }
  5224.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->FTSR = value; }
  5225.             template <EMasks ... flags>
  5226.             static inline void set_flags()
  5227.             {
  5228.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->FTSR |= SetBits<(std::uint32_t)flags...>();
  5229.             }
  5230.             template <EMasks ... flags>
  5231.             static inline void clear_flags()
  5232.             {
  5233.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->FTSR &= ~(SetBits<(std::uint32_t)flags...>());
  5234.             }
  5235.             template <EMasks ... flags>
  5236.             static inline bool get_flags()
  5237.             {
  5238.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->FTSR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5239.             }
  5240.         };
  5241.         class SWIER
  5242.         {
  5243.         private:
  5244.             union SWIER_t
  5245.             {
  5246.                 struct
  5247.                 {
  5248.                     uint32_t SWIER0         : 1;
  5249.                     uint32_t SWIER1         : 1;
  5250.                     uint32_t SWIER2         : 1;
  5251.                     uint32_t SWIER3         : 1;
  5252.                     uint32_t SWIER4         : 1;
  5253.                     uint32_t SWIER5         : 1;
  5254.                     uint32_t SWIER6         : 1;
  5255.                     uint32_t SWIER7         : 1;
  5256.                     uint32_t SWIER8         : 1;
  5257.                     uint32_t SWIER9         : 1;
  5258.                     uint32_t SWIER10        : 1;
  5259.                     uint32_t SWIER11        : 1;
  5260.                     uint32_t SWIER12        : 1;
  5261.                     uint32_t SWIER13        : 1;
  5262.                     uint32_t SWIER14        : 1;
  5263.                     uint32_t SWIER15        : 1;
  5264.                     uint32_t SWIER16        : 1;
  5265.                     uint32_t SWIER17        : 1;
  5266.                     uint32_t SWIER18        : 1;
  5267.                     uint32_t SWIER19        : 1;
  5268.                     uint32_t SWIER20        : 1;
  5269.                     uint32_t SWIER21        : 1;
  5270.                     uint32_t SWIER22        : 1;
  5271.                     uint32_t reserved23     : 9;
  5272.                 };
  5273.                 uint32_t RAW;
  5274.             };
  5275.         public:
  5276.             enum class EMasks: uint32_t
  5277.             {
  5278.                 SWIER0                 = (0x1U << 0),
  5279.                 SWIER1                 = (0x1U << 1),
  5280.                 SWIER2                 = (0x1U << 2),
  5281.                 SWIER3                 = (0x1U << 3),
  5282.                 SWIER4                 = (0x1U << 4),
  5283.                 SWIER5                 = (0x1U << 5),
  5284.                 SWIER6                 = (0x1U << 6),
  5285.                 SWIER7                 = (0x1U << 7),
  5286.                 SWIER8                 = (0x1U << 8),
  5287.                 SWIER9                 = (0x1U << 9),
  5288.                 SWIER10                = (0x1U << 10),
  5289.                 SWIER11                = (0x1U << 11),
  5290.                 SWIER12                = (0x1U << 12),
  5291.                 SWIER13                = (0x1U << 13),
  5292.                 SWIER14                = (0x1U << 14),
  5293.                 SWIER15                = (0x1U << 15),
  5294.                 SWIER16                = (0x1U << 16),
  5295.                 SWIER17                = (0x1U << 17),
  5296.                 SWIER18                = (0x1U << 18),
  5297.                 SWIER19                = (0x1U << 19),
  5298.                 SWIER20                = (0x1U << 20),
  5299.                 SWIER21                = (0x1U << 21),
  5300.                 SWIER22                = (0x1U << 22),
  5301.             };
  5302.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->SWIER; }
  5303.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->SWIER = value; }
  5304.             template <EMasks ... flags>
  5305.             static inline void set_flags()
  5306.             {
  5307.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->SWIER |= SetBits<(std::uint32_t)flags...>();
  5308.             }
  5309.             template <EMasks ... flags>
  5310.             static inline void clear_flags()
  5311.             {
  5312.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->SWIER &= ~(SetBits<(std::uint32_t)flags...>());
  5313.             }
  5314.             template <EMasks ... flags>
  5315.             static inline bool get_flags()
  5316.             {
  5317.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->SWIER & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5318.             }
  5319.         };
  5320.         class PR
  5321.         {
  5322.         private:
  5323.             union PR_t
  5324.             {
  5325.                 struct
  5326.                 {
  5327.                     uint32_t PR0            : 1;
  5328.                     uint32_t PR1            : 1;
  5329.                     uint32_t PR2            : 1;
  5330.                     uint32_t PR3            : 1;
  5331.                     uint32_t PR4            : 1;
  5332.                     uint32_t PR5            : 1;
  5333.                     uint32_t PR6            : 1;
  5334.                     uint32_t PR7            : 1;
  5335.                     uint32_t PR8            : 1;
  5336.                     uint32_t PR9            : 1;
  5337.                     uint32_t PR10           : 1;
  5338.                     uint32_t PR11           : 1;
  5339.                     uint32_t PR12           : 1;
  5340.                     uint32_t PR13           : 1;
  5341.                     uint32_t PR14           : 1;
  5342.                     uint32_t PR15           : 1;
  5343.                     uint32_t PR16           : 1;
  5344.                     uint32_t PR17           : 1;
  5345.                     uint32_t PR18           : 1;
  5346.                     uint32_t PR19           : 1;
  5347.                     uint32_t PR20           : 1;
  5348.                     uint32_t PR21           : 1;
  5349.                     uint32_t PR22           : 1;
  5350.                     uint32_t reserved23     : 9;
  5351.                 };
  5352.                 uint32_t RAW;
  5353.             };
  5354.         public:
  5355.             enum class EMasks: uint32_t
  5356.             {
  5357.                 PR0                    = (0x1U << 0),
  5358.                 PR1                    = (0x1U << 1),
  5359.                 PR2                    = (0x1U << 2),
  5360.                 PR3                    = (0x1U << 3),
  5361.                 PR4                    = (0x1U << 4),
  5362.                 PR5                    = (0x1U << 5),
  5363.                 PR6                    = (0x1U << 6),
  5364.                 PR7                    = (0x1U << 7),
  5365.                 PR8                    = (0x1U << 8),
  5366.                 PR9                    = (0x1U << 9),
  5367.                 PR10                   = (0x1U << 10),
  5368.                 PR11                   = (0x1U << 11),
  5369.                 PR12                   = (0x1U << 12),
  5370.                 PR13                   = (0x1U << 13),
  5371.                 PR14                   = (0x1U << 14),
  5372.                 PR15                   = (0x1U << 15),
  5373.                 PR16                   = (0x1U << 16),
  5374.                 PR17                   = (0x1U << 17),
  5375.                 PR18                   = (0x1U << 18),
  5376.                 PR19                   = (0x1U << 19),
  5377.                 PR20                   = (0x1U << 20),
  5378.                 PR21                   = (0x1U << 21),
  5379.                 PR22                   = (0x1U << 22),
  5380.             };
  5381.             static inline uint32_t get() { return reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->PR; }
  5382.             static inline void set(uint32_t value) { reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->PR = value; }
  5383.             template <EMasks ... flags>
  5384.             static inline void set_flags()
  5385.             {
  5386.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->PR |= SetBits<(std::uint32_t)flags...>();
  5387.             }
  5388.             template <EMasks ... flags>
  5389.             static inline void clear_flags()
  5390.             {
  5391.                 reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->PR &= ~(SetBits<(std::uint32_t)flags...>());
  5392.             }
  5393.             template <EMasks ... flags>
  5394.             static inline bool get_flags()
  5395.             {
  5396.                 return ((reinterpret_cast<EXTI_t*>(STM32::EXTI_BASE)->PR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5397.             }
  5398.         };
  5399.     };
  5400.     /* FLASH DEFINITION */
  5401.     class FLASH
  5402.     {
  5403.     private:
  5404.         struct FLASH_t
  5405.         {
  5406.             __IO uint32_t                 ACR;
  5407.             __IO uint32_t                 KEYR;
  5408.             __IO uint32_t                 OPTKEYR;
  5409.             __IO uint32_t                 SR;
  5410.             __IO uint32_t                 CR;
  5411.             __IO uint32_t                 OPTCR;
  5412.             __IO uint32_t                 OPTCR1;
  5413.         };
  5414.     public:
  5415.         class ACR
  5416.         {
  5417.         private:
  5418.             union ACR_t
  5419.             {
  5420.                 struct
  5421.                 {
  5422.                     uint32_t LATENCY        : 4;
  5423.                     uint32_t reserved4      : 1;
  5424.                     uint32_t reserved5      : 1;
  5425.                     uint32_t reserved6      : 1;
  5426.                     uint32_t reserved7      : 1;
  5427.                     uint32_t PRFTEN         : 1;
  5428.                     uint32_t ICEN           : 1;
  5429.                     uint32_t DCEN           : 1;
  5430.                     uint32_t ICRST          : 1;
  5431.                     uint32_t DCRST          : 1;
  5432.                     uint32_t BYTE0_ADDRESS  : 5;
  5433.                     uint32_t BYTE2_ADDRESS  : 4;
  5434.                     uint32_t reserved22     : 10;
  5435.                 };
  5436.                 uint32_t RAW;
  5437.             };
  5438.         public:
  5439.             enum class EMasks: uint32_t
  5440.             {
  5441.                 LATENCY                = (0xFU << 0),
  5442.                 PRFTEN                 = (0x1U << 8),
  5443.                 ICEN                   = (0x1U << 9),
  5444.                 DCEN                   = (0x1U << 10),
  5445.                 ICRST                  = (0x1U << 11),
  5446.                 DCRST                  = (0x1U << 12),
  5447.                 BYTE0_ADDRESS          = (0x10008FU << 10),
  5448.                 BYTE2_ADDRESS          = (0x40023C03U << 0),
  5449.             };
  5450.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR; }
  5451.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR = value; }
  5452.             template <EMasks ... flags>
  5453.             static inline void set_flags()
  5454.             {
  5455.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR |= SetBits<(std::uint32_t)flags...>();
  5456.             }
  5457.             template <EMasks ... flags>
  5458.             static inline void clear_flags()
  5459.             {
  5460.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR &= ~(SetBits<(std::uint32_t)flags...>());
  5461.             }
  5462.             template <EMasks ... flags>
  5463.             static inline bool get_flags()
  5464.             {
  5465.                 return ((reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5466.             }
  5467.             static inline uint32_t get_LATENCY() { return reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->LATENCY; }
  5468.             static inline void set_LATENCY(uint32_t value) { reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->LATENCY = value; }
  5469.             static inline uint32_t get_BYTE0_ADDRESS() { return reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->BYTE0_ADDRESS; }
  5470.             static inline void set_BYTE0_ADDRESS(uint32_t value) { reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->BYTE0_ADDRESS = value; }
  5471.             static inline uint32_t get_BYTE2_ADDRESS() { return reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->BYTE2_ADDRESS; }
  5472.             static inline void set_BYTE2_ADDRESS(uint32_t value) { reinterpret_cast<__IO ACR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->ACR)->BYTE2_ADDRESS = value; }
  5473.         };
  5474.         class KEYR
  5475.         {
  5476.         private:
  5477.             union KEYR_t
  5478.             {
  5479.                 struct
  5480.                 {
  5481.                     uint32_t reserved0      : 32;
  5482.                 };
  5483.                 uint32_t RAW;
  5484.             };
  5485.         public:
  5486.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->KEYR; }
  5487.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->KEYR = value; }
  5488.         };
  5489.         class OPTKEYR
  5490.         {
  5491.         private:
  5492.             union OPTKEYR_t
  5493.             {
  5494.                 struct
  5495.                 {
  5496.                     uint32_t reserved0      : 32;
  5497.                 };
  5498.                 uint32_t RAW;
  5499.             };
  5500.         public:
  5501.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTKEYR; }
  5502.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTKEYR = value; }
  5503.         };
  5504.         class SR
  5505.         {
  5506.         private:
  5507.             union SR_t
  5508.             {
  5509.                 struct
  5510.                 {
  5511.                     uint32_t EOP            : 1;
  5512.                     uint32_t SOP            : 1;
  5513.                     uint32_t reserved2      : 1;
  5514.                     uint32_t reserved3      : 1;
  5515.                     uint32_t WRPERR         : 1;
  5516.                     uint32_t PGAERR         : 1;
  5517.                     uint32_t PGPERR         : 1;
  5518.                     uint32_t PGSERR         : 1;
  5519.                     uint32_t reserved8      : 1;
  5520.                     uint32_t reserved9      : 1;
  5521.                     uint32_t reserved10     : 1;
  5522.                     uint32_t reserved11     : 1;
  5523.                     uint32_t reserved12     : 1;
  5524.                     uint32_t reserved13     : 1;
  5525.                     uint32_t reserved14     : 1;
  5526.                     uint32_t reserved15     : 1;
  5527.                     uint32_t BSY            : 1;
  5528.                     uint32_t reserved17     : 15;
  5529.                 };
  5530.                 uint32_t RAW;
  5531.             };
  5532.         public:
  5533.             enum class EMasks: uint32_t
  5534.             {
  5535.                 EOP                    = (0x1U << 0),
  5536.                 SOP                    = (0x1U << 1),
  5537.                 WRPERR                 = (0x1U << 4),
  5538.                 PGAERR                 = (0x1U << 5),
  5539.                 PGPERR                 = (0x1U << 6),
  5540.                 PGSERR                 = (0x1U << 7),
  5541.                 BSY                    = (0x1U << 16),
  5542.             };
  5543.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->SR; }
  5544.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->SR = value; }
  5545.             template <EMasks ... flags>
  5546.             static inline void set_flags()
  5547.             {
  5548.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  5549.             }
  5550.             template <EMasks ... flags>
  5551.             static inline void clear_flags()
  5552.             {
  5553.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  5554.             }
  5555.             template <EMasks ... flags>
  5556.             static inline bool get_flags()
  5557.             {
  5558.                 return ((reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5559.             }
  5560.         };
  5561.         class CR
  5562.         {
  5563.         private:
  5564.             union CR_t
  5565.             {
  5566.                 struct
  5567.                 {
  5568.                     uint32_t PG             : 1;
  5569.                     uint32_t SER            : 1;
  5570.                     uint32_t MER            : 1;
  5571.                     uint32_t SNB            : 5;
  5572.                     uint32_t PSIZE          : 2;
  5573.                     uint32_t reserved10     : 1;
  5574.                     uint32_t reserved11     : 1;
  5575.                     uint32_t reserved12     : 1;
  5576.                     uint32_t reserved13     : 1;
  5577.                     uint32_t reserved14     : 1;
  5578.                     uint32_t reserved15     : 1;
  5579.                     uint32_t STRT           : 1;
  5580.                     uint32_t reserved17     : 1;
  5581.                     uint32_t reserved18     : 1;
  5582.                     uint32_t reserved19     : 1;
  5583.                     uint32_t reserved20     : 1;
  5584.                     uint32_t reserved21     : 1;
  5585.                     uint32_t reserved22     : 1;
  5586.                     uint32_t reserved23     : 1;
  5587.                     uint32_t EOPIE          : 1;
  5588.                     uint32_t reserved25     : 1;
  5589.                     uint32_t reserved26     : 1;
  5590.                     uint32_t reserved27     : 1;
  5591.                     uint32_t reserved28     : 1;
  5592.                     uint32_t reserved29     : 1;
  5593.                     uint32_t reserved30     : 1;
  5594.                     uint32_t LOCK           : 1;
  5595.                 };
  5596.                 uint32_t RAW;
  5597.             };
  5598.         public:
  5599.             enum class EMasks: uint32_t
  5600.             {
  5601.                 PG                     = (0x1U << 0),
  5602.                 SER                    = (0x1U << 1),
  5603.                 MER                    = (0x1U << 2),
  5604.                 SNB                    = (0x1FU << 3),
  5605.                 PSIZE                  = (0x3U << 8),
  5606.                 STRT                   = (0x1U << 16),
  5607.                 EOPIE                  = (0x1U << 24),
  5608.                 LOCK                   = (0x1U << 31),
  5609.             };
  5610.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR; }
  5611.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR = value; }
  5612.             template <EMasks ... flags>
  5613.             static inline void set_flags()
  5614.             {
  5615.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  5616.             }
  5617.             template <EMasks ... flags>
  5618.             static inline void clear_flags()
  5619.             {
  5620.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  5621.             }
  5622.             template <EMasks ... flags>
  5623.             static inline bool get_flags()
  5624.             {
  5625.                 return ((reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5626.             }
  5627.             static inline uint32_t get_SNB() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR)->SNB; }
  5628.             static inline void set_SNB(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR)->SNB = value; }
  5629.             static inline uint32_t get_PSIZE() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR)->PSIZE; }
  5630.             static inline void set_PSIZE(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->CR)->PSIZE = value; }
  5631.         };
  5632.         class OPTCR
  5633.         {
  5634.         private:
  5635.             union OPTCR_t
  5636.             {
  5637.                 struct
  5638.                 {
  5639.                     uint32_t OPTLOCK        : 1;
  5640.                     uint32_t OPTSTRT        : 1;
  5641.                     uint32_t BOR_LEV        : 2;
  5642.                     uint32_t reserved4      : 1;
  5643.                     uint32_t WDG_SW         : 1;
  5644.                     uint32_t nRST_STOP      : 1;
  5645.                     uint32_t nRST_STDBY     : 1;
  5646.                     uint32_t RDP            : 8;
  5647.                     uint32_t nWRP           : 12;
  5648.                     uint32_t reserved28     : 4;
  5649.                 };
  5650.                 uint32_t RAW;
  5651.             };
  5652.         public:
  5653.             enum class EMasks: uint32_t
  5654.             {
  5655.                 OPTLOCK                = (0x1U << 0),
  5656.                 OPTSTRT                = (0x1U << 1),
  5657.                 BOR_LEV                = (0x3U << 2),
  5658.                 WDG_SW                 = (0x1U << 5),
  5659.                 nRST_STOP              = (0x1U << 6),
  5660.                 nRST_STDBY             = (0x1U << 7),
  5661.                 RDP                    = (0xFFU << 8),
  5662.                 nWRP                   = (0xFFFU << 16),
  5663.             };
  5664.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR; }
  5665.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR = value; }
  5666.             template <EMasks ... flags>
  5667.             static inline void set_flags()
  5668.             {
  5669.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR |= SetBits<(std::uint32_t)flags...>();
  5670.             }
  5671.             template <EMasks ... flags>
  5672.             static inline void clear_flags()
  5673.             {
  5674.                 reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR &= ~(SetBits<(std::uint32_t)flags...>());
  5675.             }
  5676.             template <EMasks ... flags>
  5677.             static inline bool get_flags()
  5678.             {
  5679.                 return ((reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5680.             }
  5681.             static inline uint32_t get_BOR_LEV() { return reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->BOR_LEV; }
  5682.             static inline void set_BOR_LEV(uint32_t value) { reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->BOR_LEV = value; }
  5683.             static inline uint32_t get_RDP() { return reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->RDP; }
  5684.             static inline void set_RDP(uint32_t value) { reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->RDP = value; }
  5685.             static inline uint32_t get_nWRP() { return reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->nWRP; }
  5686.             static inline void set_nWRP(uint32_t value) { reinterpret_cast<__IO OPTCR_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR)->nWRP = value; }
  5687.         };
  5688.         class OPTCR1
  5689.         {
  5690.         private:
  5691.             union OPTCR1_t
  5692.             {
  5693.                 struct
  5694.                 {
  5695.                     uint32_t reserved0      : 1;
  5696.                     uint32_t reserved1      : 1;
  5697.                     uint32_t reserved2      : 1;
  5698.                     uint32_t reserved3      : 1;
  5699.                     uint32_t reserved4      : 1;
  5700.                     uint32_t reserved5      : 1;
  5701.                     uint32_t reserved6      : 1;
  5702.                     uint32_t reserved7      : 1;
  5703.                     uint32_t reserved8      : 1;
  5704.                     uint32_t reserved9      : 1;
  5705.                     uint32_t reserved10     : 1;
  5706.                     uint32_t reserved11     : 1;
  5707.                     uint32_t reserved12     : 1;
  5708.                     uint32_t reserved13     : 1;
  5709.                     uint32_t reserved14     : 1;
  5710.                     uint32_t reserved15     : 1;
  5711.                     uint32_t nWRP           : 12;
  5712.                     uint32_t reserved28     : 4;
  5713.                 };
  5714.                 uint32_t RAW;
  5715.             };
  5716.         public:
  5717.             enum class EMasks: uint32_t
  5718.             {
  5719.                 nWRP                   = (0xFFFU << 16),
  5720.             };
  5721.             static inline uint32_t get() { return reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR1; }
  5722.             static inline void set(uint32_t value) { reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR1 = value; }
  5723.             static inline uint32_t get_nWRP() { return reinterpret_cast<__IO OPTCR1_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR1)->nWRP; }
  5724.             static inline void set_nWRP(uint32_t value) { reinterpret_cast<__IO OPTCR1_t*>(&reinterpret_cast<FLASH_t*>(STM32::FLASH_BASE)->OPTCR1)->nWRP = value; }
  5725.         };
  5726.     };
  5727.     /* FSMC_Bank1 DEFINITION */
  5728.     template <uint32_t reg_base>
  5729.     class FSMC_Bank1
  5730.     {
  5731. #warning TODO: FSMC_Bank1
  5732.     };
  5733.     /* FSMC_Bank1E DEFINITION */
  5734.     template <uint32_t reg_base>
  5735.     class FSMC_Bank1E
  5736.     {
  5737. #warning TODO: FSMC_Bank1E
  5738.     };
  5739.     /* FSMC_Bank4 DEFINITION */
  5740.     template <uint32_t reg_base>
  5741.     class FSMC_Bank4
  5742.     {
  5743. #warning TODO: FSMC_Bank4
  5744.     };
  5745.     /* GPIO DEFINITION */
  5746.     template <uint32_t reg_base>
  5747.     class GPIO
  5748.     {
  5749. #warning TODO: GPIO
  5750.     };
  5751.     /* SYSCFG DEFINITION */
  5752.     class SYSCFG
  5753.     {
  5754.     private:
  5755.         struct SYSCFG_t
  5756.         {
  5757.             __IO uint32_t                 MEMRMP;
  5758.             __IO uint32_t                 PMC;
  5759.             __IO uint32_t                 EXTICR[4];
  5760.             uint32_t                      RESERVED[2];
  5761.             __IO uint32_t                 CMPCR;
  5762.         };
  5763.     public:
  5764.         class MEMRMP
  5765.         {
  5766.         private:
  5767.             union MEMRMP_t
  5768.             {
  5769.                 struct
  5770.                 {
  5771.                     uint32_t MEM_MODE       : 2;
  5772.                     uint32_t reserved2      : 30;
  5773.                 };
  5774.                 uint32_t RAW;
  5775.             };
  5776.         public:
  5777.             enum class EMasks: uint32_t
  5778.             {
  5779.                 MEM_MODE               = (0x3U << 0),
  5780.             };
  5781.             static inline uint32_t get() { return reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->MEMRMP; }
  5782.             static inline void set(uint32_t value) { reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->MEMRMP = value; }
  5783.             static inline uint32_t get_MEM_MODE() { return reinterpret_cast<__IO MEMRMP_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->MEMRMP)->MEM_MODE; }
  5784.             static inline void set_MEM_MODE(uint32_t value) { reinterpret_cast<__IO MEMRMP_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->MEMRMP)->MEM_MODE = value; }
  5785.         };
  5786.         class PMC
  5787.         {
  5788.         private:
  5789.             union PMC_t
  5790.             {
  5791.                 struct
  5792.                 {
  5793.                     uint32_t reserved0      : 1;
  5794.                     uint32_t reserved1      : 1;
  5795.                     uint32_t reserved2      : 1;
  5796.                     uint32_t reserved3      : 1;
  5797.                     uint32_t reserved4      : 1;
  5798.                     uint32_t reserved5      : 1;
  5799.                     uint32_t reserved6      : 1;
  5800.                     uint32_t reserved7      : 1;
  5801.                     uint32_t reserved8      : 1;
  5802.                     uint32_t reserved9      : 1;
  5803.                     uint32_t reserved10     : 1;
  5804.                     uint32_t reserved11     : 1;
  5805.                     uint32_t reserved12     : 1;
  5806.                     uint32_t reserved13     : 1;
  5807.                     uint32_t reserved14     : 1;
  5808.                     uint32_t reserved15     : 1;
  5809.                     uint32_t reserved16     : 1;
  5810.                     uint32_t reserved17     : 1;
  5811.                     uint32_t reserved18     : 1;
  5812.                     uint32_t reserved19     : 1;
  5813.                     uint32_t reserved20     : 1;
  5814.                     uint32_t reserved21     : 1;
  5815.                     uint32_t reserved22     : 1;
  5816.                     uint32_t MII_RMII_SEL   : 1;
  5817.                     uint32_t reserved24     : 8;
  5818.                 };
  5819.                 uint32_t RAW;
  5820.             };
  5821.         public:
  5822.             enum class EMasks: uint32_t
  5823.             {
  5824.                 MII_RMII_SEL           = (0x1U << 23),
  5825.             };
  5826.             static inline uint32_t get() { return reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->PMC; }
  5827.             static inline void set(uint32_t value) { reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->PMC = value; }
  5828.             template <EMasks ... flags>
  5829.             static inline void set_flags()
  5830.             {
  5831.                 reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->PMC |= SetBits<(std::uint32_t)flags...>();
  5832.             }
  5833.             template <EMasks ... flags>
  5834.             static inline void clear_flags()
  5835.             {
  5836.                 reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->PMC &= ~(SetBits<(std::uint32_t)flags...>());
  5837.             }
  5838.             template <EMasks ... flags>
  5839.             static inline bool get_flags()
  5840.             {
  5841.                 return ((reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->PMC & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5842.             }
  5843.         };
  5844.         class EXTICR
  5845.         {
  5846.         private:
  5847.             union EXTICR_t
  5848.             {
  5849.                 struct
  5850.                 {
  5851.                     uint32_t EXTI0          : 4;
  5852.                     uint32_t EXTI1          : 4;
  5853.                     uint32_t EXTI2          : 4;
  5854.                     uint32_t EXTI3          : 4;
  5855.                     uint32_t EXTI4          : 4;
  5856.                     uint32_t EXTI5          : 4;
  5857.                     uint32_t EXTI6          : 4;
  5858.                     uint32_t EXTI7          : 4;
  5859.                     uint32_t EXTI8          : 4;
  5860.                     uint32_t EXTI9          : 4;
  5861.                     uint32_t EXTI10         : 4;
  5862.                     uint32_t EXTI11         : 4;
  5863.                     uint32_t EXTI12         : 4;
  5864.                     uint32_t EXTI13         : 4;
  5865.                     uint32_t EXTI14         : 4;
  5866.                     uint32_t EXTI15         : 4;
  5867.                 };
  5868.                 uint32_t RAW;
  5869.             };
  5870.         public:
  5871.             enum class EMasks: uint32_t
  5872.             {
  5873.                 EXTI0                  = (0xFU << 0),
  5874.                 EXTI1                  = (0xFU << 4),
  5875.                 EXTI2                  = (0xFU << 8),
  5876.                 EXTI3                  = (0xFU << 12),
  5877.                 EXTI4                  = (0xFU << 0),
  5878.                 EXTI5                  = (0xFU << 4),
  5879.                 EXTI6                  = (0xFU << 8),
  5880.                 EXTI7                  = (0xFU << 12),
  5881.                 EXTI8                  = (0xFU << 0),
  5882.                 EXTI9                  = (0xFU << 4),
  5883.                 EXTI10                 = (0xFU << 8),
  5884.                 EXTI11                 = (0xFU << 12),
  5885.                 EXTI12                 = (0xFU << 0),
  5886.                 EXTI13                 = (0xFU << 4),
  5887.                 EXTI14                 = (0xFU << 8),
  5888.                 EXTI15                 = (0xFU << 12),
  5889.             };
  5890.             static inline uint32_t get(uint32_t idx) { return reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx]; }
  5891.             static inline void set(uint32_t idx, uint32_t value) { reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx] = value; }
  5892.             static inline uint32_t get_EXTI0(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI0; }
  5893.             static inline void set_EXTI0(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI0 = value; }
  5894.             static inline uint32_t get_EXTI1(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI1; }
  5895.             static inline void set_EXTI1(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI1 = value; }
  5896.             static inline uint32_t get_EXTI2(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI2; }
  5897.             static inline void set_EXTI2(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI2 = value; }
  5898.             static inline uint32_t get_EXTI3(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI3; }
  5899.             static inline void set_EXTI3(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI3 = value; }
  5900.             static inline uint32_t get_EXTI4(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI4; }
  5901.             static inline void set_EXTI4(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI4 = value; }
  5902.             static inline uint32_t get_EXTI5(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI5; }
  5903.             static inline void set_EXTI5(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI5 = value; }
  5904.             static inline uint32_t get_EXTI6(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI6; }
  5905.             static inline void set_EXTI6(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI6 = value; }
  5906.             static inline uint32_t get_EXTI7(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI7; }
  5907.             static inline void set_EXTI7(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI7 = value; }
  5908.             static inline uint32_t get_EXTI8(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI8; }
  5909.             static inline void set_EXTI8(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI8 = value; }
  5910.             static inline uint32_t get_EXTI9(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI9; }
  5911.             static inline void set_EXTI9(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI9 = value; }
  5912.             static inline uint32_t get_EXTI10(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI10; }
  5913.             static inline void set_EXTI10(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI10 = value; }
  5914.             static inline uint32_t get_EXTI11(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI11; }
  5915.             static inline void set_EXTI11(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI11 = value; }
  5916.             static inline uint32_t get_EXTI12(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI12; }
  5917.             static inline void set_EXTI12(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI12 = value; }
  5918.             static inline uint32_t get_EXTI13(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI13; }
  5919.             static inline void set_EXTI13(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI13 = value; }
  5920.             static inline uint32_t get_EXTI14(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI14; }
  5921.             static inline void set_EXTI14(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI14 = value; }
  5922.             static inline uint32_t get_EXTI15(uint32_t idx) { return reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI15; }
  5923.             static inline void set_EXTI15(uint32_t idx, uint32_t value) { reinterpret_cast<__IO EXTICR_t*>(&reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->EXTICR[idx])->EXTI15 = value; }
  5924.         };
  5925.         class CMPCR
  5926.         {
  5927.         private:
  5928.             union CMPCR_t
  5929.             {
  5930.                 struct
  5931.                 {
  5932.                     uint32_t CMP_PD         : 1;
  5933.                     uint32_t reserved1      : 1;
  5934.                     uint32_t reserved2      : 1;
  5935.                     uint32_t reserved3      : 1;
  5936.                     uint32_t reserved4      : 1;
  5937.                     uint32_t reserved5      : 1;
  5938.                     uint32_t reserved6      : 1;
  5939.                     uint32_t reserved7      : 1;
  5940.                     uint32_t READY          : 1;
  5941.                     uint32_t reserved9      : 23;
  5942.                 };
  5943.                 uint32_t RAW;
  5944.             };
  5945.         public:
  5946.             enum class EMasks: uint32_t
  5947.             {
  5948.                 CMP_PD                 = (0x1U << 0),
  5949.                 READY                  = (0x1U << 8),
  5950.             };
  5951.             static inline uint32_t get() { return reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->CMPCR; }
  5952.             static inline void set(uint32_t value) { reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->CMPCR = value; }
  5953.             template <EMasks ... flags>
  5954.             static inline void set_flags()
  5955.             {
  5956.                 reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->CMPCR |= SetBits<(std::uint32_t)flags...>();
  5957.             }
  5958.             template <EMasks ... flags>
  5959.             static inline void clear_flags()
  5960.             {
  5961.                 reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->CMPCR &= ~(SetBits<(std::uint32_t)flags...>());
  5962.             }
  5963.             template <EMasks ... flags>
  5964.             static inline bool get_flags()
  5965.             {
  5966.                 return ((reinterpret_cast<SYSCFG_t*>(STM32::SYSCFG_BASE)->CMPCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  5967.             }
  5968.         };
  5969.     };
  5970.     /* I2C DEFINITION */
  5971.     template <uint32_t reg_base>
  5972.     class I2C
  5973.     {
  5974. #warning TODO: I2C
  5975.     };
  5976.     /* IWDG DEFINITION */
  5977.     class IWDG
  5978.     {
  5979.     private:
  5980.         struct IWDG_t
  5981.         {
  5982.             __IO uint32_t                 KR;
  5983.             __IO uint32_t                 PR;
  5984.             __IO uint32_t                 RLR;
  5985.             __IO uint32_t                 SR;
  5986.         };
  5987.     public:
  5988.         class KR
  5989.         {
  5990.         private:
  5991.             union KR_t
  5992.             {
  5993.                 struct
  5994.                 {
  5995.                     uint32_t KEY            : 16;
  5996.                     uint32_t reserved16     : 16;
  5997.                 };
  5998.                 uint32_t RAW;
  5999.             };
  6000.         public:
  6001.             enum class EMasks: uint32_t
  6002.             {
  6003.                 KEY                    = (0xFFFFU << 0),
  6004.             };
  6005.             static inline uint32_t get() { return reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->KR; }
  6006.             static inline void set(uint32_t value) { reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->KR = value; }
  6007.             static inline uint32_t get_KEY() { return reinterpret_cast<__IO KR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->KR)->KEY; }
  6008.             static inline void set_KEY(uint32_t value) { reinterpret_cast<__IO KR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->KR)->KEY = value; }
  6009.         };
  6010.         class PR
  6011.         {
  6012.         private:
  6013.             union PR_t
  6014.             {
  6015.                 struct
  6016.                 {
  6017.                     uint32_t PR             : 3;
  6018.                     uint32_t reserved3      : 29;
  6019.                 };
  6020.                 uint32_t RAW;
  6021.             };
  6022.         public:
  6023.             enum class EMasks: uint32_t
  6024.             {
  6025.                 PR                     = (0x7U << 0),
  6026.             };
  6027.             static inline uint32_t get() { return reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->PR; }
  6028.             static inline void set(uint32_t value) { reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->PR = value; }
  6029.             static inline uint32_t get_PR() { return reinterpret_cast<__IO PR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->PR)->PR; }
  6030.             static inline void set_PR(uint32_t value) { reinterpret_cast<__IO PR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->PR)->PR = value; }
  6031.         };
  6032.         class RLR
  6033.         {
  6034.         private:
  6035.             union RLR_t
  6036.             {
  6037.                 struct
  6038.                 {
  6039.                     uint32_t RL             : 12;
  6040.                     uint32_t reserved12     : 20;
  6041.                 };
  6042.                 uint32_t RAW;
  6043.             };
  6044.         public:
  6045.             enum class EMasks: uint32_t
  6046.             {
  6047.                 RL                     = (0xFFFU << 0),
  6048.             };
  6049.             static inline uint32_t get() { return reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->RLR; }
  6050.             static inline void set(uint32_t value) { reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->RLR = value; }
  6051.             static inline uint32_t get_RL() { return reinterpret_cast<__IO RLR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->RLR)->RL; }
  6052.             static inline void set_RL(uint32_t value) { reinterpret_cast<__IO RLR_t*>(&reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->RLR)->RL = value; }
  6053.         };
  6054.         class SR
  6055.         {
  6056.         private:
  6057.             union SR_t
  6058.             {
  6059.                 struct
  6060.                 {
  6061.                     uint32_t PVU            : 1;
  6062.                     uint32_t RVU            : 1;
  6063.                     uint32_t reserved2      : 30;
  6064.                 };
  6065.                 uint32_t RAW;
  6066.             };
  6067.         public:
  6068.             enum class EMasks: uint32_t
  6069.             {
  6070.                 PVU                    = (0x1U << 0),
  6071.                 RVU                    = (0x1U << 1),
  6072.             };
  6073.             static inline uint32_t get() { return reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->SR; }
  6074.             static inline void set(uint32_t value) { reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->SR = value; }
  6075.             template <EMasks ... flags>
  6076.             static inline void set_flags()
  6077.             {
  6078.                 reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  6079.             }
  6080.             template <EMasks ... flags>
  6081.             static inline void clear_flags()
  6082.             {
  6083.                 reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  6084.             }
  6085.             template <EMasks ... flags>
  6086.             static inline bool get_flags()
  6087.             {
  6088.                 return ((reinterpret_cast<IWDG_t*>(STM32::IWDG_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6089.             }
  6090.         };
  6091.     };
  6092.     /* PWR DEFINITION */
  6093.     class PWR
  6094.     {
  6095.     private:
  6096.         struct PWR_t
  6097.         {
  6098.             __IO uint32_t                 CR;
  6099.             __IO uint32_t                 CSR;
  6100.         };
  6101.     public:
  6102.         class CR
  6103.         {
  6104.         private:
  6105.             union CR_t
  6106.             {
  6107.                 struct
  6108.                 {
  6109.                     uint32_t LPDS           : 1;
  6110.                     uint32_t PDDS           : 1;
  6111.                     uint32_t CWUF           : 1;
  6112.                     uint32_t CSBF           : 1;
  6113.                     uint32_t PVDE           : 1;
  6114.                     uint32_t PLS            : 3;
  6115.                     uint32_t DBP            : 1;
  6116.                     uint32_t FPDS           : 1;
  6117.                     uint32_t reserved10     : 1;
  6118.                     uint32_t reserved11     : 1;
  6119.                     uint32_t reserved12     : 1;
  6120.                     uint32_t reserved13     : 1;
  6121.                     uint32_t VOS            : 1;
  6122.                     uint32_t reserved15     : 17;
  6123.                 };
  6124.                 uint32_t RAW;
  6125.             };
  6126.         public:
  6127.             enum class EMasks: uint32_t
  6128.             {
  6129.                 LPDS                   = (0x1U << 0),
  6130.                 PDDS                   = (0x1U << 1),
  6131.                 CWUF                   = (0x1U << 2),
  6132.                 CSBF                   = (0x1U << 3),
  6133.                 PVDE                   = (0x1U << 4),
  6134.                 PLS                    = (0x7U << 5),
  6135.                 DBP                    = (0x1U << 8),
  6136.                 FPDS                   = (0x1U << 9),
  6137.                 VOS                    = (0x1U << 14),
  6138.             };
  6139.             static inline uint32_t get() { return reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR; }
  6140.             static inline void set(uint32_t value) { reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR = value; }
  6141.             template <EMasks ... flags>
  6142.             static inline void set_flags()
  6143.             {
  6144.                 reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  6145.             }
  6146.             template <EMasks ... flags>
  6147.             static inline void clear_flags()
  6148.             {
  6149.                 reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  6150.             }
  6151.             template <EMasks ... flags>
  6152.             static inline bool get_flags()
  6153.             {
  6154.                 return ((reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6155.             }
  6156.             static inline uint32_t get_PLS() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR)->PLS; }
  6157.             static inline void set_PLS(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CR)->PLS = value; }
  6158.         };
  6159.         class CSR
  6160.         {
  6161.         private:
  6162.             union CSR_t
  6163.             {
  6164.                 struct
  6165.                 {
  6166.                     uint32_t reserved0      : 32;
  6167.                 };
  6168.                 uint32_t RAW;
  6169.             };
  6170.         public:
  6171.             static inline uint32_t get() { return reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CSR; }
  6172.             static inline void set(uint32_t value) { reinterpret_cast<PWR_t*>(STM32::PWR_BASE)->CSR = value; }
  6173.         };
  6174.     };
  6175.     /* RCC DEFINITION */
  6176.     class RCC
  6177.     {
  6178.     private:
  6179.         struct RCC_t
  6180.         {
  6181.             __IO uint32_t                 CR;
  6182.             __IO uint32_t                 PLLCFGR;
  6183.             __IO uint32_t                 CFGR;
  6184.             __IO uint32_t                 CIR;
  6185.             __IO uint32_t                 AHB1RSTR;
  6186.             __IO uint32_t                 AHB2RSTR;
  6187.             __IO uint32_t                 AHB3RSTR;
  6188.             uint32_t                      RESERVED0;
  6189.             __IO uint32_t                 APB1RSTR;
  6190.             __IO uint32_t                 APB2RSTR;
  6191.             uint32_t                      RESERVED1[2];
  6192.             __IO uint32_t                 AHB1ENR;
  6193.             __IO uint32_t                 AHB2ENR;
  6194.             __IO uint32_t                 AHB3ENR;
  6195.             uint32_t                      RESERVED2;
  6196.             __IO uint32_t                 APB1ENR;
  6197.             __IO uint32_t                 APB2ENR;
  6198.             uint32_t                      RESERVED3[2];
  6199.             __IO uint32_t                 AHB1LPENR;
  6200.             __IO uint32_t                 AHB2LPENR;
  6201.             __IO uint32_t                 AHB3LPENR;
  6202.             uint32_t                      RESERVED4;
  6203.             __IO uint32_t                 APB1LPENR;
  6204.             __IO uint32_t                 APB2LPENR;
  6205.             uint32_t                      RESERVED5[2];
  6206.             __IO uint32_t                 BDCR;
  6207.             __IO uint32_t                 CSR;
  6208.             uint32_t                      RESERVED6[2];
  6209.             __IO uint32_t                 SSCGR;
  6210.             __IO uint32_t                 PLLI2SCFGR;
  6211.         };
  6212.     public:
  6213.         class CR
  6214.         {
  6215.         private:
  6216.             union CR_t
  6217.             {
  6218.                 struct
  6219.                 {
  6220.                     uint32_t HSION          : 1;
  6221.                     uint32_t HSIRDY         : 1;
  6222.                     uint32_t reserved2      : 1;
  6223.                     uint32_t HSITRIM        : 5;
  6224.                     uint32_t HSICAL         : 8;
  6225.                     uint32_t HSEON          : 1;
  6226.                     uint32_t HSERDY         : 1;
  6227.                     uint32_t HSEBYP         : 1;
  6228.                     uint32_t CSSON          : 1;
  6229.                     uint32_t reserved20     : 1;
  6230.                     uint32_t reserved21     : 1;
  6231.                     uint32_t reserved22     : 1;
  6232.                     uint32_t reserved23     : 1;
  6233.                     uint32_t PLLON          : 1;
  6234.                     uint32_t PLLRDY         : 1;
  6235.                     uint32_t PLLI2SON       : 1;
  6236.                     uint32_t PLLI2SRDY      : 1;
  6237.                     uint32_t reserved28     : 4;
  6238.                 };
  6239.                 uint32_t RAW;
  6240.             };
  6241.         public:
  6242.             enum class EMasks: uint32_t
  6243.             {
  6244.                 HSION                  = (0x1U << 0),
  6245.                 HSIRDY                 = (0x1U << 1),
  6246.                 HSITRIM                = (0x1FU << 3),
  6247.                 HSICAL                 = (0xFFU << 8),
  6248.                 HSEON                  = (0x1U << 16),
  6249.                 HSERDY                 = (0x1U << 17),
  6250.                 HSEBYP                 = (0x1U << 18),
  6251.                 CSSON                  = (0x1U << 19),
  6252.                 PLLON                  = (0x1U << 24),
  6253.                 PLLRDY                 = (0x1U << 25),
  6254.                 PLLI2SON               = (0x1U << 26),
  6255.                 PLLI2SRDY              = (0x1U << 27),
  6256.             };
  6257.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR; }
  6258.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR = value; }
  6259.             template <EMasks ... flags>
  6260.             static inline void set_flags()
  6261.             {
  6262.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  6263.             }
  6264.             template <EMasks ... flags>
  6265.             static inline void clear_flags()
  6266.             {
  6267.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  6268.             }
  6269.             template <EMasks ... flags>
  6270.             static inline bool get_flags()
  6271.             {
  6272.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6273.             }
  6274.             static inline uint32_t get_HSITRIM() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR)->HSITRIM; }
  6275.             static inline void set_HSITRIM(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR)->HSITRIM = value; }
  6276.             static inline uint32_t get_HSICAL() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR)->HSICAL; }
  6277.             static inline void set_HSICAL(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CR)->HSICAL = value; }
  6278.         };
  6279.         class PLLCFGR
  6280.         {
  6281.         private:
  6282.             union PLLCFGR_t
  6283.             {
  6284.                 struct
  6285.                 {
  6286.                     uint32_t PLLM           : 6;
  6287.                     uint32_t PLLN           : 9;
  6288.                     uint32_t reserved15     : 1;
  6289.                     uint32_t PLLP           : 2;
  6290.                     uint32_t reserved18     : 1;
  6291.                     uint32_t reserved19     : 1;
  6292.                     uint32_t reserved20     : 1;
  6293.                     uint32_t reserved21     : 1;
  6294.                     uint32_t PLLSRC         : 1;
  6295.                     uint32_t PLLSRC_HSE     : 1;
  6296.                     uint32_t PLLQ           : 4;
  6297.                     uint32_t reserved28     : 4;
  6298.                 };
  6299.                 uint32_t RAW;
  6300.             };
  6301.         public:
  6302.             enum class EMasks: uint32_t
  6303.             {
  6304.                 PLLM                   = (0x3FU << 0),
  6305.                 PLLN                   = (0x1FFU << 6),
  6306.                 PLLP                   = (0x3U << 16),
  6307.                 PLLSRC                 = (0x1U << 22),
  6308.                 PLLSRC_HSE             = (0x1U << 22),
  6309.                 PLLQ                   = (0xFU << 24),
  6310.             };
  6311.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR; }
  6312.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR = value; }
  6313.             template <EMasks ... flags>
  6314.             static inline void set_flags()
  6315.             {
  6316.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR |= SetBits<(std::uint32_t)flags...>();
  6317.             }
  6318.             template <EMasks ... flags>
  6319.             static inline void clear_flags()
  6320.             {
  6321.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR &= ~(SetBits<(std::uint32_t)flags...>());
  6322.             }
  6323.             template <EMasks ... flags>
  6324.             static inline bool get_flags()
  6325.             {
  6326.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6327.             }
  6328.             static inline uint32_t get_PLLM() { return reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLM; }
  6329.             static inline void set_PLLM(uint32_t value) { reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLM = value; }
  6330.             static inline uint32_t get_PLLN() { return reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLN; }
  6331.             static inline void set_PLLN(uint32_t value) { reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLN = value; }
  6332.             static inline uint32_t get_PLLP() { return reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLP; }
  6333.             static inline void set_PLLP(uint32_t value) { reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLP = value; }
  6334.             static inline uint32_t get_PLLQ() { return reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLQ; }
  6335.             static inline void set_PLLQ(uint32_t value) { reinterpret_cast<__IO PLLCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLCFGR)->PLLQ = value; }
  6336.         };
  6337.         class CFGR
  6338.         {
  6339.         private:
  6340.             union CFGR_t
  6341.             {
  6342.                 struct
  6343.                 {
  6344.                     uint32_t SW             : 2;
  6345.                     uint32_t SWS            : 2;
  6346.                     uint32_t HPRE           : 4;
  6347.                     uint32_t reserved8      : 1;
  6348.                     uint32_t reserved9      : 1;
  6349.                     uint32_t PPRE1          : 3;
  6350.                     uint32_t PPRE2          : 3;
  6351.                     uint32_t RTCPRE         : 5;
  6352.                     uint32_t MCO1           : 2;
  6353.                     uint32_t I2SSRC         : 1;
  6354.                     uint32_t MCO1PRE        : 3;
  6355.                     uint32_t MCO2PRE        : 3;
  6356.                     uint32_t MCO2           : 2;
  6357.                 };
  6358.                 uint32_t RAW;
  6359.             };
  6360.         public:
  6361.             enum class EMasks: uint32_t
  6362.             {
  6363.                 SW                     = (0x3U << 0),
  6364.                 SWS                    = (0x3U << 2),
  6365.                 HPRE                   = (0xFU << 4),
  6366.                 PPRE1                  = (0x7U << 10),
  6367.                 PPRE2                  = (0x7U << 13),
  6368.                 RTCPRE                 = (0x1FU << 16),
  6369.                 MCO1                   = (0x3U << 21),
  6370.                 I2SSRC                 = (0x1U << 23),
  6371.                 MCO1PRE                = (0x7U << 24),
  6372.                 MCO2PRE                = (0x7U << 27),
  6373.                 MCO2                   = (0x3U << 30),
  6374.             };
  6375.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR; }
  6376.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR = value; }
  6377.             template <EMasks ... flags>
  6378.             static inline void set_flags()
  6379.             {
  6380.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR |= SetBits<(std::uint32_t)flags...>();
  6381.             }
  6382.             template <EMasks ... flags>
  6383.             static inline void clear_flags()
  6384.             {
  6385.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR &= ~(SetBits<(std::uint32_t)flags...>());
  6386.             }
  6387.             template <EMasks ... flags>
  6388.             static inline bool get_flags()
  6389.             {
  6390.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6391.             }
  6392.             static inline uint32_t get_SW() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->SW; }
  6393.             static inline void set_SW(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->SW = value; }
  6394.             static inline uint32_t get_SWS() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->SWS; }
  6395.             static inline void set_SWS(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->SWS = value; }
  6396.             static inline uint32_t get_HPRE() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->HPRE; }
  6397.             static inline void set_HPRE(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->HPRE = value; }
  6398.             static inline uint32_t get_PPRE1() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->PPRE1; }
  6399.             static inline void set_PPRE1(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->PPRE1 = value; }
  6400.             static inline uint32_t get_PPRE2() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->PPRE2; }
  6401.             static inline void set_PPRE2(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->PPRE2 = value; }
  6402.             static inline uint32_t get_RTCPRE() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->RTCPRE; }
  6403.             static inline void set_RTCPRE(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->RTCPRE = value; }
  6404.             static inline uint32_t get_MCO1() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO1; }
  6405.             static inline void set_MCO1(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO1 = value; }
  6406.             static inline uint32_t get_MCO1PRE() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO1PRE; }
  6407.             static inline void set_MCO1PRE(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO1PRE = value; }
  6408.             static inline uint32_t get_MCO2PRE() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO2PRE; }
  6409.             static inline void set_MCO2PRE(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO2PRE = value; }
  6410.             static inline uint32_t get_MCO2() { return reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO2; }
  6411.             static inline void set_MCO2(uint32_t value) { reinterpret_cast<__IO CFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CFGR)->MCO2 = value; }
  6412.         };
  6413.         class CIR
  6414.         {
  6415.         private:
  6416.             union CIR_t
  6417.             {
  6418.                 struct
  6419.                 {
  6420.                     uint32_t LSIRDYF        : 1;
  6421.                     uint32_t LSERDYF        : 1;
  6422.                     uint32_t HSIRDYF        : 1;
  6423.                     uint32_t HSERDYF        : 1;
  6424.                     uint32_t PLLRDYF        : 1;
  6425.                     uint32_t PLLI2SRDYF     : 1;
  6426.                     uint32_t reserved6      : 1;
  6427.                     uint32_t CSSF           : 1;
  6428.                     uint32_t LSIRDYIE       : 1;
  6429.                     uint32_t LSERDYIE       : 1;
  6430.                     uint32_t HSIRDYIE       : 1;
  6431.                     uint32_t HSERDYIE       : 1;
  6432.                     uint32_t PLLRDYIE       : 1;
  6433.                     uint32_t PLLI2SRDYIE    : 1;
  6434.                     uint32_t reserved14     : 1;
  6435.                     uint32_t reserved15     : 1;
  6436.                     uint32_t LSIRDYC        : 1;
  6437.                     uint32_t LSERDYC        : 1;
  6438.                     uint32_t HSIRDYC        : 1;
  6439.                     uint32_t HSERDYC        : 1;
  6440.                     uint32_t PLLRDYC        : 1;
  6441.                     uint32_t PLLI2SRDYC     : 1;
  6442.                     uint32_t reserved22     : 1;
  6443.                     uint32_t CSSC           : 1;
  6444.                     uint32_t reserved24     : 8;
  6445.                 };
  6446.                 uint32_t RAW;
  6447.             };
  6448.         public:
  6449.             enum class EMasks: uint32_t
  6450.             {
  6451.                 LSIRDYF                = (0x1U << 0),
  6452.                 LSERDYF                = (0x1U << 1),
  6453.                 HSIRDYF                = (0x1U << 2),
  6454.                 HSERDYF                = (0x1U << 3),
  6455.                 PLLRDYF                = (0x1U << 4),
  6456.                 PLLI2SRDYF             = (0x1U << 5),
  6457.                 CSSF                   = (0x1U << 7),
  6458.                 LSIRDYIE               = (0x1U << 8),
  6459.                 LSERDYIE               = (0x1U << 9),
  6460.                 HSIRDYIE               = (0x1U << 10),
  6461.                 HSERDYIE               = (0x1U << 11),
  6462.                 PLLRDYIE               = (0x1U << 12),
  6463.                 PLLI2SRDYIE            = (0x1U << 13),
  6464.                 LSIRDYC                = (0x1U << 16),
  6465.                 LSERDYC                = (0x1U << 17),
  6466.                 HSIRDYC                = (0x1U << 18),
  6467.                 HSERDYC                = (0x1U << 19),
  6468.                 PLLRDYC                = (0x1U << 20),
  6469.                 PLLI2SRDYC             = (0x1U << 21),
  6470.                 CSSC                   = (0x1U << 23),
  6471.             };
  6472.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CIR; }
  6473.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CIR = value; }
  6474.             template <EMasks ... flags>
  6475.             static inline void set_flags()
  6476.             {
  6477.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CIR |= SetBits<(std::uint32_t)flags...>();
  6478.             }
  6479.             template <EMasks ... flags>
  6480.             static inline void clear_flags()
  6481.             {
  6482.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CIR &= ~(SetBits<(std::uint32_t)flags...>());
  6483.             }
  6484.             template <EMasks ... flags>
  6485.             static inline bool get_flags()
  6486.             {
  6487.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CIR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6488.             }
  6489.         };
  6490.         class AHB1RSTR
  6491.         {
  6492.         private:
  6493.             union AHB1RSTR_t
  6494.             {
  6495.                 struct
  6496.                 {
  6497.                     uint32_t GPIOARST       : 1;
  6498.                     uint32_t GPIOBRST       : 1;
  6499.                     uint32_t GPIOCRST       : 1;
  6500.                     uint32_t GPIODRST       : 1;
  6501.                     uint32_t GPIOERST       : 1;
  6502.                     uint32_t GPIOFRST       : 1;
  6503.                     uint32_t GPIOGRST       : 1;
  6504.                     uint32_t GPIOHRST       : 1;
  6505.                     uint32_t GPIOIRST       : 1;
  6506.                     uint32_t reserved9      : 1;
  6507.                     uint32_t reserved10     : 1;
  6508.                     uint32_t reserved11     : 1;
  6509.                     uint32_t CRCRST         : 1;
  6510.                     uint32_t reserved13     : 1;
  6511.                     uint32_t reserved14     : 1;
  6512.                     uint32_t reserved15     : 1;
  6513.                     uint32_t reserved16     : 1;
  6514.                     uint32_t reserved17     : 1;
  6515.                     uint32_t reserved18     : 1;
  6516.                     uint32_t reserved19     : 1;
  6517.                     uint32_t reserved20     : 1;
  6518.                     uint32_t DMA1RST        : 1;
  6519.                     uint32_t DMA2RST        : 1;
  6520.                     uint32_t reserved23     : 1;
  6521.                     uint32_t reserved24     : 1;
  6522.                     uint32_t ETHMACRST      : 1;
  6523.                     uint32_t reserved26     : 1;
  6524.                     uint32_t reserved27     : 1;
  6525.                     uint32_t reserved28     : 1;
  6526.                     uint32_t OTGHRST        : 1;
  6527.                     uint32_t reserved30     : 2;
  6528.                 };
  6529.                 uint32_t RAW;
  6530.             };
  6531.         public:
  6532.             enum class EMasks: uint32_t
  6533.             {
  6534.                 GPIOARST               = (0x1U << 0),
  6535.                 GPIOBRST               = (0x1U << 1),
  6536.                 GPIOCRST               = (0x1U << 2),
  6537.                 GPIODRST               = (0x1U << 3),
  6538.                 GPIOERST               = (0x1U << 4),
  6539.                 GPIOFRST               = (0x1U << 5),
  6540.                 GPIOGRST               = (0x1U << 6),
  6541.                 GPIOHRST               = (0x1U << 7),
  6542.                 GPIOIRST               = (0x1U << 8),
  6543.                 CRCRST                 = (0x1U << 12),
  6544.                 DMA1RST                = (0x1U << 21),
  6545.                 DMA2RST                = (0x1U << 22),
  6546.                 ETHMACRST              = (0x1U << 25),
  6547.                 OTGHRST                = (0x1U << 29),
  6548.             };
  6549.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1RSTR; }
  6550.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1RSTR = value; }
  6551.             template <EMasks ... flags>
  6552.             static inline void set_flags()
  6553.             {
  6554.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1RSTR |= SetBits<(std::uint32_t)flags...>();
  6555.             }
  6556.             template <EMasks ... flags>
  6557.             static inline void clear_flags()
  6558.             {
  6559.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1RSTR &= ~(SetBits<(std::uint32_t)flags...>());
  6560.             }
  6561.             template <EMasks ... flags>
  6562.             static inline bool get_flags()
  6563.             {
  6564.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1RSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6565.             }
  6566.         };
  6567.         class AHB2RSTR
  6568.         {
  6569.         private:
  6570.             union AHB2RSTR_t
  6571.             {
  6572.                 struct
  6573.                 {
  6574.                     uint32_t DCMIRST        : 1;
  6575.                     uint32_t reserved1      : 1;
  6576.                     uint32_t reserved2      : 1;
  6577.                     uint32_t reserved3      : 1;
  6578.                     uint32_t reserved4      : 1;
  6579.                     uint32_t reserved5      : 1;
  6580.                     uint32_t RNGRST         : 1;
  6581.                     uint32_t OTGFSRST       : 1;
  6582.                     uint32_t reserved8      : 24;
  6583.                 };
  6584.                 uint32_t RAW;
  6585.             };
  6586.         public:
  6587.             enum class EMasks: uint32_t
  6588.             {
  6589.                 DCMIRST                = (0x1U << 0),
  6590.                 RNGRST                 = (0x1U << 6),
  6591.                 OTGFSRST               = (0x1U << 7),
  6592.             };
  6593.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2RSTR; }
  6594.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2RSTR = value; }
  6595.             template <EMasks ... flags>
  6596.             static inline void set_flags()
  6597.             {
  6598.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2RSTR |= SetBits<(std::uint32_t)flags...>();
  6599.             }
  6600.             template <EMasks ... flags>
  6601.             static inline void clear_flags()
  6602.             {
  6603.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2RSTR &= ~(SetBits<(std::uint32_t)flags...>());
  6604.             }
  6605.             template <EMasks ... flags>
  6606.             static inline bool get_flags()
  6607.             {
  6608.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2RSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6609.             }
  6610.         };
  6611.         class AHB3RSTR
  6612.         {
  6613.         private:
  6614.             union AHB3RSTR_t
  6615.             {
  6616.                 struct
  6617.                 {
  6618.                     uint32_t FSMCRST        : 1;
  6619.                     uint32_t reserved1      : 31;
  6620.                 };
  6621.                 uint32_t RAW;
  6622.             };
  6623.         public:
  6624.             enum class EMasks: uint32_t
  6625.             {
  6626.                 FSMCRST                = (0x1U << 0),
  6627.             };
  6628.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3RSTR; }
  6629.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3RSTR = value; }
  6630.             template <EMasks ... flags>
  6631.             static inline void set_flags()
  6632.             {
  6633.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3RSTR |= SetBits<(std::uint32_t)flags...>();
  6634.             }
  6635.             template <EMasks ... flags>
  6636.             static inline void clear_flags()
  6637.             {
  6638.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3RSTR &= ~(SetBits<(std::uint32_t)flags...>());
  6639.             }
  6640.             template <EMasks ... flags>
  6641.             static inline bool get_flags()
  6642.             {
  6643.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3RSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6644.             }
  6645.         };
  6646.         class APB1RSTR
  6647.         {
  6648.         private:
  6649.             union APB1RSTR_t
  6650.             {
  6651.                 struct
  6652.                 {
  6653.                     uint32_t TIM2RST        : 1;
  6654.                     uint32_t TIM3RST        : 1;
  6655.                     uint32_t TIM4RST        : 1;
  6656.                     uint32_t TIM5RST        : 1;
  6657.                     uint32_t TIM6RST        : 1;
  6658.                     uint32_t TIM7RST        : 1;
  6659.                     uint32_t TIM12RST       : 1;
  6660.                     uint32_t TIM13RST       : 1;
  6661.                     uint32_t TIM14RST       : 1;
  6662.                     uint32_t reserved9      : 1;
  6663.                     uint32_t reserved10     : 1;
  6664.                     uint32_t WWDGRST        : 1;
  6665.                     uint32_t reserved12     : 1;
  6666.                     uint32_t reserved13     : 1;
  6667.                     uint32_t SPI2RST        : 1;
  6668.                     uint32_t SPI3RST        : 1;
  6669.                     uint32_t reserved16     : 1;
  6670.                     uint32_t USART2RST      : 1;
  6671.                     uint32_t USART3RST      : 1;
  6672.                     uint32_t UART4RST       : 1;
  6673.                     uint32_t UART5RST       : 1;
  6674.                     uint32_t I2C1RST        : 1;
  6675.                     uint32_t I2C2RST        : 1;
  6676.                     uint32_t I2C3RST        : 1;
  6677.                     uint32_t reserved24     : 1;
  6678.                     uint32_t CAN1RST        : 1;
  6679.                     uint32_t CAN2RST        : 1;
  6680.                     uint32_t reserved27     : 1;
  6681.                     uint32_t PWRRST         : 1;
  6682.                     uint32_t DACRST         : 1;
  6683.                     uint32_t reserved30     : 2;
  6684.                 };
  6685.                 uint32_t RAW;
  6686.             };
  6687.         public:
  6688.             enum class EMasks: uint32_t
  6689.             {
  6690.                 TIM2RST                = (0x1U << 0),
  6691.                 TIM3RST                = (0x1U << 1),
  6692.                 TIM4RST                = (0x1U << 2),
  6693.                 TIM5RST                = (0x1U << 3),
  6694.                 TIM6RST                = (0x1U << 4),
  6695.                 TIM7RST                = (0x1U << 5),
  6696.                 TIM12RST               = (0x1U << 6),
  6697.                 TIM13RST               = (0x1U << 7),
  6698.                 TIM14RST               = (0x1U << 8),
  6699.                 WWDGRST                = (0x1U << 11),
  6700.                 SPI2RST                = (0x1U << 14),
  6701.                 SPI3RST                = (0x1U << 15),
  6702.                 USART2RST              = (0x1U << 17),
  6703.                 USART3RST              = (0x1U << 18),
  6704.                 UART4RST               = (0x1U << 19),
  6705.                 UART5RST               = (0x1U << 20),
  6706.                 I2C1RST                = (0x1U << 21),
  6707.                 I2C2RST                = (0x1U << 22),
  6708.                 I2C3RST                = (0x1U << 23),
  6709.                 CAN1RST                = (0x1U << 25),
  6710.                 CAN2RST                = (0x1U << 26),
  6711.                 PWRRST                 = (0x1U << 28),
  6712.                 DACRST                 = (0x1U << 29),
  6713.             };
  6714.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1RSTR; }
  6715.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1RSTR = value; }
  6716.             template <EMasks ... flags>
  6717.             static inline void set_flags()
  6718.             {
  6719.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1RSTR |= SetBits<(std::uint32_t)flags...>();
  6720.             }
  6721.             template <EMasks ... flags>
  6722.             static inline void clear_flags()
  6723.             {
  6724.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1RSTR &= ~(SetBits<(std::uint32_t)flags...>());
  6725.             }
  6726.             template <EMasks ... flags>
  6727.             static inline bool get_flags()
  6728.             {
  6729.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1RSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6730.             }
  6731.         };
  6732.         class APB2RSTR
  6733.         {
  6734.         private:
  6735.             union APB2RSTR_t
  6736.             {
  6737.                 struct
  6738.                 {
  6739.                     uint32_t TIM1RST        : 1;
  6740.                     uint32_t TIM8RST        : 1;
  6741.                     uint32_t reserved2      : 1;
  6742.                     uint32_t reserved3      : 1;
  6743.                     uint32_t USART1RST      : 1;
  6744.                     uint32_t USART6RST      : 1;
  6745.                     uint32_t reserved6      : 1;
  6746.                     uint32_t reserved7      : 1;
  6747.                     uint32_t ADCRST         : 1;
  6748.                     uint32_t reserved9      : 1;
  6749.                     uint32_t reserved10     : 1;
  6750.                     uint32_t SDIORST        : 1;
  6751.                     uint32_t SPI1RST        : 1;
  6752.                     uint32_t reserved13     : 1;
  6753.                     uint32_t SYSCFGRST      : 1;
  6754.                     uint32_t reserved15     : 1;
  6755.                     uint32_t TIM9RST        : 1;
  6756.                     uint32_t TIM10RST       : 1;
  6757.                     uint32_t TIM11RST       : 1;
  6758.                     uint32_t reserved19     : 13;
  6759.                 };
  6760.                 uint32_t RAW;
  6761.             };
  6762.         public:
  6763.             enum class EMasks: uint32_t
  6764.             {
  6765.                 TIM1RST                = (0x1U << 0),
  6766.                 TIM8RST                = (0x1U << 1),
  6767.                 USART1RST              = (0x1U << 4),
  6768.                 USART6RST              = (0x1U << 5),
  6769.                 ADCRST                 = (0x1U << 8),
  6770.                 SDIORST                = (0x1U << 11),
  6771.                 SPI1RST                = (0x1U << 12),
  6772.                 SYSCFGRST              = (0x1U << 14),
  6773.                 TIM9RST                = (0x1U << 16),
  6774.                 TIM10RST               = (0x1U << 17),
  6775.                 TIM11RST               = (0x1U << 18),
  6776.             };
  6777.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2RSTR; }
  6778.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2RSTR = value; }
  6779.             template <EMasks ... flags>
  6780.             static inline void set_flags()
  6781.             {
  6782.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2RSTR |= SetBits<(std::uint32_t)flags...>();
  6783.             }
  6784.             template <EMasks ... flags>
  6785.             static inline void clear_flags()
  6786.             {
  6787.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2RSTR &= ~(SetBits<(std::uint32_t)flags...>());
  6788.             }
  6789.             template <EMasks ... flags>
  6790.             static inline bool get_flags()
  6791.             {
  6792.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2RSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6793.             }
  6794.         };
  6795.         class AHB1ENR
  6796.         {
  6797.         private:
  6798.             union AHB1ENR_t
  6799.             {
  6800.                 struct
  6801.                 {
  6802.                     uint32_t GPIOAEN        : 1;
  6803.                     uint32_t GPIOBEN        : 1;
  6804.                     uint32_t GPIOCEN        : 1;
  6805.                     uint32_t GPIODEN        : 1;
  6806.                     uint32_t GPIOEEN        : 1;
  6807.                     uint32_t GPIOFEN        : 1;
  6808.                     uint32_t GPIOGEN        : 1;
  6809.                     uint32_t GPIOHEN        : 1;
  6810.                     uint32_t GPIOIEN        : 1;
  6811.                     uint32_t reserved9      : 1;
  6812.                     uint32_t reserved10     : 1;
  6813.                     uint32_t reserved11     : 1;
  6814.                     uint32_t CRCEN          : 1;
  6815.                     uint32_t reserved13     : 1;
  6816.                     uint32_t reserved14     : 1;
  6817.                     uint32_t reserved15     : 1;
  6818.                     uint32_t reserved16     : 1;
  6819.                     uint32_t reserved17     : 1;
  6820.                     uint32_t BKPSRAMEN      : 1;
  6821.                     uint32_t reserved19     : 1;
  6822.                     uint32_t CCMDATARAMEN   : 1;
  6823.                     uint32_t DMA1EN         : 1;
  6824.                     uint32_t DMA2EN         : 1;
  6825.                     uint32_t reserved23     : 1;
  6826.                     uint32_t reserved24     : 1;
  6827.                     uint32_t ETHMACEN       : 1;
  6828.                     uint32_t ETHMACTXEN     : 1;
  6829.                     uint32_t ETHMACRXEN     : 1;
  6830.                     uint32_t ETHMACPTPEN    : 1;
  6831.                     uint32_t OTGHSEN        : 1;
  6832.                     uint32_t OTGHSULPIEN    : 1;
  6833.                     uint32_t reserved31     : 1;
  6834.                 };
  6835.                 uint32_t RAW;
  6836.             };
  6837.         public:
  6838.             enum class EMasks: uint32_t
  6839.             {
  6840.                 GPIOAEN                = (0x1U << 0),
  6841.                 GPIOBEN                = (0x1U << 1),
  6842.                 GPIOCEN                = (0x1U << 2),
  6843.                 GPIODEN                = (0x1U << 3),
  6844.                 GPIOEEN                = (0x1U << 4),
  6845.                 GPIOFEN                = (0x1U << 5),
  6846.                 GPIOGEN                = (0x1U << 6),
  6847.                 GPIOHEN                = (0x1U << 7),
  6848.                 GPIOIEN                = (0x1U << 8),
  6849.                 CRCEN                  = (0x1U << 12),
  6850.                 BKPSRAMEN              = (0x1U << 18),
  6851.                 CCMDATARAMEN           = (0x1U << 20),
  6852.                 DMA1EN                 = (0x1U << 21),
  6853.                 DMA2EN                 = (0x1U << 22),
  6854.                 ETHMACEN               = (0x1U << 25),
  6855.                 ETHMACTXEN             = (0x1U << 26),
  6856.                 ETHMACRXEN             = (0x1U << 27),
  6857.                 ETHMACPTPEN            = (0x1U << 28),
  6858.                 OTGHSEN                = (0x1U << 29),
  6859.                 OTGHSULPIEN            = (0x1U << 30),
  6860.             };
  6861.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1ENR; }
  6862.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1ENR = value; }
  6863.             template <EMasks ... flags>
  6864.             static inline void set_flags()
  6865.             {
  6866.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1ENR |= SetBits<(std::uint32_t)flags...>();
  6867.             }
  6868.             template <EMasks ... flags>
  6869.             static inline void clear_flags()
  6870.             {
  6871.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1ENR &= ~(SetBits<(std::uint32_t)flags...>());
  6872.             }
  6873.             template <EMasks ... flags>
  6874.             static inline bool get_flags()
  6875.             {
  6876.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1ENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6877.             }
  6878.         };
  6879.         class AHB2ENR
  6880.         {
  6881.         private:
  6882.             union AHB2ENR_t
  6883.             {
  6884.                 struct
  6885.                 {
  6886.                     uint32_t DCMIEN         : 1;
  6887.                     uint32_t reserved1      : 1;
  6888.                     uint32_t reserved2      : 1;
  6889.                     uint32_t reserved3      : 1;
  6890.                     uint32_t reserved4      : 1;
  6891.                     uint32_t reserved5      : 1;
  6892.                     uint32_t RNGEN          : 1;
  6893.                     uint32_t OTGFSEN        : 1;
  6894.                     uint32_t reserved8      : 24;
  6895.                 };
  6896.                 uint32_t RAW;
  6897.             };
  6898.         public:
  6899.             enum class EMasks: uint32_t
  6900.             {
  6901.                 DCMIEN                 = (0x1U << 0),
  6902.                 RNGEN                  = (0x1U << 6),
  6903.                 OTGFSEN                = (0x1U << 7),
  6904.             };
  6905.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2ENR; }
  6906.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2ENR = value; }
  6907.             template <EMasks ... flags>
  6908.             static inline void set_flags()
  6909.             {
  6910.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2ENR |= SetBits<(std::uint32_t)flags...>();
  6911.             }
  6912.             template <EMasks ... flags>
  6913.             static inline void clear_flags()
  6914.             {
  6915.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2ENR &= ~(SetBits<(std::uint32_t)flags...>());
  6916.             }
  6917.             template <EMasks ... flags>
  6918.             static inline bool get_flags()
  6919.             {
  6920.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2ENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6921.             }
  6922.         };
  6923.         class AHB3ENR
  6924.         {
  6925.         private:
  6926.             union AHB3ENR_t
  6927.             {
  6928.                 struct
  6929.                 {
  6930.                     uint32_t FSMCEN         : 1;
  6931.                     uint32_t reserved1      : 31;
  6932.                 };
  6933.                 uint32_t RAW;
  6934.             };
  6935.         public:
  6936.             enum class EMasks: uint32_t
  6937.             {
  6938.                 FSMCEN                 = (0x1U << 0),
  6939.             };
  6940.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3ENR; }
  6941.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3ENR = value; }
  6942.             template <EMasks ... flags>
  6943.             static inline void set_flags()
  6944.             {
  6945.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3ENR |= SetBits<(std::uint32_t)flags...>();
  6946.             }
  6947.             template <EMasks ... flags>
  6948.             static inline void clear_flags()
  6949.             {
  6950.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3ENR &= ~(SetBits<(std::uint32_t)flags...>());
  6951.             }
  6952.             template <EMasks ... flags>
  6953.             static inline bool get_flags()
  6954.             {
  6955.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3ENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  6956.             }
  6957.         };
  6958.         class APB1ENR
  6959.         {
  6960.         private:
  6961.             union APB1ENR_t
  6962.             {
  6963.                 struct
  6964.                 {
  6965.                     uint32_t TIM2EN         : 1;
  6966.                     uint32_t TIM3EN         : 1;
  6967.                     uint32_t TIM4EN         : 1;
  6968.                     uint32_t TIM5EN         : 1;
  6969.                     uint32_t TIM6EN         : 1;
  6970.                     uint32_t TIM7EN         : 1;
  6971.                     uint32_t TIM12EN        : 1;
  6972.                     uint32_t TIM13EN        : 1;
  6973.                     uint32_t TIM14EN        : 1;
  6974.                     uint32_t reserved9      : 1;
  6975.                     uint32_t reserved10     : 1;
  6976.                     uint32_t WWDGEN         : 1;
  6977.                     uint32_t reserved12     : 1;
  6978.                     uint32_t reserved13     : 1;
  6979.                     uint32_t SPI2EN         : 1;
  6980.                     uint32_t SPI3EN         : 1;
  6981.                     uint32_t reserved16     : 1;
  6982.                     uint32_t USART2EN       : 1;
  6983.                     uint32_t USART3EN       : 1;
  6984.                     uint32_t UART4EN        : 1;
  6985.                     uint32_t UART5EN        : 1;
  6986.                     uint32_t I2C1EN         : 1;
  6987.                     uint32_t I2C2EN         : 1;
  6988.                     uint32_t I2C3EN         : 1;
  6989.                     uint32_t reserved24     : 1;
  6990.                     uint32_t CAN1EN         : 1;
  6991.                     uint32_t CAN2EN         : 1;
  6992.                     uint32_t reserved27     : 1;
  6993.                     uint32_t PWREN          : 1;
  6994.                     uint32_t DACEN          : 1;
  6995.                     uint32_t reserved30     : 2;
  6996.                 };
  6997.                 uint32_t RAW;
  6998.             };
  6999.         public:
  7000.             enum class EMasks: uint32_t
  7001.             {
  7002.                 TIM2EN                 = (0x1U << 0),
  7003.                 TIM3EN                 = (0x1U << 1),
  7004.                 TIM4EN                 = (0x1U << 2),
  7005.                 TIM5EN                 = (0x1U << 3),
  7006.                 TIM6EN                 = (0x1U << 4),
  7007.                 TIM7EN                 = (0x1U << 5),
  7008.                 TIM12EN                = (0x1U << 6),
  7009.                 TIM13EN                = (0x1U << 7),
  7010.                 TIM14EN                = (0x1U << 8),
  7011.                 WWDGEN                 = (0x1U << 11),
  7012.                 SPI2EN                 = (0x1U << 14),
  7013.                 SPI3EN                 = (0x1U << 15),
  7014.                 USART2EN               = (0x1U << 17),
  7015.                 USART3EN               = (0x1U << 18),
  7016.                 UART4EN                = (0x1U << 19),
  7017.                 UART5EN                = (0x1U << 20),
  7018.                 I2C1EN                 = (0x1U << 21),
  7019.                 I2C2EN                 = (0x1U << 22),
  7020.                 I2C3EN                 = (0x1U << 23),
  7021.                 CAN1EN                 = (0x1U << 25),
  7022.                 CAN2EN                 = (0x1U << 26),
  7023.                 PWREN                  = (0x1U << 28),
  7024.                 DACEN                  = (0x1U << 29),
  7025.             };
  7026.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1ENR; }
  7027.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1ENR = value; }
  7028.             template <EMasks ... flags>
  7029.             static inline void set_flags()
  7030.             {
  7031.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1ENR |= SetBits<(std::uint32_t)flags...>();
  7032.             }
  7033.             template <EMasks ... flags>
  7034.             static inline void clear_flags()
  7035.             {
  7036.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1ENR &= ~(SetBits<(std::uint32_t)flags...>());
  7037.             }
  7038.             template <EMasks ... flags>
  7039.             static inline bool get_flags()
  7040.             {
  7041.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1ENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7042.             }
  7043.         };
  7044.         class APB2ENR
  7045.         {
  7046.         private:
  7047.             union APB2ENR_t
  7048.             {
  7049.                 struct
  7050.                 {
  7051.                     uint32_t TIM1EN         : 1;
  7052.                     uint32_t TIM8EN         : 1;
  7053.                     uint32_t reserved2      : 1;
  7054.                     uint32_t reserved3      : 1;
  7055.                     uint32_t USART1EN       : 1;
  7056.                     uint32_t USART6EN       : 1;
  7057.                     uint32_t reserved6      : 1;
  7058.                     uint32_t reserved7      : 1;
  7059.                     uint32_t ADC1EN         : 1;
  7060.                     uint32_t ADC2EN         : 1;
  7061.                     uint32_t ADC3EN         : 1;
  7062.                     uint32_t SDIOEN         : 1;
  7063.                     uint32_t SPI1EN         : 1;
  7064.                     uint32_t reserved13     : 1;
  7065.                     uint32_t SYSCFGEN       : 1;
  7066.                     uint32_t reserved15     : 1;
  7067.                     uint32_t TIM9EN         : 1;
  7068.                     uint32_t TIM10EN        : 1;
  7069.                     uint32_t TIM11EN        : 1;
  7070.                     uint32_t reserved19     : 13;
  7071.                 };
  7072.                 uint32_t RAW;
  7073.             };
  7074.         public:
  7075.             enum class EMasks: uint32_t
  7076.             {
  7077.                 TIM1EN                 = (0x1U << 0),
  7078.                 TIM8EN                 = (0x1U << 1),
  7079.                 USART1EN               = (0x1U << 4),
  7080.                 USART6EN               = (0x1U << 5),
  7081.                 ADC1EN                 = (0x1U << 8),
  7082.                 ADC2EN                 = (0x1U << 9),
  7083.                 ADC3EN                 = (0x1U << 10),
  7084.                 SDIOEN                 = (0x1U << 11),
  7085.                 SPI1EN                 = (0x1U << 12),
  7086.                 SYSCFGEN               = (0x1U << 14),
  7087.                 TIM9EN                 = (0x1U << 16),
  7088.                 TIM10EN                = (0x1U << 17),
  7089.                 TIM11EN                = (0x1U << 18),
  7090.             };
  7091.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2ENR; }
  7092.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2ENR = value; }
  7093.             template <EMasks ... flags>
  7094.             static inline void set_flags()
  7095.             {
  7096.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2ENR |= SetBits<(std::uint32_t)flags...>();
  7097.             }
  7098.             template <EMasks ... flags>
  7099.             static inline void clear_flags()
  7100.             {
  7101.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2ENR &= ~(SetBits<(std::uint32_t)flags...>());
  7102.             }
  7103.             template <EMasks ... flags>
  7104.             static inline bool get_flags()
  7105.             {
  7106.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2ENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7107.             }
  7108.         };
  7109.         class AHB1LPENR
  7110.         {
  7111.         private:
  7112.             union AHB1LPENR_t
  7113.             {
  7114.                 struct
  7115.                 {
  7116.                     uint32_t GPIOALPEN      : 1;
  7117.                     uint32_t GPIOBLPEN      : 1;
  7118.                     uint32_t GPIOCLPEN      : 1;
  7119.                     uint32_t GPIODLPEN      : 1;
  7120.                     uint32_t GPIOELPEN      : 1;
  7121.                     uint32_t GPIOFLPEN      : 1;
  7122.                     uint32_t GPIOGLPEN      : 1;
  7123.                     uint32_t GPIOHLPEN      : 1;
  7124.                     uint32_t GPIOILPEN      : 1;
  7125.                     uint32_t reserved9      : 1;
  7126.                     uint32_t reserved10     : 1;
  7127.                     uint32_t reserved11     : 1;
  7128.                     uint32_t CRCLPEN        : 1;
  7129.                     uint32_t reserved13     : 1;
  7130.                     uint32_t reserved14     : 1;
  7131.                     uint32_t FLITFLPEN      : 1;
  7132.                     uint32_t SRAM1LPEN      : 1;
  7133.                     uint32_t SRAM2LPEN      : 1;
  7134.                     uint32_t BKPSRAMLPEN    : 1;
  7135.                     uint32_t reserved19     : 1;
  7136.                     uint32_t reserved20     : 1;
  7137.                     uint32_t DMA1LPEN       : 1;
  7138.                     uint32_t DMA2LPEN       : 1;
  7139.                     uint32_t reserved23     : 1;
  7140.                     uint32_t reserved24     : 1;
  7141.                     uint32_t ETHMACLPEN     : 1;
  7142.                     uint32_t ETHMACTXLPEN   : 1;
  7143.                     uint32_t ETHMACRXLPEN   : 1;
  7144.                     uint32_t ETHMACPTPLPEN  : 1;
  7145.                     uint32_t OTGHSLPEN      : 1;
  7146.                     uint32_t OTGHSULPILPEN  : 1;
  7147.                     uint32_t reserved31     : 1;
  7148.                 };
  7149.                 uint32_t RAW;
  7150.             };
  7151.         public:
  7152.             enum class EMasks: uint32_t
  7153.             {
  7154.                 GPIOALPEN              = (0x1U << 0),
  7155.                 GPIOBLPEN              = (0x1U << 1),
  7156.                 GPIOCLPEN              = (0x1U << 2),
  7157.                 GPIODLPEN              = (0x1U << 3),
  7158.                 GPIOELPEN              = (0x1U << 4),
  7159.                 GPIOFLPEN              = (0x1U << 5),
  7160.                 GPIOGLPEN              = (0x1U << 6),
  7161.                 GPIOHLPEN              = (0x1U << 7),
  7162.                 GPIOILPEN              = (0x1U << 8),
  7163.                 CRCLPEN                = (0x1U << 12),
  7164.                 FLITFLPEN              = (0x1U << 15),
  7165.                 SRAM1LPEN              = (0x1U << 16),
  7166.                 SRAM2LPEN              = (0x1U << 17),
  7167.                 BKPSRAMLPEN            = (0x1U << 18),
  7168.                 DMA1LPEN               = (0x1U << 21),
  7169.                 DMA2LPEN               = (0x1U << 22),
  7170.                 ETHMACLPEN             = (0x1U << 25),
  7171.                 ETHMACTXLPEN           = (0x1U << 26),
  7172.                 ETHMACRXLPEN           = (0x1U << 27),
  7173.                 ETHMACPTPLPEN          = (0x1U << 28),
  7174.                 OTGHSLPEN              = (0x1U << 29),
  7175.                 OTGHSULPILPEN          = (0x1U << 30),
  7176.             };
  7177.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1LPENR; }
  7178.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1LPENR = value; }
  7179.             template <EMasks ... flags>
  7180.             static inline void set_flags()
  7181.             {
  7182.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1LPENR |= SetBits<(std::uint32_t)flags...>();
  7183.             }
  7184.             template <EMasks ... flags>
  7185.             static inline void clear_flags()
  7186.             {
  7187.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1LPENR &= ~(SetBits<(std::uint32_t)flags...>());
  7188.             }
  7189.             template <EMasks ... flags>
  7190.             static inline bool get_flags()
  7191.             {
  7192.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB1LPENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7193.             }
  7194.         };
  7195.         class AHB2LPENR
  7196.         {
  7197.         private:
  7198.             union AHB2LPENR_t
  7199.             {
  7200.                 struct
  7201.                 {
  7202.                     uint32_t DCMILPEN       : 1;
  7203.                     uint32_t reserved1      : 1;
  7204.                     uint32_t reserved2      : 1;
  7205.                     uint32_t reserved3      : 1;
  7206.                     uint32_t reserved4      : 1;
  7207.                     uint32_t reserved5      : 1;
  7208.                     uint32_t RNGLPEN        : 1;
  7209.                     uint32_t OTGFSLPEN      : 1;
  7210.                     uint32_t reserved8      : 24;
  7211.                 };
  7212.                 uint32_t RAW;
  7213.             };
  7214.         public:
  7215.             enum class EMasks: uint32_t
  7216.             {
  7217.                 DCMILPEN               = (0x1U << 0),
  7218.                 RNGLPEN                = (0x1U << 6),
  7219.                 OTGFSLPEN              = (0x1U << 7),
  7220.             };
  7221.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2LPENR; }
  7222.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2LPENR = value; }
  7223.             template <EMasks ... flags>
  7224.             static inline void set_flags()
  7225.             {
  7226.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2LPENR |= SetBits<(std::uint32_t)flags...>();
  7227.             }
  7228.             template <EMasks ... flags>
  7229.             static inline void clear_flags()
  7230.             {
  7231.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2LPENR &= ~(SetBits<(std::uint32_t)flags...>());
  7232.             }
  7233.             template <EMasks ... flags>
  7234.             static inline bool get_flags()
  7235.             {
  7236.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB2LPENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7237.             }
  7238.         };
  7239.         class AHB3LPENR
  7240.         {
  7241.         private:
  7242.             union AHB3LPENR_t
  7243.             {
  7244.                 struct
  7245.                 {
  7246.                     uint32_t FSMCLPEN       : 1;
  7247.                     uint32_t reserved1      : 31;
  7248.                 };
  7249.                 uint32_t RAW;
  7250.             };
  7251.         public:
  7252.             enum class EMasks: uint32_t
  7253.             {
  7254.                 FSMCLPEN               = (0x1U << 0),
  7255.             };
  7256.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3LPENR; }
  7257.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3LPENR = value; }
  7258.             template <EMasks ... flags>
  7259.             static inline void set_flags()
  7260.             {
  7261.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3LPENR |= SetBits<(std::uint32_t)flags...>();
  7262.             }
  7263.             template <EMasks ... flags>
  7264.             static inline void clear_flags()
  7265.             {
  7266.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3LPENR &= ~(SetBits<(std::uint32_t)flags...>());
  7267.             }
  7268.             template <EMasks ... flags>
  7269.             static inline bool get_flags()
  7270.             {
  7271.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->AHB3LPENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7272.             }
  7273.         };
  7274.         class APB1LPENR
  7275.         {
  7276.         private:
  7277.             union APB1LPENR_t
  7278.             {
  7279.                 struct
  7280.                 {
  7281.                     uint32_t TIM2LPEN       : 1;
  7282.                     uint32_t TIM3LPEN       : 1;
  7283.                     uint32_t TIM4LPEN       : 1;
  7284.                     uint32_t TIM5LPEN       : 1;
  7285.                     uint32_t TIM6LPEN       : 1;
  7286.                     uint32_t TIM7LPEN       : 1;
  7287.                     uint32_t TIM12LPEN      : 1;
  7288.                     uint32_t TIM13LPEN      : 1;
  7289.                     uint32_t TIM14LPEN      : 1;
  7290.                     uint32_t reserved9      : 1;
  7291.                     uint32_t reserved10     : 1;
  7292.                     uint32_t WWDGLPEN       : 1;
  7293.                     uint32_t reserved12     : 1;
  7294.                     uint32_t reserved13     : 1;
  7295.                     uint32_t SPI2LPEN       : 1;
  7296.                     uint32_t SPI3LPEN       : 1;
  7297.                     uint32_t reserved16     : 1;
  7298.                     uint32_t USART2LPEN     : 1;
  7299.                     uint32_t USART3LPEN     : 1;
  7300.                     uint32_t UART4LPEN      : 1;
  7301.                     uint32_t UART5LPEN      : 1;
  7302.                     uint32_t I2C1LPEN       : 1;
  7303.                     uint32_t I2C2LPEN       : 1;
  7304.                     uint32_t I2C3LPEN       : 1;
  7305.                     uint32_t reserved24     : 1;
  7306.                     uint32_t CAN1LPEN       : 1;
  7307.                     uint32_t CAN2LPEN       : 1;
  7308.                     uint32_t reserved27     : 1;
  7309.                     uint32_t PWRLPEN        : 1;
  7310.                     uint32_t DACLPEN        : 1;
  7311.                     uint32_t reserved30     : 2;
  7312.                 };
  7313.                 uint32_t RAW;
  7314.             };
  7315.         public:
  7316.             enum class EMasks: uint32_t
  7317.             {
  7318.                 TIM2LPEN               = (0x1U << 0),
  7319.                 TIM3LPEN               = (0x1U << 1),
  7320.                 TIM4LPEN               = (0x1U << 2),
  7321.                 TIM5LPEN               = (0x1U << 3),
  7322.                 TIM6LPEN               = (0x1U << 4),
  7323.                 TIM7LPEN               = (0x1U << 5),
  7324.                 TIM12LPEN              = (0x1U << 6),
  7325.                 TIM13LPEN              = (0x1U << 7),
  7326.                 TIM14LPEN              = (0x1U << 8),
  7327.                 WWDGLPEN               = (0x1U << 11),
  7328.                 SPI2LPEN               = (0x1U << 14),
  7329.                 SPI3LPEN               = (0x1U << 15),
  7330.                 USART2LPEN             = (0x1U << 17),
  7331.                 USART3LPEN             = (0x1U << 18),
  7332.                 UART4LPEN              = (0x1U << 19),
  7333.                 UART5LPEN              = (0x1U << 20),
  7334.                 I2C1LPEN               = (0x1U << 21),
  7335.                 I2C2LPEN               = (0x1U << 22),
  7336.                 I2C3LPEN               = (0x1U << 23),
  7337.                 CAN1LPEN               = (0x1U << 25),
  7338.                 CAN2LPEN               = (0x1U << 26),
  7339.                 PWRLPEN                = (0x1U << 28),
  7340.                 DACLPEN                = (0x1U << 29),
  7341.             };
  7342.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1LPENR; }
  7343.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1LPENR = value; }
  7344.             template <EMasks ... flags>
  7345.             static inline void set_flags()
  7346.             {
  7347.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1LPENR |= SetBits<(std::uint32_t)flags...>();
  7348.             }
  7349.             template <EMasks ... flags>
  7350.             static inline void clear_flags()
  7351.             {
  7352.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1LPENR &= ~(SetBits<(std::uint32_t)flags...>());
  7353.             }
  7354.             template <EMasks ... flags>
  7355.             static inline bool get_flags()
  7356.             {
  7357.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB1LPENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7358.             }
  7359.         };
  7360.         class APB2LPENR
  7361.         {
  7362.         private:
  7363.             union APB2LPENR_t
  7364.             {
  7365.                 struct
  7366.                 {
  7367.                     uint32_t TIM1LPEN       : 1;
  7368.                     uint32_t TIM8LPEN       : 1;
  7369.                     uint32_t reserved2      : 1;
  7370.                     uint32_t reserved3      : 1;
  7371.                     uint32_t USART1LPEN     : 1;
  7372.                     uint32_t USART6LPEN     : 1;
  7373.                     uint32_t reserved6      : 1;
  7374.                     uint32_t reserved7      : 1;
  7375.                     uint32_t ADC1LPEN       : 1;
  7376.                     uint32_t ADC2LPEN       : 1;
  7377.                     uint32_t ADC3LPEN       : 1;
  7378.                     uint32_t SDIOLPEN       : 1;
  7379.                     uint32_t SPI1LPEN       : 1;
  7380.                     uint32_t reserved13     : 1;
  7381.                     uint32_t SYSCFGLPEN     : 1;
  7382.                     uint32_t reserved15     : 1;
  7383.                     uint32_t TIM9LPEN       : 1;
  7384.                     uint32_t TIM10LPEN      : 1;
  7385.                     uint32_t TIM11LPEN      : 1;
  7386.                     uint32_t reserved19     : 13;
  7387.                 };
  7388.                 uint32_t RAW;
  7389.             };
  7390.         public:
  7391.             enum class EMasks: uint32_t
  7392.             {
  7393.                 TIM1LPEN               = (0x1U << 0),
  7394.                 TIM8LPEN               = (0x1U << 1),
  7395.                 USART1LPEN             = (0x1U << 4),
  7396.                 USART6LPEN             = (0x1U << 5),
  7397.                 ADC1LPEN               = (0x1U << 8),
  7398.                 ADC2LPEN               = (0x1U << 9),
  7399.                 ADC3LPEN               = (0x1U << 10),
  7400.                 SDIOLPEN               = (0x1U << 11),
  7401.                 SPI1LPEN               = (0x1U << 12),
  7402.                 SYSCFGLPEN             = (0x1U << 14),
  7403.                 TIM9LPEN               = (0x1U << 16),
  7404.                 TIM10LPEN              = (0x1U << 17),
  7405.                 TIM11LPEN              = (0x1U << 18),
  7406.             };
  7407.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2LPENR; }
  7408.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2LPENR = value; }
  7409.             template <EMasks ... flags>
  7410.             static inline void set_flags()
  7411.             {
  7412.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2LPENR |= SetBits<(std::uint32_t)flags...>();
  7413.             }
  7414.             template <EMasks ... flags>
  7415.             static inline void clear_flags()
  7416.             {
  7417.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2LPENR &= ~(SetBits<(std::uint32_t)flags...>());
  7418.             }
  7419.             template <EMasks ... flags>
  7420.             static inline bool get_flags()
  7421.             {
  7422.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->APB2LPENR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7423.             }
  7424.         };
  7425.         class BDCR
  7426.         {
  7427.         private:
  7428.             union BDCR_t
  7429.             {
  7430.                 struct
  7431.                 {
  7432.                     uint32_t LSEON          : 1;
  7433.                     uint32_t LSERDY         : 1;
  7434.                     uint32_t LSEBYP         : 1;
  7435.                     uint32_t reserved3      : 1;
  7436.                     uint32_t reserved4      : 1;
  7437.                     uint32_t reserved5      : 1;
  7438.                     uint32_t reserved6      : 1;
  7439.                     uint32_t reserved7      : 1;
  7440.                     uint32_t RTCSEL         : 2;
  7441.                     uint32_t reserved10     : 1;
  7442.                     uint32_t reserved11     : 1;
  7443.                     uint32_t reserved12     : 1;
  7444.                     uint32_t reserved13     : 1;
  7445.                     uint32_t reserved14     : 1;
  7446.                     uint32_t RTCEN          : 1;
  7447.                     uint32_t BDRST          : 1;
  7448.                     uint32_t reserved17     : 15;
  7449.                 };
  7450.                 uint32_t RAW;
  7451.             };
  7452.         public:
  7453.             enum class EMasks: uint32_t
  7454.             {
  7455.                 LSEON                  = (0x1U << 0),
  7456.                 LSERDY                 = (0x1U << 1),
  7457.                 LSEBYP                 = (0x1U << 2),
  7458.                 RTCSEL                 = (0x3U << 8),
  7459.                 RTCEN                  = (0x1U << 15),
  7460.                 BDRST                  = (0x1U << 16),
  7461.             };
  7462.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR; }
  7463.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR = value; }
  7464.             template <EMasks ... flags>
  7465.             static inline void set_flags()
  7466.             {
  7467.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR |= SetBits<(std::uint32_t)flags...>();
  7468.             }
  7469.             template <EMasks ... flags>
  7470.             static inline void clear_flags()
  7471.             {
  7472.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR &= ~(SetBits<(std::uint32_t)flags...>());
  7473.             }
  7474.             template <EMasks ... flags>
  7475.             static inline bool get_flags()
  7476.             {
  7477.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7478.             }
  7479.             static inline uint32_t get_RTCSEL() { return reinterpret_cast<__IO BDCR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR)->RTCSEL; }
  7480.             static inline void set_RTCSEL(uint32_t value) { reinterpret_cast<__IO BDCR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->BDCR)->RTCSEL = value; }
  7481.         };
  7482.         class CSR
  7483.         {
  7484.         private:
  7485.             union CSR_t
  7486.             {
  7487.                 struct
  7488.                 {
  7489.                     uint32_t reserved0      : 32;
  7490.                 };
  7491.                 uint32_t RAW;
  7492.             };
  7493.         public:
  7494.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CSR; }
  7495.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->CSR = value; }
  7496.         };
  7497.         class SSCGR
  7498.         {
  7499.         private:
  7500.             union SSCGR_t
  7501.             {
  7502.                 struct
  7503.                 {
  7504.                     uint32_t MODPER         : 13;
  7505.                     uint32_t INCSTEP        : 15;
  7506.                     uint32_t reserved28     : 1;
  7507.                     uint32_t reserved29     : 1;
  7508.                     uint32_t SPREADSEL      : 1;
  7509.                     uint32_t SSCGEN         : 1;
  7510.                 };
  7511.                 uint32_t RAW;
  7512.             };
  7513.         public:
  7514.             enum class EMasks: uint32_t
  7515.             {
  7516.                 MODPER                 = (0x1FFFU << 0),
  7517.                 INCSTEP                = (0x7FFFU << 13),
  7518.                 SPREADSEL              = (0x1U << 30),
  7519.                 SSCGEN                 = (0x1U << 31),
  7520.             };
  7521.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR; }
  7522.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR = value; }
  7523.             template <EMasks ... flags>
  7524.             static inline void set_flags()
  7525.             {
  7526.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR |= SetBits<(std::uint32_t)flags...>();
  7527.             }
  7528.             template <EMasks ... flags>
  7529.             static inline void clear_flags()
  7530.             {
  7531.                 reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR &= ~(SetBits<(std::uint32_t)flags...>());
  7532.             }
  7533.             template <EMasks ... flags>
  7534.             static inline bool get_flags()
  7535.             {
  7536.                 return ((reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7537.             }
  7538.             static inline uint32_t get_MODPER() { return reinterpret_cast<__IO SSCGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR)->MODPER; }
  7539.             static inline void set_MODPER(uint32_t value) { reinterpret_cast<__IO SSCGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR)->MODPER = value; }
  7540.             static inline uint32_t get_INCSTEP() { return reinterpret_cast<__IO SSCGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR)->INCSTEP; }
  7541.             static inline void set_INCSTEP(uint32_t value) { reinterpret_cast<__IO SSCGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->SSCGR)->INCSTEP = value; }
  7542.         };
  7543.         class PLLI2SCFGR
  7544.         {
  7545.         private:
  7546.             union PLLI2SCFGR_t
  7547.             {
  7548.                 struct
  7549.                 {
  7550.                     uint32_t reserved0      : 1;
  7551.                     uint32_t reserved1      : 1;
  7552.                     uint32_t reserved2      : 1;
  7553.                     uint32_t reserved3      : 1;
  7554.                     uint32_t reserved4      : 1;
  7555.                     uint32_t reserved5      : 1;
  7556.                     uint32_t PLLI2SN        : 9;
  7557.                     uint32_t reserved15     : 1;
  7558.                     uint32_t reserved16     : 1;
  7559.                     uint32_t reserved17     : 1;
  7560.                     uint32_t reserved18     : 1;
  7561.                     uint32_t reserved19     : 1;
  7562.                     uint32_t reserved20     : 1;
  7563.                     uint32_t reserved21     : 1;
  7564.                     uint32_t reserved22     : 1;
  7565.                     uint32_t reserved23     : 1;
  7566.                     uint32_t reserved24     : 1;
  7567.                     uint32_t reserved25     : 1;
  7568.                     uint32_t reserved26     : 1;
  7569.                     uint32_t reserved27     : 1;
  7570.                     uint32_t PLLI2SR        : 3;
  7571.                     uint32_t reserved31     : 1;
  7572.                 };
  7573.                 uint32_t RAW;
  7574.             };
  7575.         public:
  7576.             enum class EMasks: uint32_t
  7577.             {
  7578.                 PLLI2SN                = (0x1FFU << 6),
  7579.                 PLLI2SR                = (0x7U << 28),
  7580.             };
  7581.             static inline uint32_t get() { return reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR; }
  7582.             static inline void set(uint32_t value) { reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR = value; }
  7583.             static inline uint32_t get_PLLI2SN() { return reinterpret_cast<__IO PLLI2SCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR)->PLLI2SN; }
  7584.             static inline void set_PLLI2SN(uint32_t value) { reinterpret_cast<__IO PLLI2SCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR)->PLLI2SN = value; }
  7585.             static inline uint32_t get_PLLI2SR() { return reinterpret_cast<__IO PLLI2SCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR)->PLLI2SR; }
  7586.             static inline void set_PLLI2SR(uint32_t value) { reinterpret_cast<__IO PLLI2SCFGR_t*>(&reinterpret_cast<RCC_t*>(STM32::RCC_BASE)->PLLI2SCFGR)->PLLI2SR = value; }
  7587.         };
  7588.     };
  7589.     /* RTC DEFINITION */
  7590.     class RTC
  7591.     {
  7592.     private:
  7593.         struct RTC_t
  7594.         {
  7595.             __IO uint32_t                 TR;
  7596.             __IO uint32_t                 DR;
  7597.             __IO uint32_t                 CR;
  7598.             __IO uint32_t                 ISR;
  7599.             __IO uint32_t                 PRER;
  7600.             __IO uint32_t                 WUTR;
  7601.             __IO uint32_t                 CALIBR;
  7602.             __IO uint32_t                 ALRMAR;
  7603.             __IO uint32_t                 ALRMBR;
  7604.             __IO uint32_t                 WPR;
  7605.             __IO uint32_t                 SSR;
  7606.             __IO uint32_t                 SHIFTR;
  7607.             __IO uint32_t                 TSTR;
  7608.             __IO uint32_t                 TSDR;
  7609.             __IO uint32_t                 TSSSR;
  7610.             __IO uint32_t                 CALR;
  7611.             __IO uint32_t                 TAFCR;
  7612.             __IO uint32_t                 ALRMASSR;
  7613.             __IO uint32_t                 ALRMBSSR;
  7614.             uint32_t                      RESERVED7;
  7615.             __IO uint32_t                 BKP0R;
  7616.             __IO uint32_t                 BKP1R;
  7617.             __IO uint32_t                 BKP2R;
  7618.             __IO uint32_t                 BKP3R;
  7619.             __IO uint32_t                 BKP4R;
  7620.             __IO uint32_t                 BKP5R;
  7621.             __IO uint32_t                 BKP6R;
  7622.             __IO uint32_t                 BKP7R;
  7623.             __IO uint32_t                 BKP8R;
  7624.             __IO uint32_t                 BKP9R;
  7625.             __IO uint32_t                 BKP10R;
  7626.             __IO uint32_t                 BKP11R;
  7627.             __IO uint32_t                 BKP12R;
  7628.             __IO uint32_t                 BKP13R;
  7629.             __IO uint32_t                 BKP14R;
  7630.             __IO uint32_t                 BKP15R;
  7631.             __IO uint32_t                 BKP16R;
  7632.             __IO uint32_t                 BKP17R;
  7633.             __IO uint32_t                 BKP18R;
  7634.             __IO uint32_t                 BKP19R;
  7635.         };
  7636.     public:
  7637.         class TR
  7638.         {
  7639.         private:
  7640.             union TR_t
  7641.             {
  7642.                 struct
  7643.                 {
  7644.                     uint32_t reserved0      : 1;
  7645.                     uint32_t reserved1      : 1;
  7646.                     uint32_t reserved2      : 1;
  7647.                     uint32_t reserved3      : 1;
  7648.                     uint32_t reserved4      : 1;
  7649.                     uint32_t reserved5      : 1;
  7650.                     uint32_t reserved6      : 1;
  7651.                     uint32_t reserved7      : 1;
  7652.                     uint32_t reserved8      : 1;
  7653.                     uint32_t reserved9      : 1;
  7654.                     uint32_t reserved10     : 1;
  7655.                     uint32_t reserved11     : 1;
  7656.                     uint32_t reserved12     : 1;
  7657.                     uint32_t reserved13     : 1;
  7658.                     uint32_t reserved14     : 1;
  7659.                     uint32_t reserved15     : 1;
  7660.                     uint32_t reserved16     : 1;
  7661.                     uint32_t reserved17     : 1;
  7662.                     uint32_t reserved18     : 1;
  7663.                     uint32_t reserved19     : 1;
  7664.                     uint32_t reserved20     : 1;
  7665.                     uint32_t reserved21     : 1;
  7666.                     uint32_t PM             : 1;
  7667.                     uint32_t HT             : 2;
  7668.                     uint32_t HU             : 4;
  7669.                     uint32_t MNT            : 3;
  7670.                     uint32_t MNU            : 4;
  7671.                     uint32_t ST             : 3;
  7672.                     uint32_t SU             : 4;
  7673.                 };
  7674.                 uint32_t RAW;
  7675.             };
  7676.         public:
  7677.             enum class EMasks: uint32_t
  7678.             {
  7679.                 PM                     = (0x1U << 22),
  7680.                 HT                     = (0x3U << 20),
  7681.                 HU                     = (0xFU << 16),
  7682.                 MNT                    = (0x7U << 12),
  7683.                 MNU                    = (0xFU << 8),
  7684.                 ST                     = (0x7U << 4),
  7685.                 SU                     = (0xFU << 0),
  7686.             };
  7687.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR; }
  7688.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR = value; }
  7689.             template <EMasks ... flags>
  7690.             static inline void set_flags()
  7691.             {
  7692.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR |= SetBits<(std::uint32_t)flags...>();
  7693.             }
  7694.             template <EMasks ... flags>
  7695.             static inline void clear_flags()
  7696.             {
  7697.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR &= ~(SetBits<(std::uint32_t)flags...>());
  7698.             }
  7699.             template <EMasks ... flags>
  7700.             static inline bool get_flags()
  7701.             {
  7702.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7703.             }
  7704.             static inline uint32_t get_HT() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->HT; }
  7705.             static inline void set_HT(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->HT = value; }
  7706.             static inline uint32_t get_HU() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->HU; }
  7707.             static inline void set_HU(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->HU = value; }
  7708.             static inline uint32_t get_MNT() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->MNT; }
  7709.             static inline void set_MNT(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->MNT = value; }
  7710.             static inline uint32_t get_MNU() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->MNU; }
  7711.             static inline void set_MNU(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->MNU = value; }
  7712.             static inline uint32_t get_ST() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->ST; }
  7713.             static inline void set_ST(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->ST = value; }
  7714.             static inline uint32_t get_SU() { return reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->SU; }
  7715.             static inline void set_SU(uint32_t value) { reinterpret_cast<__IO TR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TR)->SU = value; }
  7716.         };
  7717.         class DR
  7718.         {
  7719.         private:
  7720.             union DR_t
  7721.             {
  7722.                 struct
  7723.                 {
  7724.                     uint32_t reserved0      : 1;
  7725.                     uint32_t reserved1      : 1;
  7726.                     uint32_t reserved2      : 1;
  7727.                     uint32_t reserved3      : 1;
  7728.                     uint32_t reserved4      : 1;
  7729.                     uint32_t reserved5      : 1;
  7730.                     uint32_t reserved6      : 1;
  7731.                     uint32_t reserved7      : 1;
  7732.                     uint32_t reserved8      : 1;
  7733.                     uint32_t reserved9      : 1;
  7734.                     uint32_t reserved10     : 1;
  7735.                     uint32_t reserved11     : 1;
  7736.                     uint32_t reserved12     : 1;
  7737.                     uint32_t reserved13     : 1;
  7738.                     uint32_t reserved14     : 1;
  7739.                     uint32_t reserved15     : 1;
  7740.                     uint32_t reserved16     : 1;
  7741.                     uint32_t reserved17     : 1;
  7742.                     uint32_t reserved18     : 1;
  7743.                     uint32_t reserved19     : 1;
  7744.                     uint32_t YT             : 4;
  7745.                     uint32_t YU             : 4;
  7746.                     uint32_t WDU            : 3;
  7747.                     uint32_t MT             : 1;
  7748.                     uint32_t MU             : 4;
  7749.                     uint32_t DT             : 2;
  7750.                     uint32_t DU             : 4;
  7751.                 };
  7752.                 uint32_t RAW;
  7753.             };
  7754.         public:
  7755.             enum class EMasks: uint32_t
  7756.             {
  7757.                 YT                     = (0xFU << 20),
  7758.                 YU                     = (0xFU << 16),
  7759.                 WDU                    = (0x7U << 13),
  7760.                 MT                     = (0x1U << 12),
  7761.                 MU                     = (0xFU << 8),
  7762.                 DT                     = (0x3U << 4),
  7763.                 DU                     = (0xFU << 0),
  7764.             };
  7765.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR; }
  7766.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR = value; }
  7767.             template <EMasks ... flags>
  7768.             static inline void set_flags()
  7769.             {
  7770.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR |= SetBits<(std::uint32_t)flags...>();
  7771.             }
  7772.             template <EMasks ... flags>
  7773.             static inline void clear_flags()
  7774.             {
  7775.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR &= ~(SetBits<(std::uint32_t)flags...>());
  7776.             }
  7777.             template <EMasks ... flags>
  7778.             static inline bool get_flags()
  7779.             {
  7780.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7781.             }
  7782.             static inline uint32_t get_YT() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->YT; }
  7783.             static inline void set_YT(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->YT = value; }
  7784.             static inline uint32_t get_YU() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->YU; }
  7785.             static inline void set_YU(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->YU = value; }
  7786.             static inline uint32_t get_WDU() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->WDU; }
  7787.             static inline void set_WDU(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->WDU = value; }
  7788.             static inline uint32_t get_MU() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->MU; }
  7789.             static inline void set_MU(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->MU = value; }
  7790.             static inline uint32_t get_DT() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->DT; }
  7791.             static inline void set_DT(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->DT = value; }
  7792.             static inline uint32_t get_DU() { return reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->DU; }
  7793.             static inline void set_DU(uint32_t value) { reinterpret_cast<__IO DR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->DR)->DU = value; }
  7794.         };
  7795.         class CR
  7796.         {
  7797.         private:
  7798.             union CR_t
  7799.             {
  7800.                 struct
  7801.                 {
  7802.                     uint32_t reserved0      : 1;
  7803.                     uint32_t reserved1      : 1;
  7804.                     uint32_t reserved2      : 1;
  7805.                     uint32_t reserved3      : 1;
  7806.                     uint32_t reserved4      : 1;
  7807.                     uint32_t reserved5      : 1;
  7808.                     uint32_t reserved6      : 1;
  7809.                     uint32_t reserved7      : 1;
  7810.                     uint32_t reserved8      : 1;
  7811.                     uint32_t reserved9      : 1;
  7812.                     uint32_t reserved10     : 1;
  7813.                     uint32_t reserved11     : 1;
  7814.                     uint32_t reserved12     : 1;
  7815.                     uint32_t reserved13     : 1;
  7816.                     uint32_t reserved14     : 1;
  7817.                     uint32_t reserved15     : 1;
  7818.                     uint32_t reserved16     : 1;
  7819.                     uint32_t reserved17     : 1;
  7820.                     uint32_t reserved18     : 1;
  7821.                     uint32_t reserved19     : 1;
  7822.                     uint32_t reserved20     : 1;
  7823.                     uint32_t reserved21     : 1;
  7824.                     uint32_t reserved22     : 1;
  7825.                     uint32_t COE            : 1;
  7826.                     uint32_t OSEL           : 2;
  7827.                     uint32_t POL            : 1;
  7828.                     uint32_t COSEL          : 1;
  7829.                     uint32_t BKP            : 1;
  7830.                     uint32_t SUB1H          : 1;
  7831.                     uint32_t ADD1H          : 1;
  7832.                     uint32_t TSIE           : 1;
  7833.                     uint32_t WUTIE          : 1;
  7834.                     uint32_t ALRBIE         : 1;
  7835.                     uint32_t ALRAIE         : 1;
  7836.                     uint32_t TSE            : 1;
  7837.                     uint32_t WUTE           : 1;
  7838.                     uint32_t ALRBE          : 1;
  7839.                     uint32_t ALRAE          : 1;
  7840.                     uint32_t DCE            : 1;
  7841.                     uint32_t FMT            : 1;
  7842.                     uint32_t BYPSHAD        : 1;
  7843.                     uint32_t REFCKON        : 1;
  7844.                     uint32_t TSEDGE         : 1;
  7845.                     uint32_t WUCKSEL        : 3;
  7846.                 };
  7847.                 uint32_t RAW;
  7848.             };
  7849.         public:
  7850.             enum class EMasks: uint32_t
  7851.             {
  7852.                 COE                    = (0x1U << 23),
  7853.                 OSEL                   = (0x3U << 21),
  7854.                 POL                    = (0x1U << 20),
  7855.                 COSEL                  = (0x1U << 19),
  7856.                 BKP                    = (0x1U << 18),
  7857.                 SUB1H                  = (0x1U << 17),
  7858.                 ADD1H                  = (0x1U << 16),
  7859.                 TSIE                   = (0x1U << 15),
  7860.                 WUTIE                  = (0x1U << 14),
  7861.                 ALRBIE                 = (0x1U << 13),
  7862.                 ALRAIE                 = (0x1U << 12),
  7863.                 TSE                    = (0x1U << 11),
  7864.                 WUTE                   = (0x1U << 10),
  7865.                 ALRBE                  = (0x1U << 9),
  7866.                 ALRAE                  = (0x1U << 8),
  7867.                 DCE                    = (0x1U << 7),
  7868.                 FMT                    = (0x1U << 6),
  7869.                 BYPSHAD                = (0x1U << 5),
  7870.                 REFCKON                = (0x1U << 4),
  7871.                 TSEDGE                 = (0x1U << 3),
  7872.                 WUCKSEL                = (0x7U << 0),
  7873.             };
  7874.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR; }
  7875.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR = value; }
  7876.             template <EMasks ... flags>
  7877.             static inline void set_flags()
  7878.             {
  7879.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  7880.             }
  7881.             template <EMasks ... flags>
  7882.             static inline void clear_flags()
  7883.             {
  7884.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  7885.             }
  7886.             template <EMasks ... flags>
  7887.             static inline bool get_flags()
  7888.             {
  7889.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7890.             }
  7891.             static inline uint32_t get_OSEL() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR)->OSEL; }
  7892.             static inline void set_OSEL(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR)->OSEL = value; }
  7893.             static inline uint32_t get_WUCKSEL() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR)->WUCKSEL; }
  7894.             static inline void set_WUCKSEL(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CR)->WUCKSEL = value; }
  7895.         };
  7896.         class ISR
  7897.         {
  7898.         private:
  7899.             union ISR_t
  7900.             {
  7901.                 struct
  7902.                 {
  7903.                     uint32_t reserved0      : 1;
  7904.                     uint32_t reserved1      : 1;
  7905.                     uint32_t reserved2      : 1;
  7906.                     uint32_t reserved3      : 1;
  7907.                     uint32_t reserved4      : 1;
  7908.                     uint32_t reserved5      : 1;
  7909.                     uint32_t reserved6      : 1;
  7910.                     uint32_t reserved7      : 1;
  7911.                     uint32_t reserved8      : 1;
  7912.                     uint32_t reserved9      : 1;
  7913.                     uint32_t reserved10     : 1;
  7914.                     uint32_t reserved11     : 1;
  7915.                     uint32_t reserved12     : 1;
  7916.                     uint32_t reserved13     : 1;
  7917.                     uint32_t reserved14     : 1;
  7918.                     uint32_t reserved15     : 1;
  7919.                     uint32_t RECALPF        : 1;
  7920.                     uint32_t TAMP1F         : 1;
  7921.                     uint32_t TAMP2F         : 1;
  7922.                     uint32_t TSOVF          : 1;
  7923.                     uint32_t TSF            : 1;
  7924.                     uint32_t WUTF           : 1;
  7925.                     uint32_t ALRBF          : 1;
  7926.                     uint32_t ALRAF          : 1;
  7927.                     uint32_t INIT           : 1;
  7928.                     uint32_t INITF          : 1;
  7929.                     uint32_t RSF            : 1;
  7930.                     uint32_t INITS          : 1;
  7931.                     uint32_t SHPF           : 1;
  7932.                     uint32_t WUTWF          : 1;
  7933.                     uint32_t ALRBWF         : 1;
  7934.                     uint32_t ALRAWF         : 1;
  7935.                 };
  7936.                 uint32_t RAW;
  7937.             };
  7938.         public:
  7939.             enum class EMasks: uint32_t
  7940.             {
  7941.                 RECALPF                = (0x1U << 16),
  7942.                 TAMP1F                 = (0x1U << 13),
  7943.                 TAMP2F                 = (0x1U << 14),
  7944.                 TSOVF                  = (0x1U << 12),
  7945.                 TSF                    = (0x1U << 11),
  7946.                 WUTF                   = (0x1U << 10),
  7947.                 ALRBF                  = (0x1U << 9),
  7948.                 ALRAF                  = (0x1U << 8),
  7949.                 INIT                   = (0x1U << 7),
  7950.                 INITF                  = (0x1U << 6),
  7951.                 RSF                    = (0x1U << 5),
  7952.                 INITS                  = (0x1U << 4),
  7953.                 SHPF                   = (0x1U << 3),
  7954.                 WUTWF                  = (0x1U << 2),
  7955.                 ALRBWF                 = (0x1U << 1),
  7956.                 ALRAWF                 = (0x1U << 0),
  7957.             };
  7958.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ISR; }
  7959.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ISR = value; }
  7960.             template <EMasks ... flags>
  7961.             static inline void set_flags()
  7962.             {
  7963.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ISR |= SetBits<(std::uint32_t)flags...>();
  7964.             }
  7965.             template <EMasks ... flags>
  7966.             static inline void clear_flags()
  7967.             {
  7968.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ISR &= ~(SetBits<(std::uint32_t)flags...>());
  7969.             }
  7970.             template <EMasks ... flags>
  7971.             static inline bool get_flags()
  7972.             {
  7973.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ISR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  7974.             }
  7975.         };
  7976.         class PRER
  7977.         {
  7978.         private:
  7979.             union PRER_t
  7980.             {
  7981.                 struct
  7982.                 {
  7983.                     uint32_t reserved0      : 1;
  7984.                     uint32_t reserved1      : 1;
  7985.                     uint32_t reserved2      : 1;
  7986.                     uint32_t reserved3      : 1;
  7987.                     uint32_t reserved4      : 1;
  7988.                     uint32_t reserved5      : 1;
  7989.                     uint32_t reserved6      : 1;
  7990.                     uint32_t reserved7      : 1;
  7991.                     uint32_t reserved8      : 1;
  7992.                     uint32_t reserved9      : 1;
  7993.                     uint32_t reserved10     : 1;
  7994.                     uint32_t reserved11     : 1;
  7995.                     uint32_t reserved12     : 1;
  7996.                     uint32_t reserved13     : 1;
  7997.                     uint32_t reserved14     : 1;
  7998.                     uint32_t reserved15     : 1;
  7999.                     uint32_t PREDIV_A       : 7;
  8000.                     uint32_t PREDIV_S       : 15;
  8001.                 };
  8002.                 uint32_t RAW;
  8003.             };
  8004.         public:
  8005.             enum class EMasks: uint32_t
  8006.             {
  8007.                 PREDIV_A               = (0x7FU << 16),
  8008.                 PREDIV_S               = (0x7FFFU << 0),
  8009.             };
  8010.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER; }
  8011.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER = value; }
  8012.             static inline uint32_t get_PREDIV_A() { return reinterpret_cast<__IO PRER_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER)->PREDIV_A; }
  8013.             static inline void set_PREDIV_A(uint32_t value) { reinterpret_cast<__IO PRER_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER)->PREDIV_A = value; }
  8014.             static inline uint32_t get_PREDIV_S() { return reinterpret_cast<__IO PRER_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER)->PREDIV_S; }
  8015.             static inline void set_PREDIV_S(uint32_t value) { reinterpret_cast<__IO PRER_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->PRER)->PREDIV_S = value; }
  8016.         };
  8017.         class WUTR
  8018.         {
  8019.         private:
  8020.             union WUTR_t
  8021.             {
  8022.                 struct
  8023.                 {
  8024.                     uint32_t WUT            : 16;
  8025.                     uint32_t reserved16     : 16;
  8026.                 };
  8027.                 uint32_t RAW;
  8028.             };
  8029.         public:
  8030.             enum class EMasks: uint32_t
  8031.             {
  8032.                 WUT                    = (0xFFFFU << 0),
  8033.             };
  8034.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WUTR; }
  8035.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WUTR = value; }
  8036.             static inline uint32_t get_WUT() { return reinterpret_cast<__IO WUTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WUTR)->WUT; }
  8037.             static inline void set_WUT(uint32_t value) { reinterpret_cast<__IO WUTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WUTR)->WUT = value; }
  8038.         };
  8039.         class CALIBR
  8040.         {
  8041.         private:
  8042.             union CALIBR_t
  8043.             {
  8044.                 struct
  8045.                 {
  8046.                     uint32_t reserved0      : 1;
  8047.                     uint32_t reserved1      : 1;
  8048.                     uint32_t reserved2      : 1;
  8049.                     uint32_t reserved3      : 1;
  8050.                     uint32_t reserved4      : 1;
  8051.                     uint32_t reserved5      : 1;
  8052.                     uint32_t reserved6      : 1;
  8053.                     uint32_t DCS            : 1;
  8054.                     uint32_t DC             : 5;
  8055.                     uint32_t reserved13     : 19;
  8056.                 };
  8057.                 uint32_t RAW;
  8058.             };
  8059.         public:
  8060.             enum class EMasks: uint32_t
  8061.             {
  8062.                 DCS                    = (0x1U << 7),
  8063.                 DC                     = (0x1FU << 0),
  8064.             };
  8065.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR; }
  8066.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR = value; }
  8067.             template <EMasks ... flags>
  8068.             static inline void set_flags()
  8069.             {
  8070.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR |= SetBits<(std::uint32_t)flags...>();
  8071.             }
  8072.             template <EMasks ... flags>
  8073.             static inline void clear_flags()
  8074.             {
  8075.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR &= ~(SetBits<(std::uint32_t)flags...>());
  8076.             }
  8077.             template <EMasks ... flags>
  8078.             static inline bool get_flags()
  8079.             {
  8080.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8081.             }
  8082.             static inline uint32_t get_DC() { return reinterpret_cast<__IO CALIBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR)->DC; }
  8083.             static inline void set_DC(uint32_t value) { reinterpret_cast<__IO CALIBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALIBR)->DC = value; }
  8084.         };
  8085.         class ALRMAR
  8086.         {
  8087.         private:
  8088.             union ALRMAR_t
  8089.             {
  8090.                 struct
  8091.                 {
  8092.                     uint32_t reserved0      : 1;
  8093.                     uint32_t reserved1      : 1;
  8094.                     uint32_t reserved2      : 1;
  8095.                     uint32_t reserved3      : 1;
  8096.                     uint32_t reserved4      : 1;
  8097.                     uint32_t reserved5      : 1;
  8098.                     uint32_t reserved6      : 1;
  8099.                     uint32_t reserved7      : 1;
  8100.                     uint32_t reserved8      : 1;
  8101.                     uint32_t reserved9      : 1;
  8102.                     uint32_t reserved10     : 1;
  8103.                     uint32_t reserved11     : 1;
  8104.                     uint32_t reserved12     : 1;
  8105.                     uint32_t reserved13     : 1;
  8106.                     uint32_t reserved14     : 1;
  8107.                     uint32_t reserved15     : 1;
  8108.                     uint32_t reserved16     : 1;
  8109.                     uint32_t reserved17     : 1;
  8110.                     uint32_t reserved18     : 1;
  8111.                     uint32_t reserved19     : 1;
  8112.                     uint32_t reserved20     : 1;
  8113.                     uint32_t reserved21     : 1;
  8114.                     uint32_t reserved22     : 1;
  8115.                     uint32_t reserved23     : 1;
  8116.                     uint32_t reserved24     : 1;
  8117.                     uint32_t reserved25     : 1;
  8118.                     uint32_t reserved26     : 1;
  8119.                     uint32_t reserved27     : 1;
  8120.                     uint32_t reserved28     : 1;
  8121.                     uint32_t reserved29     : 1;
  8122.                     uint32_t reserved30     : 1;
  8123.                     uint32_t MSK4           : 1;
  8124.                     uint32_t WDSEL          : 1;
  8125.                     uint32_t DT             : 2;
  8126.                     uint32_t DU             : 4;
  8127.                     uint32_t MSK3           : 1;
  8128.                     uint32_t PM             : 1;
  8129.                     uint32_t HT             : 2;
  8130.                     uint32_t HU             : 4;
  8131.                     uint32_t MSK2           : 1;
  8132.                     uint32_t MNT            : 3;
  8133.                     uint32_t MNU            : 4;
  8134.                     uint32_t MSK1           : 1;
  8135.                     uint32_t ST             : 3;
  8136.                     uint32_t SU             : 4;
  8137.                 };
  8138.                 uint32_t RAW;
  8139.             };
  8140.         public:
  8141.             enum class EMasks: uint32_t
  8142.             {
  8143.                 MSK4                   = (0x1U << 31),
  8144.                 WDSEL                  = (0x1U << 30),
  8145.                 DT                     = (0x3U << 28),
  8146.                 DU                     = (0xFU << 24),
  8147.                 MSK3                   = (0x1U << 23),
  8148.                 PM                     = (0x1U << 22),
  8149.                 HT                     = (0x3U << 20),
  8150.                 HU                     = (0xFU << 16),
  8151.                 MSK2                   = (0x1U << 15),
  8152.                 MNT                    = (0x7U << 12),
  8153.                 MNU                    = (0xFU << 8),
  8154.                 MSK1                   = (0x1U << 7),
  8155.                 ST                     = (0x7U << 4),
  8156.                 SU                     = (0xFU << 0),
  8157.             };
  8158.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR; }
  8159.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR = value; }
  8160.             template <EMasks ... flags>
  8161.             static inline void set_flags()
  8162.             {
  8163.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR |= SetBits<(std::uint32_t)flags...>();
  8164.             }
  8165.             template <EMasks ... flags>
  8166.             static inline void clear_flags()
  8167.             {
  8168.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR &= ~(SetBits<(std::uint32_t)flags...>());
  8169.             }
  8170.             template <EMasks ... flags>
  8171.             static inline bool get_flags()
  8172.             {
  8173.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8174.             }
  8175.             static inline uint32_t get_DT() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->DT; }
  8176.             static inline void set_DT(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->DT = value; }
  8177.             static inline uint32_t get_DU() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->DU; }
  8178.             static inline void set_DU(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->DU = value; }
  8179.             static inline uint32_t get_HT() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->HT; }
  8180.             static inline void set_HT(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->HT = value; }
  8181.             static inline uint32_t get_HU() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->HU; }
  8182.             static inline void set_HU(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->HU = value; }
  8183.             static inline uint32_t get_MNT() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->MNT; }
  8184.             static inline void set_MNT(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->MNT = value; }
  8185.             static inline uint32_t get_MNU() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->MNU; }
  8186.             static inline void set_MNU(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->MNU = value; }
  8187.             static inline uint32_t get_ST() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->ST; }
  8188.             static inline void set_ST(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->ST = value; }
  8189.             static inline uint32_t get_SU() { return reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->SU; }
  8190.             static inline void set_SU(uint32_t value) { reinterpret_cast<__IO ALRMAR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMAR)->SU = value; }
  8191.         };
  8192.         class ALRMBR
  8193.         {
  8194.         private:
  8195.             union ALRMBR_t
  8196.             {
  8197.                 struct
  8198.                 {
  8199.                     uint32_t reserved0      : 1;
  8200.                     uint32_t reserved1      : 1;
  8201.                     uint32_t reserved2      : 1;
  8202.                     uint32_t reserved3      : 1;
  8203.                     uint32_t reserved4      : 1;
  8204.                     uint32_t reserved5      : 1;
  8205.                     uint32_t reserved6      : 1;
  8206.                     uint32_t reserved7      : 1;
  8207.                     uint32_t reserved8      : 1;
  8208.                     uint32_t reserved9      : 1;
  8209.                     uint32_t reserved10     : 1;
  8210.                     uint32_t reserved11     : 1;
  8211.                     uint32_t reserved12     : 1;
  8212.                     uint32_t reserved13     : 1;
  8213.                     uint32_t reserved14     : 1;
  8214.                     uint32_t reserved15     : 1;
  8215.                     uint32_t reserved16     : 1;
  8216.                     uint32_t reserved17     : 1;
  8217.                     uint32_t reserved18     : 1;
  8218.                     uint32_t reserved19     : 1;
  8219.                     uint32_t reserved20     : 1;
  8220.                     uint32_t reserved21     : 1;
  8221.                     uint32_t reserved22     : 1;
  8222.                     uint32_t reserved23     : 1;
  8223.                     uint32_t reserved24     : 1;
  8224.                     uint32_t reserved25     : 1;
  8225.                     uint32_t reserved26     : 1;
  8226.                     uint32_t reserved27     : 1;
  8227.                     uint32_t reserved28     : 1;
  8228.                     uint32_t reserved29     : 1;
  8229.                     uint32_t reserved30     : 1;
  8230.                     uint32_t MSK4           : 1;
  8231.                     uint32_t WDSEL          : 1;
  8232.                     uint32_t DT             : 2;
  8233.                     uint32_t DU             : 4;
  8234.                     uint32_t MSK3           : 1;
  8235.                     uint32_t PM             : 1;
  8236.                     uint32_t HT             : 2;
  8237.                     uint32_t HU             : 4;
  8238.                     uint32_t MSK2           : 1;
  8239.                     uint32_t MNT            : 3;
  8240.                     uint32_t MNU            : 4;
  8241.                     uint32_t MSK1           : 1;
  8242.                     uint32_t ST             : 3;
  8243.                     uint32_t SU             : 4;
  8244.                 };
  8245.                 uint32_t RAW;
  8246.             };
  8247.         public:
  8248.             enum class EMasks: uint32_t
  8249.             {
  8250.                 MSK4                   = (0x1U << 31),
  8251.                 WDSEL                  = (0x1U << 30),
  8252.                 DT                     = (0x3U << 28),
  8253.                 DU                     = (0xFU << 24),
  8254.                 MSK3                   = (0x1U << 23),
  8255.                 PM                     = (0x1U << 22),
  8256.                 HT                     = (0x3U << 20),
  8257.                 HU                     = (0xFU << 16),
  8258.                 MSK2                   = (0x1U << 15),
  8259.                 MNT                    = (0x7U << 12),
  8260.                 MNU                    = (0xFU << 8),
  8261.                 MSK1                   = (0x1U << 7),
  8262.                 ST                     = (0x7U << 4),
  8263.                 SU                     = (0xFU << 0),
  8264.             };
  8265.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR; }
  8266.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR = value; }
  8267.             template <EMasks ... flags>
  8268.             static inline void set_flags()
  8269.             {
  8270.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR |= SetBits<(std::uint32_t)flags...>();
  8271.             }
  8272.             template <EMasks ... flags>
  8273.             static inline void clear_flags()
  8274.             {
  8275.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR &= ~(SetBits<(std::uint32_t)flags...>());
  8276.             }
  8277.             template <EMasks ... flags>
  8278.             static inline bool get_flags()
  8279.             {
  8280.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8281.             }
  8282.             static inline uint32_t get_DT() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->DT; }
  8283.             static inline void set_DT(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->DT = value; }
  8284.             static inline uint32_t get_DU() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->DU; }
  8285.             static inline void set_DU(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->DU = value; }
  8286.             static inline uint32_t get_HT() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->HT; }
  8287.             static inline void set_HT(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->HT = value; }
  8288.             static inline uint32_t get_HU() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->HU; }
  8289.             static inline void set_HU(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->HU = value; }
  8290.             static inline uint32_t get_MNT() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->MNT; }
  8291.             static inline void set_MNT(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->MNT = value; }
  8292.             static inline uint32_t get_MNU() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->MNU; }
  8293.             static inline void set_MNU(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->MNU = value; }
  8294.             static inline uint32_t get_ST() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->ST; }
  8295.             static inline void set_ST(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->ST = value; }
  8296.             static inline uint32_t get_SU() { return reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->SU; }
  8297.             static inline void set_SU(uint32_t value) { reinterpret_cast<__IO ALRMBR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBR)->SU = value; }
  8298.         };
  8299.         class WPR
  8300.         {
  8301.         private:
  8302.             union WPR_t
  8303.             {
  8304.                 struct
  8305.                 {
  8306.                     uint32_t KEY            : 8;
  8307.                     uint32_t reserved8      : 24;
  8308.                 };
  8309.                 uint32_t RAW;
  8310.             };
  8311.         public:
  8312.             enum class EMasks: uint32_t
  8313.             {
  8314.                 KEY                    = (0xFFU << 0),
  8315.             };
  8316.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WPR; }
  8317.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WPR = value; }
  8318.             static inline uint32_t get_KEY() { return reinterpret_cast<__IO WPR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WPR)->KEY; }
  8319.             static inline void set_KEY(uint32_t value) { reinterpret_cast<__IO WPR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->WPR)->KEY = value; }
  8320.         };
  8321.         class SSR
  8322.         {
  8323.         private:
  8324.             union SSR_t
  8325.             {
  8326.                 struct
  8327.                 {
  8328.                     uint32_t SS             : 16;
  8329.                     uint32_t reserved16     : 16;
  8330.                 };
  8331.                 uint32_t RAW;
  8332.             };
  8333.         public:
  8334.             enum class EMasks: uint32_t
  8335.             {
  8336.                 SS                     = (0xFFFFU << 0),
  8337.             };
  8338.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SSR; }
  8339.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SSR = value; }
  8340.             static inline uint32_t get_SS() { return reinterpret_cast<__IO SSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SSR)->SS; }
  8341.             static inline void set_SS(uint32_t value) { reinterpret_cast<__IO SSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SSR)->SS = value; }
  8342.         };
  8343.         class SHIFTR
  8344.         {
  8345.         private:
  8346.             union SHIFTR_t
  8347.             {
  8348.                 struct
  8349.                 {
  8350.                     uint32_t SUBFS          : 15;
  8351.                     uint32_t reserved15     : 1;
  8352.                     uint32_t reserved16     : 1;
  8353.                     uint32_t reserved17     : 1;
  8354.                     uint32_t reserved18     : 1;
  8355.                     uint32_t reserved19     : 1;
  8356.                     uint32_t reserved20     : 1;
  8357.                     uint32_t reserved21     : 1;
  8358.                     uint32_t reserved22     : 1;
  8359.                     uint32_t reserved23     : 1;
  8360.                     uint32_t reserved24     : 1;
  8361.                     uint32_t reserved25     : 1;
  8362.                     uint32_t reserved26     : 1;
  8363.                     uint32_t reserved27     : 1;
  8364.                     uint32_t reserved28     : 1;
  8365.                     uint32_t reserved29     : 1;
  8366.                     uint32_t reserved30     : 1;
  8367.                     uint32_t ADD1S          : 1;
  8368.                 };
  8369.                 uint32_t RAW;
  8370.             };
  8371.         public:
  8372.             enum class EMasks: uint32_t
  8373.             {
  8374.                 SUBFS                  = (0x7FFFU << 0),
  8375.                 ADD1S                  = (0x1U << 31),
  8376.             };
  8377.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR; }
  8378.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR = value; }
  8379.             template <EMasks ... flags>
  8380.             static inline void set_flags()
  8381.             {
  8382.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR |= SetBits<(std::uint32_t)flags...>();
  8383.             }
  8384.             template <EMasks ... flags>
  8385.             static inline void clear_flags()
  8386.             {
  8387.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR &= ~(SetBits<(std::uint32_t)flags...>());
  8388.             }
  8389.             template <EMasks ... flags>
  8390.             static inline bool get_flags()
  8391.             {
  8392.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8393.             }
  8394.             static inline uint32_t get_SUBFS() { return reinterpret_cast<__IO SHIFTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR)->SUBFS; }
  8395.             static inline void set_SUBFS(uint32_t value) { reinterpret_cast<__IO SHIFTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->SHIFTR)->SUBFS = value; }
  8396.         };
  8397.         class TSTR
  8398.         {
  8399.         private:
  8400.             union TSTR_t
  8401.             {
  8402.                 struct
  8403.                 {
  8404.                     uint32_t reserved0      : 1;
  8405.                     uint32_t reserved1      : 1;
  8406.                     uint32_t reserved2      : 1;
  8407.                     uint32_t reserved3      : 1;
  8408.                     uint32_t reserved4      : 1;
  8409.                     uint32_t reserved5      : 1;
  8410.                     uint32_t reserved6      : 1;
  8411.                     uint32_t reserved7      : 1;
  8412.                     uint32_t reserved8      : 1;
  8413.                     uint32_t reserved9      : 1;
  8414.                     uint32_t reserved10     : 1;
  8415.                     uint32_t reserved11     : 1;
  8416.                     uint32_t reserved12     : 1;
  8417.                     uint32_t reserved13     : 1;
  8418.                     uint32_t reserved14     : 1;
  8419.                     uint32_t reserved15     : 1;
  8420.                     uint32_t reserved16     : 1;
  8421.                     uint32_t reserved17     : 1;
  8422.                     uint32_t reserved18     : 1;
  8423.                     uint32_t reserved19     : 1;
  8424.                     uint32_t reserved20     : 1;
  8425.                     uint32_t reserved21     : 1;
  8426.                     uint32_t PM             : 1;
  8427.                     uint32_t HT             : 2;
  8428.                     uint32_t HU             : 4;
  8429.                     uint32_t MNT            : 3;
  8430.                     uint32_t MNU            : 4;
  8431.                     uint32_t ST             : 3;
  8432.                     uint32_t SU             : 4;
  8433.                 };
  8434.                 uint32_t RAW;
  8435.             };
  8436.         public:
  8437.             enum class EMasks: uint32_t
  8438.             {
  8439.                 PM                     = (0x1U << 22),
  8440.                 HT                     = (0x3U << 20),
  8441.                 HU                     = (0xFU << 16),
  8442.                 MNT                    = (0x7U << 12),
  8443.                 MNU                    = (0xFU << 8),
  8444.                 ST                     = (0x7U << 4),
  8445.                 SU                     = (0xFU << 0),
  8446.             };
  8447.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR; }
  8448.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR = value; }
  8449.             template <EMasks ... flags>
  8450.             static inline void set_flags()
  8451.             {
  8452.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR |= SetBits<(std::uint32_t)flags...>();
  8453.             }
  8454.             template <EMasks ... flags>
  8455.             static inline void clear_flags()
  8456.             {
  8457.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR &= ~(SetBits<(std::uint32_t)flags...>());
  8458.             }
  8459.             template <EMasks ... flags>
  8460.             static inline bool get_flags()
  8461.             {
  8462.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8463.             }
  8464.             static inline uint32_t get_HT() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->HT; }
  8465.             static inline void set_HT(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->HT = value; }
  8466.             static inline uint32_t get_HU() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->HU; }
  8467.             static inline void set_HU(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->HU = value; }
  8468.             static inline uint32_t get_MNT() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->MNT; }
  8469.             static inline void set_MNT(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->MNT = value; }
  8470.             static inline uint32_t get_MNU() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->MNU; }
  8471.             static inline void set_MNU(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->MNU = value; }
  8472.             static inline uint32_t get_ST() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->ST; }
  8473.             static inline void set_ST(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->ST = value; }
  8474.             static inline uint32_t get_SU() { return reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->SU; }
  8475.             static inline void set_SU(uint32_t value) { reinterpret_cast<__IO TSTR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSTR)->SU = value; }
  8476.         };
  8477.         class TSDR
  8478.         {
  8479.         private:
  8480.             union TSDR_t
  8481.             {
  8482.                 struct
  8483.                 {
  8484.                     uint32_t reserved0      : 1;
  8485.                     uint32_t reserved1      : 1;
  8486.                     uint32_t reserved2      : 1;
  8487.                     uint32_t reserved3      : 1;
  8488.                     uint32_t reserved4      : 1;
  8489.                     uint32_t reserved5      : 1;
  8490.                     uint32_t reserved6      : 1;
  8491.                     uint32_t reserved7      : 1;
  8492.                     uint32_t reserved8      : 1;
  8493.                     uint32_t reserved9      : 1;
  8494.                     uint32_t reserved10     : 1;
  8495.                     uint32_t reserved11     : 1;
  8496.                     uint32_t reserved12     : 1;
  8497.                     uint32_t WDU            : 3;
  8498.                     uint32_t MT             : 1;
  8499.                     uint32_t MU             : 4;
  8500.                     uint32_t DT             : 2;
  8501.                     uint32_t DU             : 4;
  8502.                     uint32_t reserved27     : 5;
  8503.                 };
  8504.                 uint32_t RAW;
  8505.             };
  8506.         public:
  8507.             enum class EMasks: uint32_t
  8508.             {
  8509.                 WDU                    = (0x7U << 13),
  8510.                 MT                     = (0x1U << 12),
  8511.                 MU                     = (0xFU << 8),
  8512.                 DT                     = (0x3U << 4),
  8513.                 DU                     = (0xFU << 0),
  8514.             };
  8515.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR; }
  8516.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR = value; }
  8517.             template <EMasks ... flags>
  8518.             static inline void set_flags()
  8519.             {
  8520.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR |= SetBits<(std::uint32_t)flags...>();
  8521.             }
  8522.             template <EMasks ... flags>
  8523.             static inline void clear_flags()
  8524.             {
  8525.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR &= ~(SetBits<(std::uint32_t)flags...>());
  8526.             }
  8527.             template <EMasks ... flags>
  8528.             static inline bool get_flags()
  8529.             {
  8530.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8531.             }
  8532.             static inline uint32_t get_WDU() { return reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->WDU; }
  8533.             static inline void set_WDU(uint32_t value) { reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->WDU = value; }
  8534.             static inline uint32_t get_MU() { return reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->MU; }
  8535.             static inline void set_MU(uint32_t value) { reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->MU = value; }
  8536.             static inline uint32_t get_DT() { return reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->DT; }
  8537.             static inline void set_DT(uint32_t value) { reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->DT = value; }
  8538.             static inline uint32_t get_DU() { return reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->DU; }
  8539.             static inline void set_DU(uint32_t value) { reinterpret_cast<__IO TSDR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSDR)->DU = value; }
  8540.         };
  8541.         class TSSSR
  8542.         {
  8543.         private:
  8544.             union TSSSR_t
  8545.             {
  8546.                 struct
  8547.                 {
  8548.                     uint32_t SS             : 16;
  8549.                     uint32_t reserved16     : 16;
  8550.                 };
  8551.                 uint32_t RAW;
  8552.             };
  8553.         public:
  8554.             enum class EMasks: uint32_t
  8555.             {
  8556.                 SS                     = (0xFFFFU << 0),
  8557.             };
  8558.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSSSR; }
  8559.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSSSR = value; }
  8560.             static inline uint32_t get_SS() { return reinterpret_cast<__IO TSSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSSSR)->SS; }
  8561.             static inline void set_SS(uint32_t value) { reinterpret_cast<__IO TSSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TSSSR)->SS = value; }
  8562.         };
  8563.         class CALR
  8564.         {
  8565.         private:
  8566.             union CALR_t
  8567.             {
  8568.                 struct
  8569.                 {
  8570.                     uint32_t reserved0      : 1;
  8571.                     uint32_t reserved1      : 1;
  8572.                     uint32_t reserved2      : 1;
  8573.                     uint32_t reserved3      : 1;
  8574.                     uint32_t reserved4      : 1;
  8575.                     uint32_t reserved5      : 1;
  8576.                     uint32_t reserved6      : 1;
  8577.                     uint32_t reserved7      : 1;
  8578.                     uint32_t reserved8      : 1;
  8579.                     uint32_t reserved9      : 1;
  8580.                     uint32_t reserved10     : 1;
  8581.                     uint32_t reserved11     : 1;
  8582.                     uint32_t reserved12     : 1;
  8583.                     uint32_t reserved13     : 1;
  8584.                     uint32_t reserved14     : 1;
  8585.                     uint32_t CALP           : 1;
  8586.                     uint32_t CALW8          : 1;
  8587.                     uint32_t CALW16         : 1;
  8588.                     uint32_t CALM           : 9;
  8589.                     uint32_t reserved27     : 5;
  8590.                 };
  8591.                 uint32_t RAW;
  8592.             };
  8593.         public:
  8594.             enum class EMasks: uint32_t
  8595.             {
  8596.                 CALP                   = (0x1U << 15),
  8597.                 CALW8                  = (0x1U << 14),
  8598.                 CALW16                 = (0x1U << 13),
  8599.                 CALM                   = (0x1FFU << 0),
  8600.             };
  8601.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR; }
  8602.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR = value; }
  8603.             template <EMasks ... flags>
  8604.             static inline void set_flags()
  8605.             {
  8606.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR |= SetBits<(std::uint32_t)flags...>();
  8607.             }
  8608.             template <EMasks ... flags>
  8609.             static inline void clear_flags()
  8610.             {
  8611.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR &= ~(SetBits<(std::uint32_t)flags...>());
  8612.             }
  8613.             template <EMasks ... flags>
  8614.             static inline bool get_flags()
  8615.             {
  8616.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8617.             }
  8618.             static inline uint32_t get_CALM() { return reinterpret_cast<__IO CALR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR)->CALM; }
  8619.             static inline void set_CALM(uint32_t value) { reinterpret_cast<__IO CALR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->CALR)->CALM = value; }
  8620.         };
  8621.         class TAFCR
  8622.         {
  8623.         private:
  8624.             union TAFCR_t
  8625.             {
  8626.                 struct
  8627.                 {
  8628.                     uint32_t reserved0      : 1;
  8629.                     uint32_t reserved1      : 1;
  8630.                     uint32_t reserved2      : 1;
  8631.                     uint32_t reserved3      : 1;
  8632.                     uint32_t reserved4      : 1;
  8633.                     uint32_t reserved5      : 1;
  8634.                     uint32_t reserved6      : 1;
  8635.                     uint32_t reserved7      : 1;
  8636.                     uint32_t reserved8      : 1;
  8637.                     uint32_t reserved9      : 1;
  8638.                     uint32_t reserved10     : 1;
  8639.                     uint32_t reserved11     : 1;
  8640.                     uint32_t reserved12     : 1;
  8641.                     uint32_t reserved13     : 1;
  8642.                     uint32_t reserved14     : 1;
  8643.                     uint32_t reserved15     : 1;
  8644.                     uint32_t reserved16     : 1;
  8645.                     uint32_t reserved17     : 1;
  8646.                     uint32_t ALARMOUTTYPE   : 1;
  8647.                     uint32_t TSINSEL        : 1;
  8648.                     uint32_t TAMP1INSEL     : 1;
  8649.                     uint32_t TAMPPUDIS      : 1;
  8650.                     uint32_t TAMPPRCH       : 2;
  8651.                     uint32_t TAMPFLT        : 2;
  8652.                     uint32_t TAMPFREQ       : 3;
  8653.                     uint32_t TAMPTS         : 1;
  8654.                     uint32_t TAMP2TRG       : 1;
  8655.                     uint32_t TAMP2E         : 1;
  8656.                     uint32_t TAMPIE         : 1;
  8657.                     uint32_t TAMP1TRG       : 1;
  8658.                     uint32_t TAMP1E         : 1;
  8659.                 };
  8660.                 uint32_t RAW;
  8661.             };
  8662.         public:
  8663.             enum class EMasks: uint32_t
  8664.             {
  8665.                 ALARMOUTTYPE           = (0x1U << 18),
  8666.                 TSINSEL                = (0x1U << 17),
  8667.                 TAMP1INSEL             = (0x1U << 16),
  8668.                 TAMPPUDIS              = (0x1U << 15),
  8669.                 TAMPPRCH               = (0x3U << 13),
  8670.                 TAMPFLT                = (0x3U << 11),
  8671.                 TAMPFREQ               = (0x7U << 8),
  8672.                 TAMPTS                 = (0x1U << 7),
  8673.                 TAMP2TRG               = (0x1U << 4),
  8674.                 TAMP2E                 = (0x1U << 3),
  8675.                 TAMPIE                 = (0x1U << 2),
  8676.                 TAMP1TRG               = (0x1U << 1),
  8677.                 TAMP1E                 = (0x1U << 0),
  8678.             };
  8679.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR; }
  8680.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR = value; }
  8681.             template <EMasks ... flags>
  8682.             static inline void set_flags()
  8683.             {
  8684.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR |= SetBits<(std::uint32_t)flags...>();
  8685.             }
  8686.             template <EMasks ... flags>
  8687.             static inline void clear_flags()
  8688.             {
  8689.                 reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR &= ~(SetBits<(std::uint32_t)flags...>());
  8690.             }
  8691.             template <EMasks ... flags>
  8692.             static inline bool get_flags()
  8693.             {
  8694.                 return ((reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  8695.             }
  8696.             static inline uint32_t get_TAMPPRCH() { return reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPPRCH; }
  8697.             static inline void set_TAMPPRCH(uint32_t value) { reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPPRCH = value; }
  8698.             static inline uint32_t get_TAMPFLT() { return reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPFLT; }
  8699.             static inline void set_TAMPFLT(uint32_t value) { reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPFLT = value; }
  8700.             static inline uint32_t get_TAMPFREQ() { return reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPFREQ; }
  8701.             static inline void set_TAMPFREQ(uint32_t value) { reinterpret_cast<__IO TAFCR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->TAFCR)->TAMPFREQ = value; }
  8702.         };
  8703.         class ALRMASSR
  8704.         {
  8705.         private:
  8706.             union ALRMASSR_t
  8707.             {
  8708.                 struct
  8709.                 {
  8710.                     uint32_t reserved0      : 1;
  8711.                     uint32_t reserved1      : 1;
  8712.                     uint32_t reserved2      : 1;
  8713.                     uint32_t reserved3      : 1;
  8714.                     uint32_t reserved4      : 1;
  8715.                     uint32_t reserved5      : 1;
  8716.                     uint32_t reserved6      : 1;
  8717.                     uint32_t reserved7      : 1;
  8718.                     uint32_t reserved8      : 1;
  8719.                     uint32_t reserved9      : 1;
  8720.                     uint32_t reserved10     : 1;
  8721.                     uint32_t reserved11     : 1;
  8722.                     uint32_t reserved12     : 1;
  8723.                     uint32_t reserved13     : 1;
  8724.                     uint32_t reserved14     : 1;
  8725.                     uint32_t reserved15     : 1;
  8726.                     uint32_t reserved16     : 1;
  8727.                     uint32_t reserved17     : 1;
  8728.                     uint32_t reserved18     : 1;
  8729.                     uint32_t reserved19     : 1;
  8730.                     uint32_t reserved20     : 1;
  8731.                     uint32_t reserved21     : 1;
  8732.                     uint32_t reserved22     : 1;
  8733.                     uint32_t reserved23     : 1;
  8734.                     uint32_t MASKSS         : 4;
  8735.                     uint32_t SS             : 15;
  8736.                 };
  8737.                 uint32_t RAW;
  8738.             };
  8739.         public:
  8740.             enum class EMasks: uint32_t
  8741.             {
  8742.                 MASKSS                 = (0xFU << 24),
  8743.                 SS                     = (0x7FFFU << 0),
  8744.             };
  8745.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR; }
  8746.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR = value; }
  8747.             static inline uint32_t get_MASKSS() { return reinterpret_cast<__IO ALRMASSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR)->MASKSS; }
  8748.             static inline void set_MASKSS(uint32_t value) { reinterpret_cast<__IO ALRMASSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR)->MASKSS = value; }
  8749.             static inline uint32_t get_SS() { return reinterpret_cast<__IO ALRMASSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR)->SS; }
  8750.             static inline void set_SS(uint32_t value) { reinterpret_cast<__IO ALRMASSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMASSR)->SS = value; }
  8751.         };
  8752.         class ALRMBSSR
  8753.         {
  8754.         private:
  8755.             union ALRMBSSR_t
  8756.             {
  8757.                 struct
  8758.                 {
  8759.                     uint32_t reserved0      : 1;
  8760.                     uint32_t reserved1      : 1;
  8761.                     uint32_t reserved2      : 1;
  8762.                     uint32_t reserved3      : 1;
  8763.                     uint32_t reserved4      : 1;
  8764.                     uint32_t reserved5      : 1;
  8765.                     uint32_t reserved6      : 1;
  8766.                     uint32_t reserved7      : 1;
  8767.                     uint32_t reserved8      : 1;
  8768.                     uint32_t reserved9      : 1;
  8769.                     uint32_t reserved10     : 1;
  8770.                     uint32_t reserved11     : 1;
  8771.                     uint32_t reserved12     : 1;
  8772.                     uint32_t reserved13     : 1;
  8773.                     uint32_t reserved14     : 1;
  8774.                     uint32_t reserved15     : 1;
  8775.                     uint32_t reserved16     : 1;
  8776.                     uint32_t reserved17     : 1;
  8777.                     uint32_t reserved18     : 1;
  8778.                     uint32_t reserved19     : 1;
  8779.                     uint32_t reserved20     : 1;
  8780.                     uint32_t reserved21     : 1;
  8781.                     uint32_t reserved22     : 1;
  8782.                     uint32_t reserved23     : 1;
  8783.                     uint32_t MASKSS         : 4;
  8784.                     uint32_t SS             : 15;
  8785.                 };
  8786.                 uint32_t RAW;
  8787.             };
  8788.         public:
  8789.             enum class EMasks: uint32_t
  8790.             {
  8791.                 MASKSS                 = (0xFU << 24),
  8792.                 SS                     = (0x7FFFU << 0),
  8793.             };
  8794.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR; }
  8795.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR = value; }
  8796.             static inline uint32_t get_MASKSS() { return reinterpret_cast<__IO ALRMBSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR)->MASKSS; }
  8797.             static inline void set_MASKSS(uint32_t value) { reinterpret_cast<__IO ALRMBSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR)->MASKSS = value; }
  8798.             static inline uint32_t get_SS() { return reinterpret_cast<__IO ALRMBSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR)->SS; }
  8799.             static inline void set_SS(uint32_t value) { reinterpret_cast<__IO ALRMBSSR_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->ALRMBSSR)->SS = value; }
  8800.         };
  8801.         class BKP0R
  8802.         {
  8803.         private:
  8804.             union BKP0R_t
  8805.             {
  8806.                 struct
  8807.                 {
  8808.                     uint32_t DATA           : 32;
  8809.                 };
  8810.                 uint32_t RAW;
  8811.             };
  8812.         public:
  8813.             enum class EMasks: uint32_t
  8814.             {
  8815.                 DATA                   = (0xFFFFFFFFU << 0),
  8816.             };
  8817.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP0R; }
  8818.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP0R = value; }
  8819.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP0R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP0R)->DATA; }
  8820.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP0R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP0R)->DATA = value; }
  8821.         };
  8822.         class BKP1R
  8823.         {
  8824.         private:
  8825.             union BKP1R_t
  8826.             {
  8827.                 struct
  8828.                 {
  8829.                     uint32_t DATA           : 32;
  8830.                 };
  8831.                 uint32_t RAW;
  8832.             };
  8833.         public:
  8834.             enum class EMasks: uint32_t
  8835.             {
  8836.                 DATA                   = (0xFFFFFFFFU << 0),
  8837.             };
  8838.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP1R; }
  8839.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP1R = value; }
  8840.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP1R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP1R)->DATA; }
  8841.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP1R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP1R)->DATA = value; }
  8842.         };
  8843.         class BKP2R
  8844.         {
  8845.         private:
  8846.             union BKP2R_t
  8847.             {
  8848.                 struct
  8849.                 {
  8850.                     uint32_t DATA           : 32;
  8851.                 };
  8852.                 uint32_t RAW;
  8853.             };
  8854.         public:
  8855.             enum class EMasks: uint32_t
  8856.             {
  8857.                 DATA                   = (0xFFFFFFFFU << 0),
  8858.             };
  8859.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP2R; }
  8860.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP2R = value; }
  8861.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP2R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP2R)->DATA; }
  8862.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP2R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP2R)->DATA = value; }
  8863.         };
  8864.         class BKP3R
  8865.         {
  8866.         private:
  8867.             union BKP3R_t
  8868.             {
  8869.                 struct
  8870.                 {
  8871.                     uint32_t DATA           : 32;
  8872.                 };
  8873.                 uint32_t RAW;
  8874.             };
  8875.         public:
  8876.             enum class EMasks: uint32_t
  8877.             {
  8878.                 DATA                   = (0xFFFFFFFFU << 0),
  8879.             };
  8880.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP3R; }
  8881.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP3R = value; }
  8882.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP3R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP3R)->DATA; }
  8883.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP3R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP3R)->DATA = value; }
  8884.         };
  8885.         class BKP4R
  8886.         {
  8887.         private:
  8888.             union BKP4R_t
  8889.             {
  8890.                 struct
  8891.                 {
  8892.                     uint32_t DATA           : 32;
  8893.                 };
  8894.                 uint32_t RAW;
  8895.             };
  8896.         public:
  8897.             enum class EMasks: uint32_t
  8898.             {
  8899.                 DATA                   = (0xFFFFFFFFU << 0),
  8900.             };
  8901.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP4R; }
  8902.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP4R = value; }
  8903.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP4R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP4R)->DATA; }
  8904.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP4R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP4R)->DATA = value; }
  8905.         };
  8906.         class BKP5R
  8907.         {
  8908.         private:
  8909.             union BKP5R_t
  8910.             {
  8911.                 struct
  8912.                 {
  8913.                     uint32_t DATA           : 32;
  8914.                 };
  8915.                 uint32_t RAW;
  8916.             };
  8917.         public:
  8918.             enum class EMasks: uint32_t
  8919.             {
  8920.                 DATA                   = (0xFFFFFFFFU << 0),
  8921.             };
  8922.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP5R; }
  8923.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP5R = value; }
  8924.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP5R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP5R)->DATA; }
  8925.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP5R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP5R)->DATA = value; }
  8926.         };
  8927.         class BKP6R
  8928.         {
  8929.         private:
  8930.             union BKP6R_t
  8931.             {
  8932.                 struct
  8933.                 {
  8934.                     uint32_t DATA           : 32;
  8935.                 };
  8936.                 uint32_t RAW;
  8937.             };
  8938.         public:
  8939.             enum class EMasks: uint32_t
  8940.             {
  8941.                 DATA                   = (0xFFFFFFFFU << 0),
  8942.             };
  8943.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP6R; }
  8944.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP6R = value; }
  8945.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP6R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP6R)->DATA; }
  8946.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP6R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP6R)->DATA = value; }
  8947.         };
  8948.         class BKP7R
  8949.         {
  8950.         private:
  8951.             union BKP7R_t
  8952.             {
  8953.                 struct
  8954.                 {
  8955.                     uint32_t DATA           : 32;
  8956.                 };
  8957.                 uint32_t RAW;
  8958.             };
  8959.         public:
  8960.             enum class EMasks: uint32_t
  8961.             {
  8962.                 DATA                   = (0xFFFFFFFFU << 0),
  8963.             };
  8964.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP7R; }
  8965.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP7R = value; }
  8966.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP7R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP7R)->DATA; }
  8967.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP7R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP7R)->DATA = value; }
  8968.         };
  8969.         class BKP8R
  8970.         {
  8971.         private:
  8972.             union BKP8R_t
  8973.             {
  8974.                 struct
  8975.                 {
  8976.                     uint32_t DATA           : 32;
  8977.                 };
  8978.                 uint32_t RAW;
  8979.             };
  8980.         public:
  8981.             enum class EMasks: uint32_t
  8982.             {
  8983.                 DATA                   = (0xFFFFFFFFU << 0),
  8984.             };
  8985.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP8R; }
  8986.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP8R = value; }
  8987.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP8R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP8R)->DATA; }
  8988.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP8R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP8R)->DATA = value; }
  8989.         };
  8990.         class BKP9R
  8991.         {
  8992.         private:
  8993.             union BKP9R_t
  8994.             {
  8995.                 struct
  8996.                 {
  8997.                     uint32_t DATA           : 32;
  8998.                 };
  8999.                 uint32_t RAW;
  9000.             };
  9001.         public:
  9002.             enum class EMasks: uint32_t
  9003.             {
  9004.                 DATA                   = (0xFFFFFFFFU << 0),
  9005.             };
  9006.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP9R; }
  9007.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP9R = value; }
  9008.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP9R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP9R)->DATA; }
  9009.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP9R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP9R)->DATA = value; }
  9010.         };
  9011.         class BKP10R
  9012.         {
  9013.         private:
  9014.             union BKP10R_t
  9015.             {
  9016.                 struct
  9017.                 {
  9018.                     uint32_t DATA           : 32;
  9019.                 };
  9020.                 uint32_t RAW;
  9021.             };
  9022.         public:
  9023.             enum class EMasks: uint32_t
  9024.             {
  9025.                 DATA                   = (0xFFFFFFFFU << 0),
  9026.             };
  9027.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP10R; }
  9028.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP10R = value; }
  9029.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP10R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP10R)->DATA; }
  9030.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP10R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP10R)->DATA = value; }
  9031.         };
  9032.         class BKP11R
  9033.         {
  9034.         private:
  9035.             union BKP11R_t
  9036.             {
  9037.                 struct
  9038.                 {
  9039.                     uint32_t DATA           : 32;
  9040.                 };
  9041.                 uint32_t RAW;
  9042.             };
  9043.         public:
  9044.             enum class EMasks: uint32_t
  9045.             {
  9046.                 DATA                   = (0xFFFFFFFFU << 0),
  9047.             };
  9048.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP11R; }
  9049.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP11R = value; }
  9050.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP11R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP11R)->DATA; }
  9051.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP11R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP11R)->DATA = value; }
  9052.         };
  9053.         class BKP12R
  9054.         {
  9055.         private:
  9056.             union BKP12R_t
  9057.             {
  9058.                 struct
  9059.                 {
  9060.                     uint32_t DATA           : 32;
  9061.                 };
  9062.                 uint32_t RAW;
  9063.             };
  9064.         public:
  9065.             enum class EMasks: uint32_t
  9066.             {
  9067.                 DATA                   = (0xFFFFFFFFU << 0),
  9068.             };
  9069.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP12R; }
  9070.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP12R = value; }
  9071.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP12R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP12R)->DATA; }
  9072.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP12R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP12R)->DATA = value; }
  9073.         };
  9074.         class BKP13R
  9075.         {
  9076.         private:
  9077.             union BKP13R_t
  9078.             {
  9079.                 struct
  9080.                 {
  9081.                     uint32_t DATA           : 32;
  9082.                 };
  9083.                 uint32_t RAW;
  9084.             };
  9085.         public:
  9086.             enum class EMasks: uint32_t
  9087.             {
  9088.                 DATA                   = (0xFFFFFFFFU << 0),
  9089.             };
  9090.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP13R; }
  9091.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP13R = value; }
  9092.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP13R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP13R)->DATA; }
  9093.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP13R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP13R)->DATA = value; }
  9094.         };
  9095.         class BKP14R
  9096.         {
  9097.         private:
  9098.             union BKP14R_t
  9099.             {
  9100.                 struct
  9101.                 {
  9102.                     uint32_t DATA           : 32;
  9103.                 };
  9104.                 uint32_t RAW;
  9105.             };
  9106.         public:
  9107.             enum class EMasks: uint32_t
  9108.             {
  9109.                 DATA                   = (0xFFFFFFFFU << 0),
  9110.             };
  9111.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP14R; }
  9112.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP14R = value; }
  9113.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP14R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP14R)->DATA; }
  9114.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP14R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP14R)->DATA = value; }
  9115.         };
  9116.         class BKP15R
  9117.         {
  9118.         private:
  9119.             union BKP15R_t
  9120.             {
  9121.                 struct
  9122.                 {
  9123.                     uint32_t DATA           : 32;
  9124.                 };
  9125.                 uint32_t RAW;
  9126.             };
  9127.         public:
  9128.             enum class EMasks: uint32_t
  9129.             {
  9130.                 DATA                   = (0xFFFFFFFFU << 0),
  9131.             };
  9132.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP15R; }
  9133.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP15R = value; }
  9134.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP15R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP15R)->DATA; }
  9135.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP15R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP15R)->DATA = value; }
  9136.         };
  9137.         class BKP16R
  9138.         {
  9139.         private:
  9140.             union BKP16R_t
  9141.             {
  9142.                 struct
  9143.                 {
  9144.                     uint32_t DATA           : 32;
  9145.                 };
  9146.                 uint32_t RAW;
  9147.             };
  9148.         public:
  9149.             enum class EMasks: uint32_t
  9150.             {
  9151.                 DATA                   = (0xFFFFFFFFU << 0),
  9152.             };
  9153.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP16R; }
  9154.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP16R = value; }
  9155.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP16R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP16R)->DATA; }
  9156.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP16R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP16R)->DATA = value; }
  9157.         };
  9158.         class BKP17R
  9159.         {
  9160.         private:
  9161.             union BKP17R_t
  9162.             {
  9163.                 struct
  9164.                 {
  9165.                     uint32_t DATA           : 32;
  9166.                 };
  9167.                 uint32_t RAW;
  9168.             };
  9169.         public:
  9170.             enum class EMasks: uint32_t
  9171.             {
  9172.                 DATA                   = (0xFFFFFFFFU << 0),
  9173.             };
  9174.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP17R; }
  9175.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP17R = value; }
  9176.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP17R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP17R)->DATA; }
  9177.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP17R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP17R)->DATA = value; }
  9178.         };
  9179.         class BKP18R
  9180.         {
  9181.         private:
  9182.             union BKP18R_t
  9183.             {
  9184.                 struct
  9185.                 {
  9186.                     uint32_t DATA           : 32;
  9187.                 };
  9188.                 uint32_t RAW;
  9189.             };
  9190.         public:
  9191.             enum class EMasks: uint32_t
  9192.             {
  9193.                 DATA                   = (0xFFFFFFFFU << 0),
  9194.             };
  9195.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP18R; }
  9196.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP18R = value; }
  9197.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP18R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP18R)->DATA; }
  9198.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP18R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP18R)->DATA = value; }
  9199.         };
  9200.         class BKP19R
  9201.         {
  9202.         private:
  9203.             union BKP19R_t
  9204.             {
  9205.                 struct
  9206.                 {
  9207.                     uint32_t DATA           : 32;
  9208.                 };
  9209.                 uint32_t RAW;
  9210.             };
  9211.         public:
  9212.             enum class EMasks: uint32_t
  9213.             {
  9214.                 DATA                   = (0xFFFFFFFFU << 0),
  9215.             };
  9216.             static inline uint32_t get() { return reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP19R; }
  9217.             static inline void set(uint32_t value) { reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP19R = value; }
  9218.             static inline uint32_t get_DATA() { return reinterpret_cast<__IO BKP19R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP19R)->DATA; }
  9219.             static inline void set_DATA(uint32_t value) { reinterpret_cast<__IO BKP19R_t*>(&reinterpret_cast<RTC_t*>(STM32::RTC_BASE)->BKP19R)->DATA = value; }
  9220.         };
  9221.     };
  9222.     /* SDIO DEFINITION */
  9223.     class SDIO
  9224.     {
  9225.     private:
  9226.         struct SDIO_t
  9227.         {
  9228.             __IO uint32_t                 POWER;
  9229.             __IO uint32_t                 CLKCR;
  9230.             __IO uint32_t                 ARG;
  9231.             __IO uint32_t                 CMD;
  9232.             const uint32_t                RESPCMD;
  9233.             const uint32_t                RESP1;
  9234.             const uint32_t                RESP2;
  9235.             const uint32_t                RESP3;
  9236.             const uint32_t                RESP4;
  9237.             __IO uint32_t                 DTIMER;
  9238.             __IO uint32_t                 DLEN;
  9239.             __IO uint32_t                 DCTRL;
  9240.             const uint32_t                DCOUNT;
  9241.             const uint32_t                STA;
  9242.             __IO uint32_t                 ICR;
  9243.             __IO uint32_t                 MASK;
  9244.             uint32_t                      RESERVED0[2];
  9245.             const uint32_t                FIFOCNT;
  9246.             uint32_t                      RESERVED1[13];
  9247.             __IO uint32_t                 FIFO;
  9248.         };
  9249.     public:
  9250.         class POWER
  9251.         {
  9252.         private:
  9253.             union POWER_t
  9254.             {
  9255.                 struct
  9256.                 {
  9257.                     uint32_t PWRCTRL        : 2;
  9258.                     uint32_t reserved2      : 30;
  9259.                 };
  9260.                 uint32_t RAW;
  9261.             };
  9262.         public:
  9263.             enum class EMasks: uint32_t
  9264.             {
  9265.                 PWRCTRL                = (0x3U << 0),
  9266.             };
  9267.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->POWER; }
  9268.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->POWER = value; }
  9269.             static inline uint32_t get_PWRCTRL() { return reinterpret_cast<__IO POWER_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->POWER)->PWRCTRL; }
  9270.             static inline void set_PWRCTRL(uint32_t value) { reinterpret_cast<__IO POWER_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->POWER)->PWRCTRL = value; }
  9271.         };
  9272.         class CLKCR
  9273.         {
  9274.         private:
  9275.             union CLKCR_t
  9276.             {
  9277.                 struct
  9278.                 {
  9279.                     uint32_t CLKDIV         : 8;
  9280.                     uint32_t CLKEN          : 1;
  9281.                     uint32_t PWRSAV         : 1;
  9282.                     uint32_t BYPASS         : 1;
  9283.                     uint32_t WIDBUS         : 2;
  9284.                     uint32_t NEGEDGE        : 1;
  9285.                     uint32_t HWFC_EN        : 1;
  9286.                     uint32_t reserved15     : 17;
  9287.                 };
  9288.                 uint32_t RAW;
  9289.             };
  9290.         public:
  9291.             enum class EMasks: uint32_t
  9292.             {
  9293.                 CLKDIV                 = (0xFFU << 0),
  9294.                 CLKEN                  = (0x1U << 8),
  9295.                 PWRSAV                 = (0x1U << 9),
  9296.                 BYPASS                 = (0x1U << 10),
  9297.                 WIDBUS                 = (0x3U << 11),
  9298.                 NEGEDGE                = (0x1U << 13),
  9299.                 HWFC_EN                = (0x1U << 14),
  9300.             };
  9301.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR; }
  9302.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR = value; }
  9303.             template <EMasks ... flags>
  9304.             static inline void set_flags()
  9305.             {
  9306.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR |= SetBits<(std::uint32_t)flags...>();
  9307.             }
  9308.             template <EMasks ... flags>
  9309.             static inline void clear_flags()
  9310.             {
  9311.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR &= ~(SetBits<(std::uint32_t)flags...>());
  9312.             }
  9313.             template <EMasks ... flags>
  9314.             static inline bool get_flags()
  9315.             {
  9316.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9317.             }
  9318.             static inline uint32_t get_CLKDIV() { return reinterpret_cast<__IO CLKCR_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR)->CLKDIV; }
  9319.             static inline void set_CLKDIV(uint32_t value) { reinterpret_cast<__IO CLKCR_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR)->CLKDIV = value; }
  9320.             static inline uint32_t get_WIDBUS() { return reinterpret_cast<__IO CLKCR_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR)->WIDBUS; }
  9321.             static inline void set_WIDBUS(uint32_t value) { reinterpret_cast<__IO CLKCR_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CLKCR)->WIDBUS = value; }
  9322.         };
  9323.         class ARG
  9324.         {
  9325.         private:
  9326.             union ARG_t
  9327.             {
  9328.                 struct
  9329.                 {
  9330.                     uint32_t CMDARG         : 32;
  9331.                 };
  9332.                 uint32_t RAW;
  9333.             };
  9334.         public:
  9335.             enum class EMasks: uint32_t
  9336.             {
  9337.                 CMDARG                 = (0xFFFFFFFFU << 0),
  9338.             };
  9339.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ARG; }
  9340.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ARG = value; }
  9341.             static inline uint32_t get_CMDARG() { return reinterpret_cast<__IO ARG_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ARG)->CMDARG; }
  9342.             static inline void set_CMDARG(uint32_t value) { reinterpret_cast<__IO ARG_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ARG)->CMDARG = value; }
  9343.         };
  9344.         class CMD
  9345.         {
  9346.         private:
  9347.             union CMD_t
  9348.             {
  9349.                 struct
  9350.                 {
  9351.                     uint32_t CMDINDEX       : 6;
  9352.                     uint32_t WAITRESP       : 2;
  9353.                     uint32_t WAITINT        : 1;
  9354.                     uint32_t WAITPEND       : 1;
  9355.                     uint32_t CPSMEN         : 1;
  9356.                     uint32_t SDIOSUSPEND    : 1;
  9357.                     uint32_t ENCMDCOMPL     : 1;
  9358.                     uint32_t NIEN           : 1;
  9359.                     uint32_t CEATACMD       : 1;
  9360.                     uint32_t reserved15     : 17;
  9361.                 };
  9362.                 uint32_t RAW;
  9363.             };
  9364.         public:
  9365.             enum class EMasks: uint32_t
  9366.             {
  9367.                 CMDINDEX               = (0x3FU << 0),
  9368.                 WAITRESP               = (0x3U << 6),
  9369.                 WAITINT                = (0x1U << 8),
  9370.                 WAITPEND               = (0x1U << 9),
  9371.                 CPSMEN                 = (0x1U << 10),
  9372.                 SDIOSUSPEND            = (0x1U << 11),
  9373.                 ENCMDCOMPL             = (0x1U << 12),
  9374.                 NIEN                   = (0x1U << 13),
  9375.                 CEATACMD               = (0x1U << 14),
  9376.             };
  9377.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD; }
  9378.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD = value; }
  9379.             template <EMasks ... flags>
  9380.             static inline void set_flags()
  9381.             {
  9382.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD |= SetBits<(std::uint32_t)flags...>();
  9383.             }
  9384.             template <EMasks ... flags>
  9385.             static inline void clear_flags()
  9386.             {
  9387.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD &= ~(SetBits<(std::uint32_t)flags...>());
  9388.             }
  9389.             template <EMasks ... flags>
  9390.             static inline bool get_flags()
  9391.             {
  9392.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9393.             }
  9394.             static inline uint32_t get_CMDINDEX() { return reinterpret_cast<__IO CMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD)->CMDINDEX; }
  9395.             static inline void set_CMDINDEX(uint32_t value) { reinterpret_cast<__IO CMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD)->CMDINDEX = value; }
  9396.             static inline uint32_t get_WAITRESP() { return reinterpret_cast<__IO CMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD)->WAITRESP; }
  9397.             static inline void set_WAITRESP(uint32_t value) { reinterpret_cast<__IO CMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->CMD)->WAITRESP = value; }
  9398.         };
  9399.         class RESPCMD
  9400.         {
  9401.         private:
  9402.             union RESPCMD_t
  9403.             {
  9404.                 struct
  9405.                 {
  9406.                     uint32_t RESPCMD        : 6;
  9407.                     uint32_t CARDSTATUS0    : 32;
  9408.                 };
  9409.                 uint32_t RAW;
  9410.             };
  9411.         public:
  9412.             enum class EMasks: uint32_t
  9413.             {
  9414.                 RESPCMD                = (0x3FU << 0),
  9415.                 CARDSTATUS0            = (0xFFFFFFFFU << 0),
  9416.             };
  9417.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESPCMD; }
  9418.             static inline uint32_t get_RESPCMD() { return reinterpret_cast<const RESPCMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESPCMD)->RESPCMD; }
  9419.             static inline uint32_t get_CARDSTATUS0() { return reinterpret_cast<const RESPCMD_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESPCMD)->CARDSTATUS0; }
  9420.         };
  9421.         class RESP1
  9422.         {
  9423.         private:
  9424.             union RESP1_t
  9425.             {
  9426.                 struct
  9427.                 {
  9428.                     uint32_t CARDSTATUS1    : 32;
  9429.                 };
  9430.                 uint32_t RAW;
  9431.             };
  9432.         public:
  9433.             enum class EMasks: uint32_t
  9434.             {
  9435.                 CARDSTATUS1            = (0xFFFFFFFFU << 0),
  9436.             };
  9437.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP1; }
  9438.             static inline uint32_t get_CARDSTATUS1() { return reinterpret_cast<const RESP1_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP1)->CARDSTATUS1; }
  9439.         };
  9440.         class RESP2
  9441.         {
  9442.         private:
  9443.             union RESP2_t
  9444.             {
  9445.                 struct
  9446.                 {
  9447.                     uint32_t CARDSTATUS2    : 32;
  9448.                 };
  9449.                 uint32_t RAW;
  9450.             };
  9451.         public:
  9452.             enum class EMasks: uint32_t
  9453.             {
  9454.                 CARDSTATUS2            = (0xFFFFFFFFU << 0),
  9455.             };
  9456.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP2; }
  9457.             static inline uint32_t get_CARDSTATUS2() { return reinterpret_cast<const RESP2_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP2)->CARDSTATUS2; }
  9458.         };
  9459.         class RESP3
  9460.         {
  9461.         private:
  9462.             union RESP3_t
  9463.             {
  9464.                 struct
  9465.                 {
  9466.                     uint32_t CARDSTATUS3    : 32;
  9467.                 };
  9468.                 uint32_t RAW;
  9469.             };
  9470.         public:
  9471.             enum class EMasks: uint32_t
  9472.             {
  9473.                 CARDSTATUS3            = (0xFFFFFFFFU << 0),
  9474.             };
  9475.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP3; }
  9476.             static inline uint32_t get_CARDSTATUS3() { return reinterpret_cast<const RESP3_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP3)->CARDSTATUS3; }
  9477.         };
  9478.         class RESP4
  9479.         {
  9480.         private:
  9481.             union RESP4_t
  9482.             {
  9483.                 struct
  9484.                 {
  9485.                     uint32_t CARDSTATUS4    : 32;
  9486.                 };
  9487.                 uint32_t RAW;
  9488.             };
  9489.         public:
  9490.             enum class EMasks: uint32_t
  9491.             {
  9492.                 CARDSTATUS4            = (0xFFFFFFFFU << 0),
  9493.             };
  9494.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP4; }
  9495.             static inline uint32_t get_CARDSTATUS4() { return reinterpret_cast<const RESP4_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->RESP4)->CARDSTATUS4; }
  9496.         };
  9497.         class DTIMER
  9498.         {
  9499.         private:
  9500.             union DTIMER_t
  9501.             {
  9502.                 struct
  9503.                 {
  9504.                     uint32_t DATATIME       : 32;
  9505.                 };
  9506.                 uint32_t RAW;
  9507.             };
  9508.         public:
  9509.             enum class EMasks: uint32_t
  9510.             {
  9511.                 DATATIME               = (0xFFFFFFFFU << 0),
  9512.             };
  9513.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DTIMER; }
  9514.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DTIMER = value; }
  9515.             static inline uint32_t get_DATATIME() { return reinterpret_cast<__IO DTIMER_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DTIMER)->DATATIME; }
  9516.             static inline void set_DATATIME(uint32_t value) { reinterpret_cast<__IO DTIMER_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DTIMER)->DATATIME = value; }
  9517.         };
  9518.         class DLEN
  9519.         {
  9520.         private:
  9521.             union DLEN_t
  9522.             {
  9523.                 struct
  9524.                 {
  9525.                     uint32_t DATALENGTH     : 25;
  9526.                     uint32_t reserved25     : 7;
  9527.                 };
  9528.                 uint32_t RAW;
  9529.             };
  9530.         public:
  9531.             enum class EMasks: uint32_t
  9532.             {
  9533.                 DATALENGTH             = (0x1FFFFFFU << 0),
  9534.             };
  9535.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DLEN; }
  9536.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DLEN = value; }
  9537.             static inline uint32_t get_DATALENGTH() { return reinterpret_cast<__IO DLEN_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DLEN)->DATALENGTH; }
  9538.             static inline void set_DATALENGTH(uint32_t value) { reinterpret_cast<__IO DLEN_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DLEN)->DATALENGTH = value; }
  9539.         };
  9540.         class DCTRL
  9541.         {
  9542.         private:
  9543.             union DCTRL_t
  9544.             {
  9545.                 struct
  9546.                 {
  9547.                     uint32_t DTEN           : 1;
  9548.                     uint32_t DTDIR          : 1;
  9549.                     uint32_t DTMODE         : 1;
  9550.                     uint32_t DMAEN          : 1;
  9551.                     uint32_t DBLOCKSIZE     : 4;
  9552.                     uint32_t RWSTART        : 1;
  9553.                     uint32_t RWSTOP         : 1;
  9554.                     uint32_t RWMOD          : 1;
  9555.                     uint32_t SDIOEN         : 1;
  9556.                     uint32_t reserved12     : 20;
  9557.                 };
  9558.                 uint32_t RAW;
  9559.             };
  9560.         public:
  9561.             enum class EMasks: uint32_t
  9562.             {
  9563.                 DTEN                   = (0x1U << 0),
  9564.                 DTDIR                  = (0x1U << 1),
  9565.                 DTMODE                 = (0x1U << 2),
  9566.                 DMAEN                  = (0x1U << 3),
  9567.                 DBLOCKSIZE             = (0xFU << 4),
  9568.                 RWSTART                = (0x1U << 8),
  9569.                 RWSTOP                 = (0x1U << 9),
  9570.                 RWMOD                  = (0x1U << 10),
  9571.                 SDIOEN                 = (0x1U << 11),
  9572.             };
  9573.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL; }
  9574.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL = value; }
  9575.             template <EMasks ... flags>
  9576.             static inline void set_flags()
  9577.             {
  9578.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL |= SetBits<(std::uint32_t)flags...>();
  9579.             }
  9580.             template <EMasks ... flags>
  9581.             static inline void clear_flags()
  9582.             {
  9583.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL &= ~(SetBits<(std::uint32_t)flags...>());
  9584.             }
  9585.             template <EMasks ... flags>
  9586.             static inline bool get_flags()
  9587.             {
  9588.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9589.             }
  9590.             static inline uint32_t get_DBLOCKSIZE() { return reinterpret_cast<__IO DCTRL_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL)->DBLOCKSIZE; }
  9591.             static inline void set_DBLOCKSIZE(uint32_t value) { reinterpret_cast<__IO DCTRL_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCTRL)->DBLOCKSIZE = value; }
  9592.         };
  9593.         class DCOUNT
  9594.         {
  9595.         private:
  9596.             union DCOUNT_t
  9597.             {
  9598.                 struct
  9599.                 {
  9600.                     uint32_t DATACOUNT      : 25;
  9601.                     uint32_t reserved25     : 7;
  9602.                 };
  9603.                 uint32_t RAW;
  9604.             };
  9605.         public:
  9606.             enum class EMasks: uint32_t
  9607.             {
  9608.                 DATACOUNT              = (0x1FFFFFFU << 0),
  9609.             };
  9610.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCOUNT; }
  9611.             static inline uint32_t get_DATACOUNT() { return reinterpret_cast<const DCOUNT_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->DCOUNT)->DATACOUNT; }
  9612.         };
  9613.         class STA
  9614.         {
  9615.         private:
  9616.             union STA_t
  9617.             {
  9618.                 struct
  9619.                 {
  9620.                     uint32_t CCRCFAIL       : 1;
  9621.                     uint32_t DCRCFAIL       : 1;
  9622.                     uint32_t CTIMEOUT       : 1;
  9623.                     uint32_t DTIMEOUT       : 1;
  9624.                     uint32_t TXUNDERR       : 1;
  9625.                     uint32_t RXOVERR        : 1;
  9626.                     uint32_t CMDREND        : 1;
  9627.                     uint32_t CMDSENT        : 1;
  9628.                     uint32_t DATAEND        : 1;
  9629.                     uint32_t STBITERR       : 1;
  9630.                     uint32_t DBCKEND        : 1;
  9631.                     uint32_t CMDACT         : 1;
  9632.                     uint32_t TXACT          : 1;
  9633.                     uint32_t RXACT          : 1;
  9634.                     uint32_t TXFIFOHE       : 1;
  9635.                     uint32_t RXFIFOHF       : 1;
  9636.                     uint32_t TXFIFOF        : 1;
  9637.                     uint32_t RXFIFOF        : 1;
  9638.                     uint32_t TXFIFOE        : 1;
  9639.                     uint32_t RXFIFOE        : 1;
  9640.                     uint32_t TXDAVL         : 1;
  9641.                     uint32_t RXDAVL         : 1;
  9642.                     uint32_t SDIOIT         : 1;
  9643.                     uint32_t CEATAEND       : 1;
  9644.                     uint32_t reserved24     : 8;
  9645.                 };
  9646.                 uint32_t RAW;
  9647.             };
  9648.         public:
  9649.             enum class EMasks: uint32_t
  9650.             {
  9651.                 CCRCFAIL               = (0x1U << 0),
  9652.                 DCRCFAIL               = (0x1U << 1),
  9653.                 CTIMEOUT               = (0x1U << 2),
  9654.                 DTIMEOUT               = (0x1U << 3),
  9655.                 TXUNDERR               = (0x1U << 4),
  9656.                 RXOVERR                = (0x1U << 5),
  9657.                 CMDREND                = (0x1U << 6),
  9658.                 CMDSENT                = (0x1U << 7),
  9659.                 DATAEND                = (0x1U << 8),
  9660.                 STBITERR               = (0x1U << 9),
  9661.                 DBCKEND                = (0x1U << 10),
  9662.                 CMDACT                 = (0x1U << 11),
  9663.                 TXACT                  = (0x1U << 12),
  9664.                 RXACT                  = (0x1U << 13),
  9665.                 TXFIFOHE               = (0x1U << 14),
  9666.                 RXFIFOHF               = (0x1U << 15),
  9667.                 TXFIFOF                = (0x1U << 16),
  9668.                 RXFIFOF                = (0x1U << 17),
  9669.                 TXFIFOE                = (0x1U << 18),
  9670.                 RXFIFOE                = (0x1U << 19),
  9671.                 TXDAVL                 = (0x1U << 20),
  9672.                 RXDAVL                 = (0x1U << 21),
  9673.                 SDIOIT                 = (0x1U << 22),
  9674.                 CEATAEND               = (0x1U << 23),
  9675.             };
  9676.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->STA; }
  9677.             template <EMasks ... flags>
  9678.             static inline bool get_flags()
  9679.             {
  9680.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->STA & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9681.             }
  9682.         };
  9683.         class ICR
  9684.         {
  9685.         private:
  9686.             union ICR_t
  9687.             {
  9688.                 struct
  9689.                 {
  9690.                     uint32_t CCRCFAILC      : 1;
  9691.                     uint32_t DCRCFAILC      : 1;
  9692.                     uint32_t CTIMEOUTC      : 1;
  9693.                     uint32_t DTIMEOUTC      : 1;
  9694.                     uint32_t TXUNDERRC      : 1;
  9695.                     uint32_t RXOVERRC       : 1;
  9696.                     uint32_t CMDRENDC       : 1;
  9697.                     uint32_t CMDSENTC       : 1;
  9698.                     uint32_t DATAENDC       : 1;
  9699.                     uint32_t STBITERRC      : 1;
  9700.                     uint32_t DBCKENDC       : 1;
  9701.                     uint32_t reserved11     : 1;
  9702.                     uint32_t reserved12     : 1;
  9703.                     uint32_t reserved13     : 1;
  9704.                     uint32_t reserved14     : 1;
  9705.                     uint32_t reserved15     : 1;
  9706.                     uint32_t reserved16     : 1;
  9707.                     uint32_t reserved17     : 1;
  9708.                     uint32_t reserved18     : 1;
  9709.                     uint32_t reserved19     : 1;
  9710.                     uint32_t reserved20     : 1;
  9711.                     uint32_t reserved21     : 1;
  9712.                     uint32_t SDIOITC        : 1;
  9713.                     uint32_t CEATAENDC      : 1;
  9714.                     uint32_t reserved24     : 8;
  9715.                 };
  9716.                 uint32_t RAW;
  9717.             };
  9718.         public:
  9719.             enum class EMasks: uint32_t
  9720.             {
  9721.                 CCRCFAILC              = (0x1U << 0),
  9722.                 DCRCFAILC              = (0x1U << 1),
  9723.                 CTIMEOUTC              = (0x1U << 2),
  9724.                 DTIMEOUTC              = (0x1U << 3),
  9725.                 TXUNDERRC              = (0x1U << 4),
  9726.                 RXOVERRC               = (0x1U << 5),
  9727.                 CMDRENDC               = (0x1U << 6),
  9728.                 CMDSENTC               = (0x1U << 7),
  9729.                 DATAENDC               = (0x1U << 8),
  9730.                 STBITERRC              = (0x1U << 9),
  9731.                 DBCKENDC               = (0x1U << 10),
  9732.                 SDIOITC                = (0x1U << 22),
  9733.                 CEATAENDC              = (0x1U << 23),
  9734.             };
  9735.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ICR; }
  9736.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ICR = value; }
  9737.             template <EMasks ... flags>
  9738.             static inline void set_flags()
  9739.             {
  9740.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ICR |= SetBits<(std::uint32_t)flags...>();
  9741.             }
  9742.             template <EMasks ... flags>
  9743.             static inline void clear_flags()
  9744.             {
  9745.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ICR &= ~(SetBits<(std::uint32_t)flags...>());
  9746.             }
  9747.             template <EMasks ... flags>
  9748.             static inline bool get_flags()
  9749.             {
  9750.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->ICR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9751.             }
  9752.         };
  9753.         class MASK
  9754.         {
  9755.         private:
  9756.             union MASK_t
  9757.             {
  9758.                 struct
  9759.                 {
  9760.                     uint32_t CCRCFAILIE     : 1;
  9761.                     uint32_t DCRCFAILIE     : 1;
  9762.                     uint32_t CTIMEOUTIE     : 1;
  9763.                     uint32_t DTIMEOUTIE     : 1;
  9764.                     uint32_t TXUNDERRIE     : 1;
  9765.                     uint32_t RXOVERRIE      : 1;
  9766.                     uint32_t CMDRENDIE      : 1;
  9767.                     uint32_t CMDSENTIE      : 1;
  9768.                     uint32_t DATAENDIE      : 1;
  9769.                     uint32_t STBITERRIE     : 1;
  9770.                     uint32_t DBCKENDIE      : 1;
  9771.                     uint32_t CMDACTIE       : 1;
  9772.                     uint32_t TXACTIE        : 1;
  9773.                     uint32_t RXACTIE        : 1;
  9774.                     uint32_t TXFIFOHEIE     : 1;
  9775.                     uint32_t RXFIFOHFIE     : 1;
  9776.                     uint32_t TXFIFOFIE      : 1;
  9777.                     uint32_t RXFIFOFIE      : 1;
  9778.                     uint32_t TXFIFOEIE      : 1;
  9779.                     uint32_t RXFIFOEIE      : 1;
  9780.                     uint32_t TXDAVLIE       : 1;
  9781.                     uint32_t RXDAVLIE       : 1;
  9782.                     uint32_t SDIOITIE       : 1;
  9783.                     uint32_t CEATAENDIE     : 1;
  9784.                     uint32_t reserved24     : 8;
  9785.                 };
  9786.                 uint32_t RAW;
  9787.             };
  9788.         public:
  9789.             enum class EMasks: uint32_t
  9790.             {
  9791.                 CCRCFAILIE             = (0x1U << 0),
  9792.                 DCRCFAILIE             = (0x1U << 1),
  9793.                 CTIMEOUTIE             = (0x1U << 2),
  9794.                 DTIMEOUTIE             = (0x1U << 3),
  9795.                 TXUNDERRIE             = (0x1U << 4),
  9796.                 RXOVERRIE              = (0x1U << 5),
  9797.                 CMDRENDIE              = (0x1U << 6),
  9798.                 CMDSENTIE              = (0x1U << 7),
  9799.                 DATAENDIE              = (0x1U << 8),
  9800.                 STBITERRIE             = (0x1U << 9),
  9801.                 DBCKENDIE              = (0x1U << 10),
  9802.                 CMDACTIE               = (0x1U << 11),
  9803.                 TXACTIE                = (0x1U << 12),
  9804.                 RXACTIE                = (0x1U << 13),
  9805.                 TXFIFOHEIE             = (0x1U << 14),
  9806.                 RXFIFOHFIE             = (0x1U << 15),
  9807.                 TXFIFOFIE              = (0x1U << 16),
  9808.                 RXFIFOFIE              = (0x1U << 17),
  9809.                 TXFIFOEIE              = (0x1U << 18),
  9810.                 RXFIFOEIE              = (0x1U << 19),
  9811.                 TXDAVLIE               = (0x1U << 20),
  9812.                 RXDAVLIE               = (0x1U << 21),
  9813.                 SDIOITIE               = (0x1U << 22),
  9814.                 CEATAENDIE             = (0x1U << 23),
  9815.             };
  9816.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->MASK; }
  9817.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->MASK = value; }
  9818.             template <EMasks ... flags>
  9819.             static inline void set_flags()
  9820.             {
  9821.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->MASK |= SetBits<(std::uint32_t)flags...>();
  9822.             }
  9823.             template <EMasks ... flags>
  9824.             static inline void clear_flags()
  9825.             {
  9826.                 reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->MASK &= ~(SetBits<(std::uint32_t)flags...>());
  9827.             }
  9828.             template <EMasks ... flags>
  9829.             static inline bool get_flags()
  9830.             {
  9831.                 return ((reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->MASK & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9832.             }
  9833.         };
  9834.         class FIFOCNT
  9835.         {
  9836.         private:
  9837.             union FIFOCNT_t
  9838.             {
  9839.                 struct
  9840.                 {
  9841.                     uint32_t FIFOCOUNT      : 24;
  9842.                     uint32_t reserved24     : 8;
  9843.                 };
  9844.                 uint32_t RAW;
  9845.             };
  9846.         public:
  9847.             enum class EMasks: uint32_t
  9848.             {
  9849.                 FIFOCOUNT              = (0xFFFFFFU << 0),
  9850.             };
  9851.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFOCNT; }
  9852.             static inline uint32_t get_FIFOCOUNT() { return reinterpret_cast<const FIFOCNT_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFOCNT)->FIFOCOUNT; }
  9853.         };
  9854.         class FIFO
  9855.         {
  9856.         private:
  9857.             union FIFO_t
  9858.             {
  9859.                 struct
  9860.                 {
  9861.                     uint32_t FIFODATA       : 32;
  9862.                 };
  9863.                 uint32_t RAW;
  9864.             };
  9865.         public:
  9866.             enum class EMasks: uint32_t
  9867.             {
  9868.                 FIFODATA               = (0xFFFFFFFFU << 0),
  9869.             };
  9870.             static inline uint32_t get() { return reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFO; }
  9871.             static inline void set(uint32_t value) { reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFO = value; }
  9872.             static inline uint32_t get_FIFODATA() { return reinterpret_cast<__IO FIFO_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFO)->FIFODATA; }
  9873.             static inline void set_FIFODATA(uint32_t value) { reinterpret_cast<__IO FIFO_t*>(&reinterpret_cast<SDIO_t*>(STM32::SDIO_BASE)->FIFO)->FIFODATA = value; }
  9874.         };
  9875.     };
  9876.     /* SPI DEFINITION */
  9877.     template <uint32_t reg_base>
  9878.     class SPI
  9879.     {
  9880. #warning TODO: SPI
  9881.     };
  9882.     /* TIM DEFINITION */
  9883.     template <uint32_t reg_base>
  9884.     class TIM
  9885.     {
  9886. #warning TODO: TIM
  9887.     };
  9888.     /* USART DEFINITION */
  9889.     template <uint32_t reg_base>
  9890.     class USART
  9891.     {
  9892. #warning TODO: USART
  9893.     };
  9894.     /* WWDG DEFINITION */
  9895.     class WWDG
  9896.     {
  9897.     private:
  9898.         struct WWDG_t
  9899.         {
  9900.             __IO uint32_t                 CR;
  9901.             __IO uint32_t                 CFR;
  9902.             __IO uint32_t                 SR;
  9903.         };
  9904.     public:
  9905.         class CR
  9906.         {
  9907.         private:
  9908.             union CR_t
  9909.             {
  9910.                 struct
  9911.                 {
  9912.                     uint32_t T              : 7;
  9913.                     uint32_t WDGA           : 1;
  9914.                     uint32_t reserved8      : 24;
  9915.                 };
  9916.                 uint32_t RAW;
  9917.             };
  9918.         public:
  9919.             enum class EMasks: uint32_t
  9920.             {
  9921.                 T                      = (0x7FU << 0),
  9922.                 WDGA                   = (0x1U << 7),
  9923.             };
  9924.             static inline uint32_t get() { return reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR; }
  9925.             static inline void set(uint32_t value) { reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR = value; }
  9926.             template <EMasks ... flags>
  9927.             static inline void set_flags()
  9928.             {
  9929.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  9930.             }
  9931.             template <EMasks ... flags>
  9932.             static inline void clear_flags()
  9933.             {
  9934.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  9935.             }
  9936.             template <EMasks ... flags>
  9937.             static inline bool get_flags()
  9938.             {
  9939.                 return ((reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9940.             }
  9941.             static inline uint32_t get_T() { return reinterpret_cast<__IO CR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR)->T; }
  9942.             static inline void set_T(uint32_t value) { reinterpret_cast<__IO CR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CR)->T = value; }
  9943.         };
  9944.         class CFR
  9945.         {
  9946.         private:
  9947.             union CFR_t
  9948.             {
  9949.                 struct
  9950.                 {
  9951.                     uint32_t W              : 7;
  9952.                     uint32_t WDGTB          : 2;
  9953.                     uint32_t EWI            : 1;
  9954.                     uint32_t reserved10     : 22;
  9955.                 };
  9956.                 uint32_t RAW;
  9957.             };
  9958.         public:
  9959.             enum class EMasks: uint32_t
  9960.             {
  9961.                 W                      = (0x7FU << 0),
  9962.                 WDGTB                  = (0x3U << 7),
  9963.                 EWI                    = (0x1U << 9),
  9964.             };
  9965.             static inline uint32_t get() { return reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR; }
  9966.             static inline void set(uint32_t value) { reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR = value; }
  9967.             template <EMasks ... flags>
  9968.             static inline void set_flags()
  9969.             {
  9970.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR |= SetBits<(std::uint32_t)flags...>();
  9971.             }
  9972.             template <EMasks ... flags>
  9973.             static inline void clear_flags()
  9974.             {
  9975.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR &= ~(SetBits<(std::uint32_t)flags...>());
  9976.             }
  9977.             template <EMasks ... flags>
  9978.             static inline bool get_flags()
  9979.             {
  9980.                 return ((reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  9981.             }
  9982.             static inline uint32_t get_W() { return reinterpret_cast<__IO CFR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR)->W; }
  9983.             static inline void set_W(uint32_t value) { reinterpret_cast<__IO CFR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR)->W = value; }
  9984.             static inline uint32_t get_WDGTB() { return reinterpret_cast<__IO CFR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR)->WDGTB; }
  9985.             static inline void set_WDGTB(uint32_t value) { reinterpret_cast<__IO CFR_t*>(&reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->CFR)->WDGTB = value; }
  9986.         };
  9987.         class SR
  9988.         {
  9989.         private:
  9990.             union SR_t
  9991.             {
  9992.                 struct
  9993.                 {
  9994.                     uint32_t EWIF           : 1;
  9995.                     uint32_t reserved1      : 31;
  9996.                 };
  9997.                 uint32_t RAW;
  9998.             };
  9999.         public:
  10000.             enum class EMasks: uint32_t
  10001.             {
  10002.                 EWIF                   = (0x1U << 0),
  10003.             };
  10004.             static inline uint32_t get() { return reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->SR; }
  10005.             static inline void set(uint32_t value) { reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->SR = value; }
  10006.             template <EMasks ... flags>
  10007.             static inline void set_flags()
  10008.             {
  10009.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  10010.             }
  10011.             template <EMasks ... flags>
  10012.             static inline void clear_flags()
  10013.             {
  10014.                 reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  10015.             }
  10016.             template <EMasks ... flags>
  10017.             static inline bool get_flags()
  10018.             {
  10019.                 return ((reinterpret_cast<WWDG_t*>(STM32::WWDG_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  10020.             }
  10021.         };
  10022.     };
  10023.     /* RNG DEFINITION */
  10024.     class RNG
  10025.     {
  10026.     private:
  10027.         struct RNG_t
  10028.         {
  10029.             __IO uint32_t                 CR;
  10030.             __IO uint32_t                 SR;
  10031.             __IO uint32_t                 DR;
  10032.         };
  10033.     public:
  10034.         class CR
  10035.         {
  10036.         private:
  10037.             union CR_t
  10038.             {
  10039.                 struct
  10040.                 {
  10041.                     uint32_t reserved0      : 1;
  10042.                     uint32_t reserved1      : 1;
  10043.                     uint32_t RNGEN          : 1;
  10044.                     uint32_t IE             : 1;
  10045.                     uint32_t reserved4      : 28;
  10046.                 };
  10047.                 uint32_t RAW;
  10048.             };
  10049.         public:
  10050.             enum class EMasks: uint32_t
  10051.             {
  10052.                 RNGEN                  = (0x1U << 2),
  10053.                 IE                     = (0x1U << 3),
  10054.             };
  10055.             static inline uint32_t get() { return reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->CR; }
  10056.             static inline void set(uint32_t value) { reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->CR = value; }
  10057.             template <EMasks ... flags>
  10058.             static inline void set_flags()
  10059.             {
  10060.                 reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->CR |= SetBits<(std::uint32_t)flags...>();
  10061.             }
  10062.             template <EMasks ... flags>
  10063.             static inline void clear_flags()
  10064.             {
  10065.                 reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->CR &= ~(SetBits<(std::uint32_t)flags...>());
  10066.             }
  10067.             template <EMasks ... flags>
  10068.             static inline bool get_flags()
  10069.             {
  10070.                 return ((reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->CR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  10071.             }
  10072.         };
  10073.         class SR
  10074.         {
  10075.         private:
  10076.             union SR_t
  10077.             {
  10078.                 struct
  10079.                 {
  10080.                     uint32_t DRDY           : 1;
  10081.                     uint32_t CECS           : 1;
  10082.                     uint32_t SECS           : 1;
  10083.                     uint32_t reserved3      : 1;
  10084.                     uint32_t reserved4      : 1;
  10085.                     uint32_t CEIS           : 1;
  10086.                     uint32_t SEIS           : 1;
  10087.                     uint32_t reserved7      : 25;
  10088.                 };
  10089.                 uint32_t RAW;
  10090.             };
  10091.         public:
  10092.             enum class EMasks: uint32_t
  10093.             {
  10094.                 DRDY                   = (0x1U << 0),
  10095.                 CECS                   = (0x1U << 1),
  10096.                 SECS                   = (0x1U << 2),
  10097.                 CEIS                   = (0x1U << 5),
  10098.                 SEIS                   = (0x1U << 6),
  10099.             };
  10100.             static inline uint32_t get() { return reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->SR; }
  10101.             static inline void set(uint32_t value) { reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->SR = value; }
  10102.             template <EMasks ... flags>
  10103.             static inline void set_flags()
  10104.             {
  10105.                 reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->SR |= SetBits<(std::uint32_t)flags...>();
  10106.             }
  10107.             template <EMasks ... flags>
  10108.             static inline void clear_flags()
  10109.             {
  10110.                 reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->SR &= ~(SetBits<(std::uint32_t)flags...>());
  10111.             }
  10112.             template <EMasks ... flags>
  10113.             static inline bool get_flags()
  10114.             {
  10115.                 return ((reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->SR & SetBits<(std::uint32_t)flags...>()) == SetBits<(std::uint32_t)flags...>());
  10116.             }
  10117.         };
  10118.         class DR
  10119.         {
  10120.         private:
  10121.             union DR_t
  10122.             {
  10123.                 struct
  10124.                 {
  10125.                     uint32_t reserved0      : 32;
  10126.                 };
  10127.                 uint32_t RAW;
  10128.             };
  10129.         public:
  10130.             static inline uint32_t get() { return reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->DR; }
  10131.             static inline void set(uint32_t value) { reinterpret_cast<RNG_t*>(STM32::RNG_BASE)->DR = value; }
  10132.         };
  10133.     };
  10134.     /* USB_OTG_Global DEFINITION */
  10135.     template <uint32_t reg_base>
  10136.     class USB_OTG_Global
  10137.     {
  10138. #warning TODO: USB_OTG_Global
  10139.     };
  10140.     /* USB_OTG_Device DEFINITION */
  10141.     template <uint32_t reg_base>
  10142.     class USB_OTG_Device
  10143.     {
  10144. #warning TODO: USB_OTG_Device
  10145.     };
  10146.     /* USB_OTG_INEndpoint DEFINITION */
  10147.     template <uint32_t reg_base>
  10148.     class USB_OTG_INEndpoint
  10149.     {
  10150. #warning TODO: USB_OTG_INEndpoint
  10151.     };
  10152.     /* USB_OTG_OUTEndpoint DEFINITION */
  10153.     template <uint32_t reg_base>
  10154.     class USB_OTG_OUTEndpoint
  10155.     {
  10156. #warning TODO: USB_OTG_OUTEndpoint
  10157.     };
  10158.     /* USB_OTG_Host DEFINITION */
  10159.     template <uint32_t reg_base>
  10160.     class USB_OTG_Host
  10161.     {
  10162. #warning TODO: USB_OTG_Host
  10163.     };
  10164.     /* USB_OTG_HostChannel DEFINITION */
  10165.     template <uint32_t reg_base>
  10166.     class USB_OTG_HostChannel
  10167.     {
  10168. #warning TODO: USB_OTG_HostChannel
  10169.     };
  10170. }
  10171.  
  10172. #endif /* __STM32F407xx_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement