TIL today while trying to bit bang a fast clock signal on the GPIO of the ESP32-...
Larry (Mr.Optimization) @fast_code_r_us@floss.social
TIL today while trying to bit bang a fast clock signal on the GPIO of the ESP32-C5 ULP (ultra-low power coprocessor - a 20MHz RISC-V). I was seeing very slow output of my virtual SPI bus because the GPIO functions provided by Espressif have some nested functions with conditional branches and other things which slow it down. Instead, you can directly manipulate the GPIO registers (set/clear) just like on the main CPU:
LP_GPIO.out_w1ts.val = (bit mask)
LP_GPIO.out_w1tc.val = (bit mask)