/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>

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/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H

#include <stdint.h>
#include <stdbool.h>
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_layer.h"
#include "report.h"
#include "host.h"
#include "print.h"
#include "debug.h"
#include "keymap.h"


extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];


/* TV44 keymap definition macro
 */
#define KEYMAP( \
    K35, K45, K55, K54, K44, K3A, K4A, K5A, K5B, K4B, K38, K48, K4D, K4F, K10, K5E,    K6A, K3F, K1F, K0F, \
    K32, K22, K25, K24, K26, K36, K37, K27, K2B, K28, K3D, K5D, K3E,           K2E,    K4E, K70, K7G, K6G, \
    K42,      K12, K15, K14, K16, K46, K47, K17, K1A, K18, K2D, K1D, K1E,      K05,    K60, K62, K5G, K3G, \
    K34,      K00, K0E, K0A, K06, K56, K57, K07, K04, K08, K0D, K7E,           K6E,    K50, K40, K4G,      \
    K69,      K65, K75, K74, K76, K66, K67, K77, K7A, K78, K7D, K79,           K6D,    K20, K30, K2G, K0G, \
    K6C, K52, K51, K63, K2A,                K64,           K73, K1B, K7C, K0B, K68,   K6F, K02, K1G \
) { \
    { KC_##K00, KC_NO,    KC_##K02, KC_NO,    KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_NO,    KC_##K0A, KC_##K0B, KC_NO,    KC_##K0D, KC_##K0E, KC_##K0F, KC_##K0G }, \
    { KC_##K10, KC_NO,    KC_##K12, KC_NO,    KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_NO,    KC_##K1A, KC_##K1B, KC_NO,    KC_##K1D, KC_##K1E, KC_##K1F, KC_##K1G }, \
    { KC_##K20, KC_NO,    KC_##K22, KC_NO,    KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_NO,    KC_##K2A, KC_##K2B, KC_NO,    KC_##K2D, KC_##K2E, KC_NO,    KC_##K2G }, \
    { KC_##K30, KC_NO,    KC_##K32, KC_NO,    KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_NO,    KC_##K3A, KC_NO,    KC_NO,    KC_##K3D, KC_##K3E, KC_##K3F, KC_##K3G }, \
    { KC_##K40, KC_NO,    KC_##K42, KC_NO,    KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_NO,    KC_##K4A, KC_##K4B, KC_NO,    KC_##K4D, KC_##K4E, KC_##K4F, KC_##K4G }, \
    { KC_##K50, KC_##K51, KC_##K52, KC_NO,    KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_NO,    KC_NO,    KC_##K5A, KC_##K5B, KC_NO,    KC_##K5D, KC_##K5E, KC_NO,    KC_##K5G }, \
    { KC_##K60, KC_NO,    KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, KC_##K69, KC_##K6A, KC_NO,    KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F, KC_##K6G }, \
    { KC_##K70, KC_NO,    KC_NO,    KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77, KC_##K78, KC_##K79, KC_##K7A, KC_NO,    KC_##K7C, KC_##K7D, KC_##K7E, KC_NO,    KC_##K7G }  \
}

#endif
