Reading port pins in FX2LP | Cypress Semiconductor
Support & Community
Reading port pins in FX2LP
Last Updated: May 24, 2011
How to read ports pins in FX2LP?
Consider that PORT C has to be configured as input port and its data has to be read. The below code configure PORT C as input port and reads the PORTC pins.
PORTCCFG = 0x00; // PORTC is is configured as an I/O
OEC = 0x00; // PORTC is an input
pinData = IOC; // Reading the Port C pins