mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[ion] Register: fix potential bug in Register
This commit is contained in:
@@ -9,18 +9,18 @@ public:
|
||||
};
|
||||
class SCR : Register32 {
|
||||
public:
|
||||
enum class Burst {
|
||||
enum class Burst : uint8_t {
|
||||
Single = 0,
|
||||
Incremental4 = 1,
|
||||
Incremental8 = 2,
|
||||
Incremental16 = 3
|
||||
};
|
||||
enum class DataSize {
|
||||
enum class DataSize : uint8_t {
|
||||
Byte = 0,
|
||||
HalfWord = 1,
|
||||
Word = 2
|
||||
};
|
||||
enum class Direction {
|
||||
enum class Direction : uint8_t {
|
||||
PeripheralToMemory = 0,
|
||||
MemoryToPeripheral = 1,
|
||||
MemoryToMemory = 2
|
||||
|
||||
@@ -50,7 +50,7 @@ typedef Register<uint32_t> Register32;
|
||||
typedef Register<uint64_t> Register64;
|
||||
|
||||
#define REGS_FIELD_R(name,type,high,low) type get##name() volatile { return (type)getBitRange(high,low); };
|
||||
#define REGS_FIELD_W(name,type,high,low) void set##name(type v) volatile { setBitRange(high, low, (uint8_t)v); };
|
||||
#define REGS_FIELD_W(name,type,high,low) void set##name(type v) volatile { static_assert(sizeof(type) <= 2, "Invalid size"); setBitRange(high, low, static_cast<uint16_t>(v)); };
|
||||
#define REGS_FIELD(name,type,high,low) REGS_FIELD_R(name,type,high,low); REGS_FIELD_W(name,type,high,low);
|
||||
#define REGS_TYPE_FIELD(name,high,low) REGS_FIELD(name,name,high,low)
|
||||
#define REGS_BOOL_FIELD(name,bit) REGS_FIELD(name,bool,bit,bit)
|
||||
|
||||
@@ -9,7 +9,7 @@ class SYSCFG {
|
||||
public:
|
||||
class MEMRMP : Register32 {
|
||||
public:
|
||||
enum class MemMode {
|
||||
enum class MemMode : uint8_t {
|
||||
MainFlashmemory = 0,
|
||||
SystemFlashmemory = 1,
|
||||
EmbeddedSRAM = 3
|
||||
|
||||
Reference in New Issue
Block a user