The GPIO module provides up to 32 programmable I/O ports with each port being able to be independently programmed. A maskable interrupt is generated for each pin for a pre-defined event selectable from high or low level, rising, falling or any edge. An interrupt is generated if a specified event is seen for any pin whose interrupt is not masked. Four modes control the flow of data through the module. In bypass mode, data is routed directly between the bypass port and the GPIO port. Data is not latched or registered in either direction. In GPIO mode, the I/O port is made available to internal registers. In input mode, data is routed from the I/O port to internal registers or to internal registers and the bypass port. In output mode, data is routed to the GPIO port from internal registers or from the bypass port. Bypass and GPIO modes are mutually exclusive per pin with input and output modes being mutually inclusive per pin.