Actions

EmSys

C - Typedef2

From EdWiki

Revision as of 09:31, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Typedef ...

As a more complicated example, we could make typedefs for the LSR shown earlier:

typedef union tagLSR {	
    struct {
        unsigned int DataReady	: 1;
	unsigned int OverrunErr	: 1;
	unsigned int ParityErr	: 1;
	unsigned int FrameErr	: 1;
	unsigned int Break	: 1;
	unsigned int THEmpty	: 1;
	unsigned int TSEmpty	: 1;
	unsigned int Notused	: 1
    }bit;
    unsigned char byte;
}LSR;