PORT manipulation

Hi,
Is there a way to manipulate the port register directly with the PSoC4 platform like the ATmega from the Arduino project?

e.g.

void setup() {
    DDRD = B11111111; // set PORTD (digital 7~0) to outputs
}

void loop() {
    PORTD = B11110000; // digital 4~7 HIGH, digital 3~0 LOW
    delay(1000);
    PORTD = B00001111; // digital 4~7 LOW, digital 3~0 HIGH
    delay(1000);
}

Hi SebDominguez,

That is possible, although not a trivial task.
There are 9 registers associated with each GPIO port…

Many PSoC4 Registers can be referred to as CYREG_<reg name> using the Heltec repo in PlatformIO.
(For Arduino I don’t know…).
Otherwise use the hardware addresses (all peripheral registers are mem mapped).

Example:
*(reg32 *)CYREG_GPIO_PRT0_PC = <value>; // set Port Configuration register of GPIO Port0 to <value>

Is equal to:
*(volatile uint32 *)0x40040008u = <value>;

I found these documents very helpful when playing with some of the peripherals myself:
Infineon-PSoC_4100S_Plus_Registers_Technical_Reference_Manual-AdditionalTechnicalInformation-v04_00-EN.pdf

Infineon-PSoC_4100S_and_PSoC_4100S_Plus_PSoC_4_Architecture_TRM-AdditionalTechnicalInformation-v12_00-EN.pdf

Thank you so much! That’s exactly what I was looking for.