You can try to invert the output of a pin from IO_BANK0: GPIO[xx]_CTRL Registers:Bingo!13:12 OUTOVER RW 0x0
Enumerated values:
0x0 → NORMAL: drive output from peripheral signal selected by funcsel
0x1 → INVERT: drive output from inverse of peripheral signal selected by funcsel
0x2 → LOW: drive output low
0x3 → HIGH: drive output high
Thank you, that worked!
Setting gpio_set_outover (SPI1_CS, GPIO_OVERRIDE_INVERT); was the key. I can now read values from the 74HC165 using GPIO_FUNC_SPI alone. The changes to the setup block were:And, it works like a champ! I've got to get a USB serial analyzer to take the guesswork out of waveforms and pin behavior.Code:
gpio_set_function (SPI1_CS, GPIO_FUNC_SPI); /* test if inverting will allow CS to trigger load */ gpio_set_outover (SPI1_CS, GPIO_OVERRIDE_INVERT);
Statistics: Posted by drankinatty — Wed Aug 06, 2025 3:53 pm