Cypress Perform

Home > Support & Community
support.cypress.com     Bookmark and Share
Support & Community

Knowledge Base Article



Accessing PSoC 3/5 Registers in Firmware

Last Updated: 05/07/2012

How do I access (Read/Write) the Registers of PSoC 3/5 in firmware?

To access registers in firmware, use the following functions.

CY_SET_REG8(addr, value);

CY_GET_REG8(addr);

 

Similarly REG16 & REG32 functions are also there. Please refer to System Referecne Guide for more APIs.


Example:

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"


Related Categories: PSoC® 5, PSoC® 3, PSoC® Software


Provide feedback on this article

Did this article help you solve your problem?

Yes

No

Maybe

Additional comments:

To protect your privacy, do not include contact information in your feedback.

 Help us improve by taking a brief survey
Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 06/15/20
Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 06/15/20