I was using pic microcontroler, but now i want migrate to ARM Cortex, due this i'm new in ARM world and i wanna change state of single pin
i get change state of pin like below
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_2 );
while (1){
GPIOPinWrite(GPIO_PORTG_BASE,GPIO_PIN_2, GPIO_PIN_2);
GPIOPinWrite(GPIO_PORTG_BASE,GPIO_PIN_2, 0);
}
but i need read state of pin and inverting state like below
while (1){
GPIOPinWrite(GPIO_PORTG_BASE,GPIO_PIN_2, ! GPIO_PIN_2); //this code dont work i try use GPIOPinRead but don't work too
}
how can i make this change ?