|
|
| UnitCardKB2UART (const uint8_t addr=DEFAULT_ADDRESS) |
| |
| virtual bool | begin () override |
| |
| virtual void | update (const bool force=false) override |
| |
| virtual keyboard::key_index_t | toKeyIndex (const char ch) const override |
| | Obtains the key index corresponding to the specified character.
|
| |
|
|
config_t | config () |
| | Gets the configuration.
|
| |
|
void | config (const config_t &cfg) |
| | Set the configuration.
|
| |
|
| virtual bool | readFirmwareVersion (uint8_t &ver) override |
| | Read the firmware version.
|
| |
|
| virtual bool | readMode (keyboard::Mode &) override |
| | Not supported on CardKB2UART.
|
| |
| virtual bool | writeMode (const keyboard::Mode) override |
| | Not supported on CardKB2UART.
|
| |
|
| UnitKeyboardBitwise (const uint8_t addr=DEFAULT_ADDRESS) |
| |
| virtual char | getchar () const override |
| | Gets the input character.
|
| |
| uint8_t | pressed () const |
| | Get the oldest pressed key.
|
| |
| virtual uint8_t | released () const override |
| | Get the oldest released key.
|
| |
| bool | startPeriodicMeasurement (const uint32_t interval) |
| | Start periodic measurement.
|
| |
|
bool | startPeriodicMeasurement () |
| | Start periodic measurement using current settings.
|
| |
| bool | stopPeriodicMeasurement () |
| | Stop periodic measurement.
|
| |
|
keyboard::key_status_bits_t | nowBits () const |
| | Get the bits of the key being pressed.
|
| |
|
keyboard::key_status_bits_t | previousBits () const |
| | Get the bits of the previous key pressed.
|
| |
|
keyboard::key_status_bits_t | pressedBits () const |
| | Get the key bits at the moment they are pressed.
|
| |
|
keyboard::key_status_bits_t | releasedBits () const |
| | Get the key bits at the moment they are released.
|
| |
|
keyboard::key_status_bits_t | holdingBits () const |
| | Get the bits of the held key.
|
| |
|
keyboard::key_status_bits_t | wasHoldBits () const |
| | Get the bits of the key at the moment of hold.
|
| |
|
keyboard::key_status_bits_t | repeatingBits () const |
| | Get the bits of the key that the software is repeatedly pressing.
|
| |
|
keyboard::key_status_bits_t | modifierBits () const |
| | Get the bits of the modifier key being pressed.
|
| |
|
bool | isModifier () const |
| | Is any modifier keys pressed?
|
| |
|
bool | isShift () const |
| | Is the shift key pressed?
|
| |
|
bool | isSymbol () const |
| | Is the symbol key pressed?
|
| |
|
bool | isFunction () const |
| | Is the function key pressed?
|
| |
|
bool | isAlt () const |
| | Is the alt key pressed?
|
| |
|
bool | isControl () const |
| | Is the control key pressed?
|
| |
|
bool | isOption () const |
| | Is the option key pressed?
|
| |
|
bool | isShiftEqual () const |
| | Is only shift pressed among the modifier keys?
|
| |
|
bool | isSymbolEqual () const |
| | Is only symbol pressed among the modifier keys?
|
| |
|
bool | isFunctionEqual () const |
| | Is only function pressed among the modifier keys?
|
| |
|
bool | isAltEqual () const |
| | Is only alt pressed among the modifier keys?
|
| |
|
bool | isControlEqual () const |
| | Is only control pressed among the modifier keys?
|
| |
|
bool | isOptionEqual () const |
| | Is only option pressed among the modifier keys?
|
| |
|
bool | isPressed () const |
| | Is any key press?
|
| |
|
bool | isReleased () const |
| | Is all key release?
|
| |
|
bool | wasPressed () const |
| | Was any key pressed?
|
| |
|
bool | wasReleased () const |
| | Was any key released?
|
| |
|
bool | isHolding () const |
| | Is any key holding?
|
| |
|
bool | wasHold () const |
| | Was any key hold?
|
| |
|
bool | isRepeating () const |
| | Is any key repeating?
|
| |
| bool | isPressed (const keyboard::key_index_t kidx) const |
| | Is the specified key pressed?
|
| |
| bool | isReleased (const keyboard::key_index_t kidx) const |
| | Is the specified key released?
|
| |
| bool | wasPressed (const keyboard::key_index_t kidx) const |
| | Was the specified key pressed?
|
| |
| bool | wasReleased (const keyboard::key_index_t kidx) const |
| | Was the specified key released?
|
| |
| bool | isHolding (const keyboard::key_index_t kidx) const |
| | Is the specified key holding?
|
| |
| bool | wasHold (const keyboard::key_index_t kidx) const |
| | Was the specified key hold?
|
| |
| bool | isRepeating (const keyboard::key_index_t kidx) const |
| | Is the specified key repeating?
|
| |
| bool | isPressed (const char ch) const |
| | Is the specified character pressed?
|
| |
| bool | isReleased (const char ch) const |
| | Is the specified character released?
|
| |
| bool | wasPressed (const char ch) const |
| | Was the specified character pressed?
|
| |
| bool | wasReleased (const char ch) const |
| | Was the specified character released?
|
| |
| bool | isHolding (const char ch) const |
| | Is the specified character holding?
|
| |
| bool | wasHold (const char ch) const |
| | Was the specified character hold?
|
| |
| bool | isRepeating (const char ch) const |
| | Is the specified character repeating?
|
| |
| uint8_t | firmwareVersion () const |
| | Gets the firmware version.
|
| |
|
uint32_t | holdingThreshold () const |
| | Gets the holding threshold (ms)
|
| |
|
uint32_t | repeatingThreshold () const |
| | Gets the repeating threshold (ms)
|
| |
| void | setHoldingThreshold (const uint32_t ms) |
| | Sets the holding threshold.
|
| |
| void | setRepeatingThreshold (const uint32_t ms) |
| | Sets the repeating threshold.
|
| |
|
| UnitKeyboard (const uint8_t addr=DEFAULT_ADDRESS) |
| |
Card-size 42 key QWERTY keyboard — UART mode (SKU:U215)
CardKB2 supports I2C and UART communication via GROVE port, selectable on the device:
- Fn+Sym+1: I2C mode (factory default) — use UnitCardKB2 for this mode
- Fn+Sym+2: UART mode (115200-8N1) — sends KEY_ID + KEY_STATE packets
The selected mode is saved and persists across power cycles.
In UART mode, press/release key events are received as packets, enabling full bitwise key state tracking (isPressed, isHolding, isRepeating, etc.).
- Note
- Sym key operates as a toggle (press once to activate, press again to deactivate). Blue LED indicates Sym mode is active.
-
Fn+D/Z/X/C arrow keys work in UART mode (hold Fn, then press D/Z/X/C). Fn+1 (ESC) may require a long press due to a firmware issue.
-
Unlike CardKB/FacesQWERTY, CardKB2 does not support software mode switching via readMode()/writeMode().
- Warning
- After switching communication mode (Fn+Sym+1/2), press the RST button on CardKB2 to reset modifier state. This will be fixed in a future firmware update.