Ejemplo n.º 1
0
 /** 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);
 }
Ejemplo n.º 2
0
 /** 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);
 }
Ejemplo n.º 3
0
 /**
  * Writes a word to the data register
  *
  * @param dataWord
  */
 public final void setDataReg(int dataWord) {
   cmdBlock.outPortWord(cmdBlockStart + RW16_DATA_OFFSET, dataWord);
 }
Ejemplo n.º 4
0
 /** Sets the interrupt enable register */
 protected final void setInterruptEnable(int mask) {
   io.outPortWord(base + USBINTR, mask);
 }
Ejemplo n.º 5
0
 /** Clear the status register */
 protected final void clearStatus(int clearMask) {
   io.outPortWord(base + USBSTS, clearMask);
 }
Ejemplo n.º 6
0
 /** Sets the command register */
 protected final void setCommand(int command) {
   io.outPortWord(base + USBCMD, command);
 }
Ejemplo n.º 7
0
 /** 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);
 }
Ejemplo n.º 8
0
 /** Sets the frame number register */
 protected final void setFrameNumber(int frnum) {
   io.outPortWord(base + USBFRNUM, frnum);
 }