I have to create a structure which will have a size of 2 bytes. The structure have to contain 4 values and every value should have 4-bits length. How can I do that?
In C I can do something like:
typedef struct MyStructure
{
uint8_t value1 :4;
uint8_t value2 :4;
uint8_t value3 :8;
}