Seriously, there must be a hack or a way (using Code Composer Studio CCS) to use structures and unions to access individual bits in SFR.
IAR already has this feature, I know, but I would like to use CCS instead.
Example:
volatile union
{
unsigned char IE1; /* Interrupt Enable 1 */
struct
{
unsigned char WDTIE : 1; /* Watchdog Interrupt Enable */
unsigned char OFIE : 1; /* Osc. Fault Interrupt Ena */
unsigned char : 2;
unsigned char NMIIE : 1; /* NMI Interrupt Enable */
unsigned char ACCVIE : 1; /* Flash Access Violation Interrupt Enable */
} IE1_bit;
} MY_IE1 @ 0x0000;
This way I should be able to use: MY_IE1.IE1_bit.WDTIE=1;
However, the compiler throws two errors:
1) expected a field name
2) Identifier MY_IE1 is undefined
Is there a way I can get this to work in CCS ( Version: 4.1.2.00027 ) ? I would really appreciate it.