Added special char cmd

This commit is contained in:
2022-08-10 09:11:09 -07:00
parent 2545f15b30
commit 779965ff33
8 changed files with 131 additions and 33 deletions

View File

@ -1,5 +1,8 @@
#pragma once
// Sent by host when connection is initiated.
//
// Packet structure:
@ -7,6 +10,9 @@
// # of Bytes: | 1 |
#define CMD_HELLO 0x00
// Sent periodically by host to test connection.
// Keyboard should ignore this command.
//
@ -15,6 +21,9 @@
// # of Bytes: | 1 |
#define CMD_RUTHERE 0x01
// Send keyboard state to host.
//
// Packet structure:
@ -40,23 +49,7 @@
#define CMD_SEND_STATE 0x02
// Sent by keyboard to host when a complete word is typed.
// Host checks if this is a known word.
// If it is not, host responds with the same CMD (see below).
//
// Packet structure (sent by keyboard):
// Data: | cmd | word length | keycodes |
// # of Bytes: | 1 | 1 | ? |
//
// word length: number of bytes in `keycodes` block
//
//
// Packet structure (sent by host):
// Data: | cmd | typo? |
// # of Bytes: | 1 | 1 |
//
// typo: If this is 0x01, the word we got was a typo.
#define CMD_SPELLCHECK_WORD 0x04
// Animation data. Sent by host.
//
@ -76,3 +69,38 @@
// Minimum height is 0, maximum is 250.
#define CMD_ANIM_DATA_fft 0x00
// Sent by keyboard to host when a complete word is typed.
// Host checks if this is a known word.
// If it is not, host responds with the same CMD (see below).
//
// Packet structure (sent by keyboard):
// Data: | cmd | word length | keycodes |
// # of Bytes: | 1 | 1 | ? |
//
// word length: number of bytes in `keycodes` block
//
//
// Packet structure (sent by host):
// Data: | cmd | typo? |
// # of Bytes: | 1 | 1 |
//
// typo: If this is 0x01, the word we got was a typo.
#define CMD_SPELLCHECK_WORD 0x04
// Sent by host when a "special char" key is pressed.
// Handled by host interface.
//
// Packet structure:
// Data: | cmd | character |
// # of Bytes: | 1 | 2 |
//
// character:
// uint16_t, character id
//
#define CMD_SPECIAL_CHAR 0x05