4.2 Bit Positions

It is possible to use bit masks to set or clear bits. A bit’s position within a register is defined using the same name as the bit mask, but a different suffix. The code below shows how the bit position can be used to configure a register.

PORTB_OUT |= (1 << PIN0_bp); /* Set PORTB_OUT, bit0 */

The bit position definitions are included for compatibility reasons. They are also needed when programming in assembly for instructions that use a bit number.