3.3.2 Change Register Bit Field Configurations Using Bit Masks

The example below shows how to update a register bit field using bit masks to set the new configuration. The current configuration is cleared, and the new configuration is set, in a single line of code.

USART0.CTRLB = (USART0.CTRLB & ~(USART_RXMODE0_bm | USART_RXMODE1_bm)) 
             | USART_RXMODE1_bm; /* Generic Auto-Baud mode */