Port 4 pins are reserved to the Uart and I2C PSOC Creator will flag them if you try to use them as GPIO.
This is not quite correct, Bob ;-)
You may disable the hardware connection and use the port4 pin with pin_Write() and pin_Read(). This is probably what David wants to do.
Bob I have tried this and Psoc Creator complains. But I'll check it again and see what happens.
The code I wrote is correct except one line...
regVal&= ~ 0x00000F00u;
FOR I2C pin SCL, 4.0
I have to write
regVal&= ~ 0x0000000Fu;
Because I have to write bits concerting to port 4.0 of HSIOM, now it works :)