Add keymap stub

This commit is contained in:
Jeremy Soller 2019-11-07 19:58:28 -07:00
parent 5b7266b5f9
commit 0c60ede118
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
4 changed files with 29 additions and 2 deletions

View File

@ -4,7 +4,6 @@
#include <ec/kbc.h>
void kbc_init(void);
void kbc_event(struct Kbc * kbc);
#endif // _BOARD_KBC_H

View File

@ -4,7 +4,6 @@
#include <ec/kbscan.h>
void kbscan_init(void);
void kbscan_event(void);
#endif // _BOARD_KBSCAN_H

View File

@ -0,0 +1,8 @@
#ifndef _BOARD_KEYMAP_H
#define _BOARD_KEYMAP_H
#include <stdint.h>
uint16_t keymap(int layer, int output, int input);
#endif // _BOARD_KEYMAP_H

View File

@ -0,0 +1,21 @@
#include <board/keymap.h>
// Keymap layers (normal, Fn)
#define KM_LAY 2
// Keymap output pins
#define KM_OUT 16
// Keymap input pins
#define KM_IN 8
uint16_t __code KEYMAP[KM_IN][KM_OUT][KM_LAY] = {
// TODO
{ { 0 } }
};
uint16_t keymap(int layer, int output, int input) {
if (layer < KM_LAY && output < KM_OUT && input < KM_IN) {
return KEYMAP[input][output][layer];
} else {
return 0;
}
}