qmk-keychron-q3-colemak-dh/quantum/vial.h

51 lines
1.5 KiB
C
Raw Normal View History

2020-10-14 21:16:42 +02:00
/* Copyright 2020 Ilya Zhuravlev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <inttypes.h>
2020-12-07 01:23:57 +01:00
#include <stdbool.h>
2021-07-03 05:19:41 +02:00
#define VIAL_PROTOCOL_VERSION ((uint32_t)0x00000004)
2020-10-14 21:16:42 +02:00
void vial_handle_cmd(uint8_t *data, uint8_t length);
2020-12-07 01:23:57 +01:00
#ifdef VIAL_ENCODERS_ENABLE
bool vial_encoder_update(uint8_t index, bool clockwise);
2020-12-07 01:23:57 +01:00
#endif
2020-12-27 14:03:10 +01:00
extern int vial_unlocked;
extern int vial_unlock_in_progress;
enum {
vial_get_keyboard_id = 0x00,
vial_get_size = 0x01,
vial_get_def = 0x02,
vial_get_encoder = 0x03,
vial_set_encoder = 0x04,
vial_get_unlock_status = 0x05,
vial_unlock_start = 0x06,
vial_unlock_poll = 0x07,
vial_lock = 0x08,
2021-06-30 01:43:11 +02:00
vial_qmk_settings_query = 0x09,
vial_qmk_settings_get = 0x0A,
vial_qmk_settings_set = 0x0B,
2021-07-01 21:00:12 +02:00
vial_qmk_settings_reset = 0x0C,
};
/* Fake encoder position in keyboard matrix, can't use 255 as that is immediately rejected by IS_NOEVENT */
#define VIAL_ENCODER_MATRIX_MAGIC 254