P. 1
First Steps with Embedded Systems

First Steps with Embedded Systems

|Views: 730|Likes:
Published by api-3783901

More info:

Published by: api-3783901 on Nov 21, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less






Using bit fields allows the declaration of a structure which takes up the
minimum amount of space. A bit field contains a specified number of bits, it is
a member of a structure and is accessed like any other structure member. The
following example for the Motorola MC68HC705C8 defines the Timer Control
Register (TCR) bits as bit fields in the structure called TCR.

Complex Data Types


struct reg_tag {
int ICIE : 1; // field ICIE 1 bit long
int OCIE : 1; // field OCIE 1 bit long
int notUsed : 3 = 0; //notUsed is 3 bits and set to 0
int IEDG : 1; // field IEDG 1 bit long
int OLVL : 1; // field OLVL 1 bit long

} TCR;

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->