Espruino won't be doing it in 2 steps, but chances are it's fast enough that you won't notice the LED going out for a fraction of a second and then going back on - however doing read then write isn't guaranteed to give you the results you want (if you do it on an IO pin that's shorted to ground you'll always get 0 returned).
That's at address 0x50000504, so you just do peek32(0x50000504) and you'll get a number representing the output state of all pins.
On Puck.js it looks like you're using pin D5 - so it's the 5th bit (counting from 0), so to get the value you want something like (peek32(0x50000504)>>5)&1.
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.
Espruino won't be doing it in 2 steps, but chances are it's fast enough that you won't notice the LED going out for a fraction of a second and then going back on - however doing read then write isn't guaranteed to give you the results you want (if you do it on an IO pin that's shorted to ground you'll always get 0 returned).
Honestly, I would do it in software. However if you're just wanting to play around with hardware, you're after the
OUT
register underGPIO
in http://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.0.pdfThat's at address
0x50000504
, so you just dopeek32(0x50000504)
and you'll get a number representing the output state of all pins.On Puck.js it looks like you're using pin
D5
- so it's the 5th bit (counting from 0), so to get the value you want something like(peek32(0x50000504)>>5)&1
.