private static void WaitForReady() { do { IOPort.Outb((byte)cmos.Address, 10); }while ((IOPort.Inb((byte)cmos.Data) & 0x80) != 0); }
public static void SetupPort(Port PORT = Port.Com1) { IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_Interrupt), 0x00); // Disable all interrupts IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_ModemControl), 0x80); // Enable DLAB (set baud rate divisor) IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_Data), 0x03); // Set divisor to 3 (lo byte) 38400 baud IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_Interrupt), 0x00); // (hi byte) IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_ModemControl), 0x03); // 8 bits, no parity, one stop bit IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_LineControl), 0xC7); // Enable FIFO, clear them, with 14-byte threshold IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_LineStatus), 0x0B); // IRQs enabled, RTS/DSR set IOPort.Outb((ushort)(PORT + (ushort)Cmd.COM_Interrupt), 0x0F); }
public static void Write(byte a, Port PORT = Port.Com1) { WaitForWriteReady(PORT); IOPort.Outb((ushort)PORT, a); }
private static byte RTC_Register(byte aNo) { IOPort.Outb((byte)cmos.Address, aNo); return(IOPort.Inb((byte)cmos.Data)); }