0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

64 lines
1.6 KiB
C
Raw Normal View History

2023-09-09 08:03:56 +01:00
/* Copyright 2023 Manuel Jinger
* Copyright 2023 Dual Tachyon
* https://github.com/DualTachyon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DRIVER_KEYBOARD_H
#define DRIVER_KEYBOARD_H
#include <stdbool.h>
#include <stdint.h>
2023-10-08 17:14:13 +01:00
enum key_code_e {
2023-10-10 00:00:22 +01:00
KEY_0 = 0, // DTMF 0
KEY_1, // DTMF 1
KEY_2, // DTMF 2
KEY_3, // DTMF 3
KEY_4, // DTMF 4
KEY_5, // DTMF 5
KEY_6, // DTMF 6
KEY_7, // DTMF 7
KEY_8, // DTMF 8
KEY_9, // DTMF 9
KEY_MENU, // DTMF A
KEY_UP, // DTMF B
KEY_DOWN, // DTMF C
KEY_EXIT, // DTMF D
KEY_STAR, // DTMF *
KEY_F, // DTMF #
KEY_PTT, //
KEY_SIDE2, //
KEY_SIDE1, //
2023-10-10 00:00:22 +01:00
KEY_INVALID //
};
2023-10-08 17:14:13 +01:00
typedef enum key_code_e key_code_t;
2023-09-09 08:03:56 +01:00
extern uint8_t g_ptt_debounce;
extern uint8_t g_key_debounce_press;
extern uint8_t g_key_debounce_repeat;
extern key_code_t g_key_prev;
extern bool g_key_held;
extern bool g_fkey_pressed;
extern bool g_ptt_is_pressed;
extern bool g_ptt_was_released;
extern bool g_ptt_was_pressed;
extern uint8_t g_keypad_locked;
2023-09-09 08:03:56 +01:00
2023-10-08 17:14:13 +01:00
key_code_t KEYBOARD_Poll(void);
2023-09-09 08:03:56 +01:00
#endif