#include <cstdint>



namespace hardware
{
    using pointer_t = std::uint32_t;

    namespace common
    {
        template<pointer_t, class _register_type_t, std::uint8_t _offset, std::uint8_t _width>
        class value_t
        {
        public:
            constexpr value_t() = delete;
            constexpr value_t(_register_type_t value) : m_value(value & (((1 << _width) - 1) << _offset)) { ; }

            constexpr operator _register_type_t() const
            {
                return m_value;
            }

            constexpr bool operator==(const value_t& other) const
            {
                return m_value == other.m_value;
            }

            constexpr bool operator==(_register_type_t value) const
            {
                return m_value == value;
            }

        private:
            const _register_type_t m_value;
        };
    }

    // Devices.
    class timer1
    {
    public:
        // Base address.
        constexpr static pointer_t address = 0x400000;
    
        // Registers.
        class cr1
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x400000;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            // CEN is cleared automatically in one-pulse mode, when an update event occurs.
            class cen
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 1;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Counter disabled
                constexpr static value_t disabled = 0;
                // Counter enabled
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class udis
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 1;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 2;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // UEV enabled
                constexpr static value_t disabled = 0;
                // UEV disabled
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class urs
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 2;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 4;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Any event
                constexpr static value_t any = 0;
                // Only counter events
                constexpr static value_t counter = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class opm
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 3;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 8;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Counter is not stopped at update even
                constexpr static value_t disabled = 0;
                // Counter stops counting at the next update event (clearing the bit CEN
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class dir
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 4;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 16;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Counter used as upcounter
                constexpr static value_t up = 0;
                // Counter used as downcounter
                constexpr static value_t down = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class csm
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 5;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 64;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Edge-aligned mode. The counter counts up or down depending on the direction bit (DIR)
                constexpr static value_t edge = 0;
                // Center-aligned mode 1
                constexpr static value_t center1 = 1;
                // Center-aligned mode 2
                constexpr static value_t center2 = 2;
                // Center-aligned mode 3
                constexpr static value_t center3 = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class arpe
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 7;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 128;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // TIMx_ARR register is not buffered
                constexpr static value_t disabled = 0;
                // TIMx_ARR register is buffered
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class ckd
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400000;
                // Field offset.
                constexpr static std::uint8_t offset = 8;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 512;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t nodiv = 0;
                constexpr static value_t div2 = 1;
                constexpr static value_t div4 = 2;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
        class cr2
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x400004;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            class ccds
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400004;
                // Field offset.
                constexpr static std::uint8_t offset = 3;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 8;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // CCx DMA request sent when CCx event occurs
                constexpr static value_t ccx = 0;
                // CCx DMA requests sent when update event occurs
                constexpr static value_t update = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class mms
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400004;
                // Field offset.
                constexpr static std::uint8_t offset = 4;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 64;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t reset = 0;
                constexpr static value_t enable = 1;
                constexpr static value_t update = 2;
                constexpr static value_t comparep = 3;
                constexpr static value_t compare1 = 4;
                constexpr static value_t compare2 = 5;
                constexpr static value_t comapre3 = 6;
                constexpr static value_t compare4 = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class ti1s
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400004;
                // Field offset.
                constexpr static std::uint8_t offset = 7;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 128;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // The TIMx_CH1 pin is connected to TI1 input
                constexpr static value_t ti2 = 0;
                // The TIMx_CH1, CH2 and CH3 pins are connected to the TI1 input (XOR combination)
                constexpr static value_t ti1xor = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
        class smcr
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x400008;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            class sms
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 4;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t disabled = 0;
                constexpr static value_t encoder1 = 1;
                constexpr static value_t encoder2 = 2;
                constexpr static value_t encoder3 = 3;
                constexpr static value_t reset = 4;
                constexpr static value_t gated = 5;
                constexpr static value_t trigger = 6;
                constexpr static value_t external = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class occs
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 3;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 8;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t ocrefclr = 0;
                constexpr static value_t etrf = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class ts
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 4;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 64;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t itr0 = 0;
                constexpr static value_t itr1 = 1;
                constexpr static value_t itr2 = 2;
                constexpr static value_t itr3 = 3;
                constexpr static value_t ti1fed = 4;
                constexpr static value_t ti1fp1 = 5;
                constexpr static value_t ti2fp2 = 6;
                constexpr static value_t etrf = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class msm
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 7;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 128;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t disabled = 0;
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class etf
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 8;
                // Field width.
                constexpr static std::uint8_t width = 4;
                // Field mask.
                constexpr static field_type mask = 2048;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t nofilter = 0;
                constexpr static value_t f1n2 = 1;
                constexpr static value_t f1n4 = 2;
                constexpr static value_t f1n8 = 3;
                constexpr static value_t f2n6 = 4;
                constexpr static value_t f2n8 = 5;
                constexpr static value_t f4n6 = 6;
                constexpr static value_t f4n8 = 7;
                constexpr static value_t f8n6 = 8;
                constexpr static value_t f8n8 = 9;
                constexpr static value_t f16n5 = 10;
                constexpr static value_t f16n6 = 11;
                constexpr static value_t f16n8 = 12;
                constexpr static value_t f32n5 = 13;
                constexpr static value_t f32n6 = 14;
                constexpr static value_t f32n8 = 15;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class etps
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 12;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 8192;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t off = 0;
                constexpr static value_t div2 = 1;
                constexpr static value_t div4 = 2;
                constexpr static value_t div8 = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class ece
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 14;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 16384;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t disabled = 0;
                constexpr static value_t enabled = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            class etp
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x400008;
                // Field offset.
                constexpr static std::uint8_t offset = 15;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 32768;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                constexpr static value_t noninverted = 0;
                constexpr static value_t inverted = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
    };
    class rcc
    {
    public:
        // Base address.
        constexpr static pointer_t address = 0x40023800;
    
