Hi dears
I am trying to give square wave on the GPIO 21 and want to read this data to take some action according to its state as one or zero in square wave. I am using following code
#define Hall_a (GpioDataRegs.GPADAT.bit.GPIO21);
Hall_a_result =0;
void Hall_Sensor()
{
EALLOW;
GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO21 = 0;
GpioCtrlRegs.GPAPUD.bit.GPIO21 = 0;
EDIS;
if (Hall_a==1) // Here it gives error
Hall_a_result =1;
else
Hall_a_result = 2;
}
In if condition I want to check whether it is one or zero at the GPIO pin through external square wave source. How can I do this. Please help
Best Regards
Shahid