keybrd library is an open source library for creating custom-keyboard firmware.
Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.
1234567891011121314151617181920212223242526 |
- #include "PortRead_PCA9655E.h"
-
- /* begin() is called from Scanner_IOE::begin().
- Configures read pins to input.
- */
- void PortRead_PCA9655E::begin(const uint8_t strobeOn)
- {
- Wire.beginTransmission(port.DEVICE_ADDR);
- Wire.write(port.num + 6); //configuration byte command
- Wire.write(readPins); //0=output (for LED), 1=input (for read)
- Wire.endTransmission();
- }
-
- /* read() returns portState.
- Only portState bits of readPins are valid.
- */
- uint8_t PortRead_PCA9655E::read()
- {
- Wire.beginTransmission(port.DEVICE_ADDR);
- Wire.write(port.num); //input byte command
- Wire.endTransmission(false); //PCA9655E needs false to send a restart
-
- Wire.requestFrom(port.DEVICE_ADDR, 1u); //request one byte from input port
-
- return Wire.read();
- }
|