nand2/07_Operating_System/02_UART_Test/GPIO.jack
Michael Schröder 971b323822 added v2.0
2023-01-11 23:04:57 +01:00

26 lines
334 B
Plaintext

class GPIO {
static Array gpio;
function void init(int addr){
let gpio = addr;
return;
}
function boolean readBut() {
if (gpio[1] & 2){
return false;
}
return true;
}
function void writeLed(int c){
let gpio[0] = c;
return;
}
function void readLed(){
return gpio[0];
}
}