Defining the register definitions as Union of Struct, with bit-mapped fields seems to me, the correct [best] way to do it. For instance, my real-life case where I want to temporarily change the Timer 1 Prescale bits. The MikroC "accepted" [apparently] way of doing it is:
Code: Select all
TCKPS_0_bit = 1;
TCKPS_1_bit = 1;
Code: Select all
T1CONbits.TCKPS = 0x3;