65 lines
1.3 KiB
C
65 lines
1.3 KiB
C
#pragma once
|
|
#include "betalupi_ergodox.h"
|
|
#include "raw_hid.h"
|
|
|
|
|
|
void raw_hid_receive(uint8_t *data, uint8_t length);
|
|
void hid_send_state(void);
|
|
|
|
|
|
void cmd_animation(uint8_t *data, uint8_t length);
|
|
|
|
#ifdef RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
|
extern uint8_t g_rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS];
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Sent by host when connection is initiated.
|
|
//
|
|
// Packet structure:
|
|
// Data: | cmd |
|
|
// # of Bytes: | 1 |
|
|
#define CMD_HELLO 0x00
|
|
|
|
// Sent periodically by host to test connection.
|
|
// Keyboard should ignore this command.
|
|
//
|
|
// Packet structure:
|
|
// Data: | cmd |
|
|
// # of Bytes: | 1 |
|
|
#define CMD_RUTHERE 0x01
|
|
|
|
// Send keyboard state to host.
|
|
//
|
|
// Packet structure:
|
|
// Data: | cmd | anim state |
|
|
// # of Bytes: | 1 | 1 |
|
|
//
|
|
// anim state:
|
|
// 0x00: RGBMatrix disabled
|
|
// 0x01: normal animation, no HID data.
|
|
// 0x02: FFT Animation
|
|
#define CMD_SEND_STATE 0x02
|
|
|
|
|
|
// Animation data. Sent by host.
|
|
//
|
|
// Packet structure:
|
|
// Data: | cmd | data type | data |
|
|
// # of Bytes: | 1 | 1 | ? |
|
|
//
|
|
// data type:
|
|
// Which animation this data is for. These are defined below.
|
|
//
|
|
// data:
|
|
// Animation data. Content depends on data type.
|
|
#define CMD_ANIM_DATA 0x03
|
|
|
|
// Data for FFT animation.
|
|
// Data segment consists of 10 bits, each representing the height of a column.
|
|
// Minimum height is 0, maximum is 250.
|
|
#define CMD_ANIM_DATA_fft 0x00
|
|
|