Just looking at your code, you use GPIO.out_w1tc/GPIO.out_w1ts. This is really very similar to what we do for STM32 already: https://github.com/espruino/Espruino/blob/e06b3e24de42adb1de6e2cc6046e525880760e7d/src/jswrap_io.c#L462
GPIO.out_w1tc/GPIO.out_w1ts
There's a function called jshGetPinAddress: https://github.com/espruino/Espruino/blob/e06b3e24de42adb1de6e2cc6046e525880760e7d/src/jswrap_io.c#L574
jshGetPinAddress
While this only deals with one address for a pin (which only seems to work on STM32) we could extend that to return:
That would work on nRF52/ESP32 and STM32, and then we could have a fast shiftOut (and also software SPI IIRC) on all platforms, really easily.
shiftOut
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just looking at your code, you use
GPIO.out_w1tc/GPIO.out_w1ts
. This is really very similar to what we do for STM32 already: https://github.com/espruino/Espruino/blob/e06b3e24de42adb1de6e2cc6046e525880760e7d/src/jswrap_io.c#L462There's a function called
jshGetPinAddress
: https://github.com/espruino/Espruino/blob/e06b3e24de42adb1de6e2cc6046e525880760e7d/src/jswrap_io.c#L574While this only deals with one address for a pin (which only seems to work on STM32) we could extend that to return:
That would work on nRF52/ESP32 and STM32, and then we could have a fast
shiftOut
(and also software SPI IIRC) on all platforms, really easily.