示例#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);
 }
示例#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);
 }
示例#3
0
 /**
  * Gets a word from the data register
  *
  * @return a word from the data register
  */
 public final int getDataReg() {
   return cmdBlock.inPortWord(cmdBlockStart + RW16_DATA_OFFSET);
 }
示例#4
0
 /** Gets the frame number register */
 protected final int getFrameNumber() {
   return io.inPortWord(base + USBFRNUM);
 }
示例#5
0
 /** Gets the interrupt enable register */
 protected final int getInterruptEnable() {
   return io.inPortWord(base + USBINTR);
 }
示例#6
0
 /** Are the given bits in the status register set? */
 protected final boolean getStatusBits(int mask) {
   return ((io.inPortWord(base + USBSTS) & mask) == mask);
 }
示例#7
0
 /** Gets the status register */
 protected final int getStatus() {
   return io.inPortWord(base + USBSTS);
 }
示例#8
0
 /** Are the given bits in the command register set? */
 protected final boolean getCommandBits(int mask) {
   return ((io.inPortWord(base + USBCMD) & mask) == mask);
 }
示例#9
0
 /** Gets the command register */
 protected final int getCommand() {
   return io.inPortWord(base + USBCMD);
 }
示例#10
0
 /** Are the given bits in the port status and control register set? */
 protected final boolean getPortSCBits(int port, int mask) {
   return ((io.inPortWord(base + USBPORTSC1 + (port << 1)) & mask) == mask);
 }
示例#11
0
 /** Gets the port status and control register */
 protected final int getPortSC(int port) {
   return io.inPortWord(base + USBPORTSC1 + (port << 1));
 }