(pin, mode)
| 488 | } |
| 489 | } |
| 490 | doSetPinMode(pin, mode) { |
| 491 | const port = this.ports[pin >> 3]; |
| 492 | const mask = 1 << ((pin & 7) + port.shift); |
| 493 | if (fDIGITAL_INPUT === mode) { |
| 494 | port.inputs |= mask; |
| 495 | port.outputs &= ~mask; |
| 496 | } |
| 497 | else if (fDIGITAL_OUTPUT === mode) { |
| 498 | port.inputs &= ~mask; |
| 499 | port.outputs |= mask; |
| 500 | } |
| 501 | this.rebuildPort(port); |
| 502 | } |
| 503 | doDigitalWrite(port, value) { |
| 504 | port = this.ports[port]; |
| 505 | port.outBank.write(value << port.shift); |