4 Replies Latest reply on Jul 11, 2018 3:33 AM by Chva_1477726

    Is  there a way to address GPIO pins by using an index with the pin numbers in an array on a PSoC6?




      Because inputs (or outputs for that matter) are typically scattered over several ports, it is painful to access all used inputs as you need to get their status one-by-one.


      Since the PDL in PSoC Creator for PS0C6 works different to PSoC5 in terms of getting a GPIO pin status, I am wondering if one can use a structure in an array and then address the structure from within the PDL function to access the pins? The idea is to have the same line of code with an index in it to read all the needed pins.


      Would this be possible, or more importantly, has anyone done it? If so, can the code be shared?


      I need to debounce several inputs and usually do it byte or word wide. With MCU's with UDB 's, you can take your pins to a Status register and read the register to achieve the above goal, but the PS0C6 I need to use, there are no UDB's.


      Any useful advice will be appreciated and some working code even more!!