Code: Select all
from machine import Pin, mem16
p12=Pin(12, Pin.OUT)
p14=Pin(14, Pin.OUT)
@micropython.viper
def set_gpio(value:int, mask:int):
GPIO_OUT = ptr32(0x3FF44004) # GPIO Output register
GPIO_OUT[0] = (GPIO_OUT[0] & mask) | value
p12.value(0)
print(p12.value())
p14.value(0)
print(p14.value())
#esp32
set_gpio(0b00000000000000000101000000000000,
0b11111111111111111010111111111111)
print(p12.value())
print(p14.value())