        // Registers.
        // Clock control register
        class cr
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x40023800;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            // Internal high-speed clock enable
            class hsion
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 1;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSI oscillator off
                constexpr static value_t off = 0;
                // HSI oscillator on
                constexpr static value_t on = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // Internal high-speed clock ready flag
            class hsirdy
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 1;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 2;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSI oscillator not ready
                constexpr static value_t notready = 0;
                // HSI oscillator ready
                constexpr static value_t ready = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // MSI clock enable
            class msion
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 8;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 256;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MSI oscillator off
                constexpr static value_t off = 0;
                // MSI oscillator on
                constexpr static value_t on = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // MSI clock ready flag
            class msirdy
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 9;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 512;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MSI oscillator not ready
                constexpr static value_t notready = 0;
                // MSI oscillator ready
                constexpr static value_t ready = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // HSE clock enable
            class hseon
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 16;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 65536;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSE oscillator off
                constexpr static value_t off = 0;
                // HSE oscillator on
                constexpr static value_t on = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // HSE clock ready flag
            class hserdy
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 17;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 131072;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSE oscillator not ready
                constexpr static value_t notready = 0;
                // HSE oscillator ready
                constexpr static value_t ready = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // HSE clock bypass
            class hsebyp
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 18;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 262144;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSE oscillator not bypassed
                constexpr static value_t notbypassed = 0;
                // HSE oscillator bypassed with an external clock
                constexpr static value_t bypassed = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // PLL enable
            class pllon
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 24;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 16777216;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // PLL off
                constexpr static value_t off = 0;
                // PLL on
                constexpr static value_t on = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // PLL clock ready flag
            class pllrdy
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 25;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 33554432;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // PLL ready
                constexpr static value_t notready = 0;
                // PLL ready
                constexpr static value_t ready = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            //  This bit is set and cleared by software to enable the clock security system (CSS).  When CSSON is set, the clock
            // detector is enabled by hardware when the HSE oscillator is ready,  and disabled by hardware if an oscillator failure is
            // detected.
            class csson
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 28;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 268435456;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Clock security system off (clock detector off)
                constexpr static value_t off = 0;
                // Clock security system on (clock detector on if HSE oscillator is stable, off otherwise)
                constexpr static value_t on = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // RTC/LCD prescaler
            class rtcpre
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023800;
                // Field offset.
                constexpr static std::uint8_t offset = 29;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 1073741824;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSE is divided by 2 for RTC/LCD clock
                constexpr static value_t div2 = 0;
                // HSE is divided by 4 for RTC/LCD clock
                constexpr static value_t div4 = 1;
                // HSE is divided by 8 for RTC/LCD clock
                constexpr static value_t div8 = 2;
                // HSE is divided by 16 for RTC/LCD clock
                constexpr static value_t div16 = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
        // Internal clock sources calibration register
        class icscr
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x40023804;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            // Internal high speed clock calibration
            class hsical
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023804;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 8;
                // Field mask.
                constexpr static field_type mask = 128;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // High speed internal clock trimming
            class hsitrim
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023804;
                // Field offset.
                constexpr static std::uint8_t offset = 8;
                // Field width.
                constexpr static std::uint8_t width = 5;
                // Field mask.
                constexpr static field_type mask = 4096;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // MSI clock ranges
            class msirange
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023804;
                // Field offset.
                constexpr static std::uint8_t offset = 13;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 32768;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // Range 0 around 65.536 kHz
                constexpr static value_t f65536hz = 0;
                // Range 1 around 131.072 kHz
                constexpr static value_t f131072hz = 1;
                // Range 2 around 262.144 kHz
                constexpr static value_t f262144hz = 2;
                // Range 3 around 524.288 kHz
                constexpr static value_t f524288hz = 3;
                // Range 4 around 1.048 MHz
                constexpr static value_t f1048khz = 4;
                // Range 5 around 2.097 MHz (reset value)
                constexpr static value_t f2097khz = 5;
                // Range 6 around 4.194 MHz
                constexpr static value_t f4194khz = 6;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // MSI clock calibration
            class msical
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023804;
                // Field offset.
                constexpr static std::uint8_t offset = 16;
                // Field width.
                constexpr static std::uint8_t width = 8;
                // Field mask.
                constexpr static field_type mask = 8388608;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // MSI clock trimming
            class msitrim
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023804;
                // Field offset.
                constexpr static std::uint8_t offset = 24;
                // Field width.
                constexpr static std::uint8_t width = 8;
                // Field mask.
                constexpr static field_type mask = 2147483648;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
        // Clock control register
        class cfgr
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x40023808;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            // System clock switch
            class sw
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 2;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MSI oscillator used as system clock
                constexpr static value_t msi = 0;
                // HSI oscillator used as system clock
                constexpr static value_t hsi = 1;
                // HSE oscillator used as system clock
                constexpr static value_t hse = 2;
                // PLL used as system clock
                constexpr static value_t pll = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // System clock switch status
            class sws
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 2;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 8;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MSI oscillator used as system clock
                constexpr static value_t msi = 0;
                // HSI oscillator used as system clock
                constexpr static value_t hsi = 1;
                // HSE oscillator used as system clock
                constexpr static value_t hse = 2;
                // PLL used as system clock
                constexpr static value_t pll = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // AHB prescaler
            class hpre
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 4;
                // Field width.
                constexpr static std::uint8_t width = 4;
                // Field mask.
                constexpr static field_type mask = 128;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // SYSCLK not divided
                constexpr static value_t nodiv = 0;
                // SYSCLK divided by 2
                constexpr static value_t div2 = 8;
                // SYSCLK divided by 4
                constexpr static value_t div4 = 9;
                // SYSCLK divided by 8
                constexpr static value_t div8 = 10;
                // SYSCLK divided by 16
                constexpr static value_t div16 = 11;
                // SYSCLK divided by 64
                constexpr static value_t div64 = 12;
                // SYSCLK divided by 128
                constexpr static value_t div128 = 13;
                // SYSCLK divided by 256
                constexpr static value_t div256 = 14;
                // SYSCLK divided by 512
                constexpr static value_t div512 = 15;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // APB low-speed prescaler (APB1)
            class ppre1
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 8;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 1024;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HCLK not divided
                constexpr static value_t nodiv = 0;
                // HCLK divided by 2
                constexpr static value_t div2 = 4;
                // HCLK divided by 4
                constexpr static value_t div4 = 5;
                // HCLK divided by 8
                constexpr static value_t div8 = 6;
                // HCLK divided by 16
                constexpr static value_t div16 = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // APB high-speed prescaler (APB2)
            class ppre2
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 11;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 8192;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HCLK not divided
                constexpr static value_t nodiv = 0;
                // HCLK divided by 2
                constexpr static value_t div2 = 4;
                // HCLK divided by 4
                constexpr static value_t div4 = 5;
                // HCLK divided by 8
                constexpr static value_t div8 = 6;
                // HCLK divided by 16
                constexpr static value_t div16 = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // PLL entry clock source
            class pllsrc
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 16;
                // Field width.
                constexpr static std::uint8_t width = 1;
                // Field mask.
                constexpr static field_type mask = 65536;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // HSI oscillator clock selected as PLL input clock
                constexpr static value_t hsi = 0;
                // HSE oscillator clock selected as PLL input clock
                constexpr static value_t hse = 1;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // PLL multiplication factor
            class pllmul
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 18;
                // Field width.
                constexpr static std::uint8_t width = 4;
                // Field mask.
                constexpr static field_type mask = 2097152;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // PLLVCO = PLL clock entry x 3
                constexpr static value_t mul3 = 0;
                // PLLVCO = PLL clock entry x 4
                constexpr static value_t mul4 = 1;
                // PLLVCO = PLL clock entry x 6
                constexpr static value_t mul6 = 2;
                // PLLVCO = PLL clock entry x 8
                constexpr static value_t mul8 = 3;
                // PLLVCO = PLL clock entry x 12
                constexpr static value_t mul12 = 4;
                // PLLVCO = PLL clock entry x 16
                constexpr static value_t mul16 = 5;
                // PLLVCO = PLL clock entry x 24
                constexpr static value_t mul24 = 6;
                // PLLVCO = PLL clock entry x 32
                constexpr static value_t mul32 = 7;
                // PLLVCO = PLL clock entry x 48
                constexpr static value_t mul48 = 8;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // PLL output division
            class plldiv
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 22;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 8388608;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // PLL clock output = PLLVCO / 2
                constexpr static value_t div2 = 1;
                // PLL clock output = PLLVCO / 3
                constexpr static value_t div3 = 2;
                // PLL clock output = PLLVCO / 4
                constexpr static value_t div4 = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // Microcontroller clock output selection
            class mcosel
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 24;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 67108864;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MCO output disabled, no clock on MCO
                constexpr static value_t disabled = 0;
                // SYSCLK clock selected
                constexpr static value_t sysclk = 1;
                // HSI oscillator clock selected
                constexpr static value_t hsi = 2;
                // MSI oscillator clock selected
                constexpr static value_t msi = 3;
                // HSE oscillator clock selected
                constexpr static value_t hse = 4;
                // PLL clock selected
                constexpr static value_t pll = 5;
                // LSI oscillator clock selected
                constexpr static value_t lsi = 6;
                // LSE oscillator clock selected
                constexpr static value_t lse = 7;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
            // Microcontroller clock output prescaler
            class mcopre
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 28;
                // Field width.
                constexpr static std::uint8_t width = 3;
                // Field mask.
                constexpr static field_type mask = 1073741824;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MCO is divided by 1
                constexpr static value_t nodiv = 0;
                // MCO is divided by 2
                constexpr static value_t div2 = 1;
                // MCO is divided by 4
                constexpr static value_t div4 = 2;
                // MCO is divided by 8
                constexpr static value_t div8 = 3;
                // MCO is divided by 16
                constexpr static value_t div16 = 4;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
        // Clock control register
        class cir
        {
        public:
            // Register type.
            using type = std::uint32_t;
            // Address.
            constexpr static pointer_t address = 0x40023808;
            // Local (device) offset;
            constexpr static pointer_t offset = 0;
        
