1 Reply Latest reply on May 31, 2019 12:43 PM by RaPe_287896

    How do I configure GPIO mode in C?

    RaPe_287896

      I am using the CY8C20234 CPU. Previously, I used assembly language to set Port 1 to STRONG with voltage to 2.4 VDC. The initial value was set in the PSOC Designer Pinout menu to 1.

       

      or   F,           %00010000

      or   REG[IO_CFG], %00110010

      and  F,           %11101111

       

      This works correctly, putting out 2.4VDC on pin 1_2.

       

      I have tried this in C, but the voltage on this pin end's up being 0VDC.

       

      asm("or  F,         %00010000");

      asm("or  REG[0xDC], %00110010");

      asm("and F,         %11101111");

       

      I think it might have to do with the register address which I borrowed from the assembly project's hex output. Though either way I am sure there is a better way to do this in C. What is the best way to do accomplish this in C?