nand2/07_Operating_System/02_UART_Test/GPIO.jack

26 lines
334 B
Plaintext
Raw Permalink Normal View History

2023-01-11 10:13:09 +00:00
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];
}
}