Implement C/C++ export option for idiomatic struct-bitfield bit endianness
As a user I want to specify the bit endianness of the bitfields in an idiomatic struct bitfield.
eg.
register -> b(7)->f2(2)
b(6)->f2(1)
b(5)->f2(0)
b(4)->unassigned
b(3)->unassigned
b(2)->unassigned
b(1)->f1(1)
b(0)->f1(0)
Could be represented in struct as
struct {
unsigned f2:3;
unsigned :3;
unsigned f1:2;
};
or
struct {
unsigned f1:2;
unsigned :3;
unsigned f2:3;
};
The bit endianness is "implementation specific" in C/C++ standard so either of these representations could generate big endian or little endian code depending on the specific compiler implementation. Thus the user needs to know how their platform will deal with the endianness and define the register map C/C++ endianness export appropriately.
Edited by Russell