How to operate GPIO Data register?
When reading PRTxDR register, it just reads the electrical level on port wires rather than an internal register (see red marker in below figure). This has a potential risk when a signal is also changed by other external component. For example, PSoC sets PRT1DR[4] high level but then another MCU pulls this wire down, PSoC expects to get a high level by reading the port register, however a low level is actually read and a data error happens.