Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards (#7915)
[jackhill/qmk/firmware.git] / quantum / keymap.h
CommitLineData
db32864c 1/*
23839b8c 2Copyright 2012-2016 Jun Wako <wakojun@gmail.com>
db32864c
JH
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef KEYMAP_H
19#define KEYMAP_H
20
21#include <stdint.h>
22#include <stdbool.h>
23#include "action.h"
4d4f7684 24#if defined(__AVR__)
b624f32f 25# include <avr/pgmspace.h>
53ff8a31 26#elif defined PROTOCOL_CHIBIOS
b624f32f 27// We need to ensure that chibios is include before redefining reset
28# include "ch.h"
4d4f7684 29#endif
db32864c
JH
30#include "keycode.h"
31#include "action_macro.h"
32#include "report.h"
33#include "host.h"
34// #include "print.h"
35#include "debug.h"
36#include "keycode_config.h"
37
4d4f7684 38// ChibiOS uses RESET in its FlagStatus enumeration
39// Therefore define it as QK_RESET here, to avoid name collision
40#if defined(PROTOCOL_CHIBIOS)
b624f32f 41# define RESET QK_RESET
4d4f7684 42#endif
43
d8a608f3
W
44#include "quantum_keycodes.h"
45
46// translates key to keycode
db32864c
JH
47uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key);
48
d8a608f3 49// translates function id to action
b624f32f 50uint16_t keymap_function_id_to_action(uint16_t function_id);
d8a608f3 51
db32864c
JH
52extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
53extern const uint16_t fn_actions[];
54
db32864c 55#endif