I made a bit-declaration for a dspic30f4011
I declared a part
typedef struct tagCxTXxSIDBITS_tagCxTXxEIDBITS {
unsigned : 2;
unsigned SRC7_2 : 6;
unsigned : 8;
unsigned : 14;
unsigned SRC1_0 : 2;
} CxTXxSRCBITS;
extern volatile unsigned int C1TX0SRC __attribute__((__sfr__));
extern volatile CxTXxSRCBITS C1TX0SRCbits __attribute__((__sfr__));
extern volatile unsigned int C1TX1SRC __attribute__((__sfr__));
extern volatile CxTXxSRCBITS C1TX1SRCbits __attribute__((__sfr__));
extern volatile unsigned int C1TX2SRC __attribute__((__sfr__));
extern volatile CxTXxSRCBITS C1TX2SRCbits __attribute__((__sfr__));
Is this correct? Are the first two the CxTXxSID bits 0 and 1? Then CxTXxSID bits 2-7 the 8 are CxTXxSID bits 8-15 are the 14 for CxTXxEID bits 0-13 ? And the last two for CxTXxEID bits 14 and 15?
If it is, I made it right
If I write in my code
C1TX0SRC = 0x0001;
do I get following in the registers ?
C1TX0SID = 0b0000000000000000
C1TX0EID = 0b0100000000000000