c - Placeholder for hardware reserved registers in struct -
i have struct represents set of hardware registers. here, parts reserved , must neither written nor read. there placeholder or similar instead of using obvious variable naming?
typedef volatile struct registerstruct { uint8 bdh; uint8 bdl; ... uint8 ir; uint8 reserved0; // area should not accessed ... }
obvious naming right thing use, there's no "reserved" feature in c.
you can use arrays of byte-sized integers correctly pad right length:
typedef volatile struct registerstruct { uint8_t bdh; uint8_t bdl; uint8_t ir; uint8_t __reserved[num_of_reserved_bytes]; // area should not accessed uint8_t next_register_name; };
Comments
Post a Comment