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.

TM4C123G ROM GPIOPinRead Invert a bit

I am reading values from a couple of pins as so x= ROM_GPIOPinRead(BUTTONS_GPIO_BASE, ALL_BUTTONS)

ALL_BUTTONS is defined as (LEFT_BUTTON | RIGHT_BUTTON)

LEFT and RIGHT BUTTON are there on pins on the same port

BUTTONS_GPIO_BASE is defined as GPIO_PORTC_BASE

From my understanding x is a group of bits.How can I invert just 1 bit from x? For example if x= 0011100. I want invx=0011000. Where the third bit is inverted.