            // Fields.
            // System clock switch
            class sw
            {
            public:
                // Field type.
                using field_type = std::uint32_t;
                // Address.
                constexpr static pointer_t address = 0x40023808;
                // Field offset.
                constexpr static std::uint8_t offset = 0;
                // Field width.
                constexpr static std::uint8_t width = 2;
                // Field mask.
                constexpr static field_type mask = 2;
            
                // Default value type.
                using value_t = common::value_t<address, field_type, offset, width>;
                // MSI oscillator used as system clock
                constexpr static value_t msi = 0;
                // HSI oscillator used as system clock
                constexpr static value_t hsi = 1;
                // HSE oscillator used as system clock
                constexpr static value_t hse = 2;
                // PLL used as system clock
                constexpr static value_t pll = 3;
            
                // Read value.
                static field_type read()
                {
                    return *reinterpret_cast<volatile field_type*>(address) & mask;
                }
            
                // Write value.
                static void write(const value_t& v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v;
                }
            
                // Write raw value.
                static void write(field_type v)
                {
                    *reinterpret_cast<volatile field_type*>(address) = v << offset & mask;
                }
            };
        
            static type read()
            {
                return *reinterpret_cast<volatile type*>(address);
            }
        
            static void write(type value)
            {
                *reinterpret_cast<volatile type*>(address) = value;
            }
        };
    };
}