local M = {} minipc = M function M.setStatusLED(on) if on then dos.outp(0x334, 64, "set") else dos.outp(0x334, 64, "clear") end end function M.eepromWrite(addr, value) dos.int86(0x15, {ax = 0xC321, bh = addr, bl = value}) end function M.eepromRead(addr) local _, out_regs = dos.int86(0x15, {ax = 0xC320, bh = addr}) return out_regs.al; end function M.snRead() local _, out_regs = dos.int86(0x15, {ax = 0xC330}) return string.format("%04X:%04X:%04X", out_regs.cx, out_regs.bx, out_regs.ax) end function M.systemTimerRead() local _, out_regs = dos.int86(0x1A, {ah = 0x00}) return out_regs.cx * (2 ^ 16) + out_regs.dx end function M.i2cPutDAC(value) local _, out_regs = dos.int86(0x15, {ah=0xC3, al=0x2D, ch=0x90, bh=0x40, bl=value}) if out_regs.cflag == 0 then return true else return false end end function M.i2cGetADC(config) local _, out_regs = dos.int86(0x15, {ah=0xC3, al=0x2B, ch=0x90, bl=config}) if out_regs.cflag == 0 then _, out_regs = dos.int86(0x15, {ah=0xC3, al=0x2C, ch=0x90}) if out_regs.cflag == 0 then return true, out_regs.al else return false end else return false end end