Knowledge Base Article
To access registers in firmware, use the following functions.
Similarly REG16 & REG32 functions are also there. Please refer to System Referecne Guide for more APIs.
CY_SET_REG8(CYDEV_IO_PRT_PRT1_DR, 0X01)); // Write the value 1 to Port 1 Data Register.
Port1Register = CY_GET_REG8(CYDEV_IO_PRT_PRT1_DR); // Read the Port 1 Data Register into a Variable "Port1Register"
The macro is defined in the header file, cytypes.h". PSoC 3/5 registers are defined in the header file "cydevice.h"