This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Simple to read and write P1 bits



Hi,

I'm used to Microchip, and they have a C compilator that you can access (read/write) a single bit of the Port. We don't need to use logic as (P1OUT |= BIT1& BIT2;). In Microchip you only put (PORTBbits.RB1=1; PORTBbits.RB2=1;).

This because of the include file that have:

extern volatile near unsigned char PORTB;
extern volatile near union {
struct {
unsigned RB0:1;
unsigned RB1:1;
unsigned RB2:1;
unsigned RB3:1;
unsigned RB4:1;
unsigned RB5:1;
unsigned RB6:1;
unsigned RB7:1;
};
} PORTBbits;

I'm trying to do something like this using UNION on Code Composer, to access the ports without any logic, like (P1OUT.B1 = 1;)

Does anyone have any suggestions?