/** Sets certain bits of the command register on/off */ protected final void setCommandBits(int mask, boolean on) { int cmd = io.inPortWord(base + USBCMD); if (on) { cmd |= mask; } else { cmd &= ~mask; } io.outPortWord(base + USBCMD, cmd); }
/** Sets certain bits of the port1 status and control register on/off */ protected final void setPortSCBits(int port, int mask, boolean on) { int sc = io.inPortWord(base + USBPORTSC1 + (port << 1)); sc &= 0xFFF5; if (on) { sc |= mask; } else { sc &= ~mask; } io.outPortWord(base + USBPORTSC1 + (port << 1), sc); }
/** * Writes a word to the data register * * @param dataWord */ public final void setDataReg(int dataWord) { cmdBlock.outPortWord(cmdBlockStart + RW16_DATA_OFFSET, dataWord); }
/** Sets the interrupt enable register */ protected final void setInterruptEnable(int mask) { io.outPortWord(base + USBINTR, mask); }
/** Clear the status register */ protected final void clearStatus(int clearMask) { io.outPortWord(base + USBSTS, clearMask); }
/** Sets the command register */ protected final void setCommand(int command) { io.outPortWord(base + USBCMD, command); }
/** Sets all bits of the port1 status and control register */ protected final void setPortSC(int port, int value) { io.outPortWord(base + USBPORTSC1 + (port << 1), value); }
/** Sets the frame number register */ protected final void setFrameNumber(int frnum) { io.outPortWord(base + USBFRNUM, frnum); }