Код: Выделить всё
template
class bField {
public:
uint32_t Get() const
{
constexpr uint32_t mMask = 0xffffffff >> (32 - BitWidth);
return (*mReg >> BitPos) & mMask;
}
};
Код: Выделить всё
typedef struct
{
volatile uint32_t CR;
volatile uint32_t CFGR;
} RCC_t;
#define RCC_BASE 0x4000000
RCC_t* const mRCC = (RCC_t*)(RCC_BASE);
Код: Выделить всё
bFieldCR, 25> PLLRDY_Field;
По моему мнению, указатель на член структуры должен быть постоянное значение.
Я также сделал пример в Compiler-Explorer
https://godbolt.org/z/KT35cPKT5
Подробнее здесь: https://stackoverflow.com/questions/793 ... uct-member