Initial import of firmware and host projects
This commit is contained in:
83
KeyBorad/proto/keyboard.proto
Normal file
83
KeyBorad/proto/keyboard.proto
Normal file
@@ -0,0 +1,83 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package keyboard.cdc;
|
||||
|
||||
// The AA55 CDC frame still lives outside protobuf:
|
||||
// [head1][head2][len][type][data][checksum]
|
||||
// `data` is the serialized protobuf payload for the matching `type`.
|
||||
// Keep the outer `type` field for fast dispatch and debugging.
|
||||
|
||||
enum CdcPacketType {
|
||||
CDC_PACKET_TYPE_UNKNOWN = 0;
|
||||
CDC_PACKET_TYPE_HELLO_REQ = 1;
|
||||
CDC_PACKET_TYPE_HELLO_RSP = 2;
|
||||
CDC_PACKET_TYPE_BITMAP = 16;
|
||||
CDC_PACKET_TYPE_FUNCTION_KEY_EVENT = 32;
|
||||
CDC_PACKET_TYPE_LED_STATE = 33;
|
||||
CDC_PACKET_TYPE_TIME_SYNC = 48;
|
||||
CDC_PACKET_TYPE_THEME_RGB = 49;
|
||||
CDC_PACKET_TYPE_ACK = 126;
|
||||
CDC_PACKET_TYPE_ERROR = 127;
|
||||
}
|
||||
|
||||
enum KeyAction {
|
||||
KEY_ACTION_RELEASE = 0;
|
||||
KEY_ACTION_PRESS = 1;
|
||||
}
|
||||
|
||||
enum ErrorCode {
|
||||
ERROR_CODE_NONE = 0;
|
||||
ERROR_CODE_UNKNOWN_TYPE = 1;
|
||||
ERROR_CODE_INVALID_LENGTH = 2;
|
||||
ERROR_CODE_INVALID_PARAM = 3;
|
||||
ERROR_CODE_NOT_READY = 4;
|
||||
}
|
||||
|
||||
message HelloReqPayload {
|
||||
uint32 protocol_version = 1;
|
||||
}
|
||||
|
||||
message HelloRspPayload {
|
||||
uint32 protocol_version = 1;
|
||||
uint32 vendor_id = 2;
|
||||
uint32 product_id = 3;
|
||||
uint32 firmware_major = 4;
|
||||
uint32 firmware_minor = 5;
|
||||
uint32 capability_flags = 6;
|
||||
}
|
||||
|
||||
message BitmapPayload {
|
||||
bytes usage_bitmap = 1;
|
||||
}
|
||||
|
||||
message FunctionKeyEventPayload {
|
||||
uint32 usage = 1;
|
||||
KeyAction action = 2;
|
||||
}
|
||||
|
||||
message LedStatePayload {
|
||||
uint32 led_mask = 1;
|
||||
}
|
||||
|
||||
message TimeSyncPayload {
|
||||
uint32 version = 1;
|
||||
uint32 flags = 2;
|
||||
sint32 timezone_min = 3;
|
||||
fixed64 utc_ms = 4;
|
||||
fixed32 accuracy_ms = 5;
|
||||
}
|
||||
|
||||
message ThemeRgbPayload {
|
||||
uint32 red = 1;
|
||||
uint32 green = 2;
|
||||
uint32 blue = 3;
|
||||
}
|
||||
|
||||
message AckPayload {
|
||||
uint32 acked_type = 1;
|
||||
}
|
||||
|
||||
message ErrorPayload {
|
||||
uint32 error_type = 1;
|
||||
ErrorCode error_code = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user