Answer to your Qn. 2).
We have a total of 64 GPIOs in FX3, divided into two sets of 32 each. In structure, CyU3PIoMatrixConfig_t,
gpioSimpleEn is an array of two 32 bit elements. gpioSimpleEn represents the first (32) set of Gpios.
gpioSimpleEn represents second (32) set of GPIOs.
Now in order to enable, GPIO 45:
GPIO 45 belongs to second set. Thus taking gpioSimpleEn. In the second set it is 13 pin from the right.
[31,30,29,28,...................4,3,2,1,0 ] => first set of GPIOs represented by gpioSimpleEn.
[63,62,.................45,44,43,42,,41,40,39,38,37,36,35,34,33,32] => seconde set of GPIOs represnted by gpioSimpleEn.
So, as you can see, in order to enable 45th GPIO pin, you have to left shift 1 thirteen times.
io_cfg.gpioSimpleEn = (1 << (45 - 32)); /* Enable GPIO 45 */
= (1 << 13);
Qn.1) Now regarding the difference between the GPIO definintion using IOConfig matrix (CyU3PDeviceConfigureIOMatrix API) and CyU3PDeviceGpioOverride API is clear from API guide. The CyU3PDeviceConfigureIOMatrix API checks for validity of the configuration, whereas the override API does not. Also IO matrix cannot be dynamically changed and needs to be invoked during the device initialization, in the main function itself. I will check further for any other notable difference between them, and will let you know if so.
I find this old thread very useful for me.
But I need further clarifications regarding this
in my custom board a gpio id from FX3 is connected to an LED
I am currently programming a firmware for slavefifo synchronous 32 bit mode.
I have configured the gpio's in slavefifo application initilization function
CyU3PSetGpioOutput(FX3_LED, CyFalse, CyTrue);
and I configure the LED based on slave fifo mode(16 0R 32 bit) . I configure it using gpiosimple en as you have mentioned. But, the problem starts here if I change the state of LED here, sometimes the LED will never light up or when I program the firmware to the fx3 using control center I cant see any firmware booted but says succesfully configured. What might be the problem??