56 lines
1.2 KiB
C
56 lines
1.2 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);
|
||
|
|
||
|
#ifdef RGB_MATRIX_DATAPOINTER_ENABLED
|
||
|
void cmd_animation(uint8_t *data, uint8_t length);
|
||
|
|
||
|
// Animation data.
|
||
|
// Data received from host is saved here,
|
||
|
// and rgb_matrix_anim_data points to this array when necessary.
|
||
|
extern uint8_t hid_anim_data[32];
|
||
|
|
||
|
// Datapointer
|
||
|
extern void* rgb_matrix_anim_data;
|
||
|
#endif
|
||
|
|
||
|
|
||
|
|
||
|
// Sent by host when connection is initiated.
|
||
|
#define CMD_HELLO 0x00
|
||
|
|
||
|
// 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 0x01
|
||
|
|
||
|
|
||
|
// 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 0x02
|
||
|
|
||
|
// 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
|