2012-03-15 09:01:36 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
2012-04-25 08:22:20 +02:00
|
|
|
* ergoDOX layout : exports
|
|
|
|
*
|
|
|
|
* Different layouts are included by modifying a variable in the makefile.
|
2012-03-17 02:31:36 +01:00
|
|
|
* ----------------------------------------------------------------------------
|
2012-03-27 12:06:52 +02:00
|
|
|
* Copyright (c) 2012 Ben Blazak <benblazak.dev@gmail.com>
|
|
|
|
* Released under The MIT License (MIT) (see "license.md")
|
|
|
|
* Project located at <https://github.com/benblazak/ergodox-firmware>
|
2012-03-15 09:01:36 +01:00
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
2012-03-27 12:06:52 +02:00
|
|
|
#ifndef LAYOUT_h
|
|
|
|
#define LAYOUT_h
|
2012-03-15 09:01:36 +01:00
|
|
|
|
2012-04-29 08:40:00 +02:00
|
|
|
#include "lib/data-types.h"
|
|
|
|
#include "lib/key-functions.h" // for `kbfun_funptr_t`
|
2012-04-10 10:44:27 +02:00
|
|
|
|
2012-04-25 08:22:20 +02:00
|
|
|
#include "matrix.h" // for number of rows and columns
|
2012-03-15 09:01:36 +01:00
|
|
|
|
2012-04-29 07:39:23 +02:00
|
|
|
// include the appropriate keyboard layout header
|
|
|
|
// for:
|
|
|
|
// - number of layers
|
|
|
|
// - layout matrix definitions
|
|
|
|
// - possible non-default layout 'get' and 'set' definitions
|
2012-04-28 10:23:51 +02:00
|
|
|
#undef _str
|
|
|
|
#undef _expstr
|
|
|
|
#undef _inc
|
|
|
|
#define _str(s) #s // stringify
|
|
|
|
#define _expstr(s) _str(s) // expand -> stringify
|
|
|
|
#define _inc _expstr(layout/MAKEFILE_KEYBOARD_LAYOUT.h) // inc(lude)
|
|
|
|
#include _inc
|
|
|
|
#undef _str
|
|
|
|
#undef _expstr
|
|
|
|
#undef _inc
|
2012-03-27 12:06:52 +02:00
|
|
|
|
2012-04-29 07:39:23 +02:00
|
|
|
|
2012-04-29 09:17:17 +02:00
|
|
|
// default layout 'get' macros
|
2012-04-29 07:39:23 +02:00
|
|
|
//
|
|
|
|
// these are for when the matrices are stored solely in RAM. they're
|
|
|
|
// here so layouts can redefine them if they with and use RAM, Flash,
|
|
|
|
// EEPROM, or any combination of those, while maintaining the same
|
|
|
|
// interface
|
|
|
|
//
|
|
|
|
// - 'set' functions are optional, and should be defined in the layout
|
|
|
|
// specific '.h'. they'll require the use of the EEPROM, possibly in
|
|
|
|
// clever conjunction with one of the other two memories (since the
|
|
|
|
// EEPROM is small)
|
|
|
|
//
|
|
|
|
// - to override these with real functions, set the macro equal to
|
|
|
|
// itself (e.g. `#define kb_layout_get kb_layout_get`) and provide
|
|
|
|
// function prototypes in the layout specific '.h'
|
|
|
|
|
|
|
|
#ifndef kb_layout_get
|
|
|
|
#define kb_layout_get(layer,row,column) \
|
|
|
|
(_kb_layout[layer][row][column])
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef kb_layout_press_get
|
|
|
|
#define kb_layout_press_get(layer,row,column) \
|
|
|
|
(_kb_layout_press[layer][row][column])
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef kb_layout_release_get
|
|
|
|
#define kb_layout_release_get(layer,row,column) \
|
|
|
|
(_kb_layout_release[layer][row][column])
|
|
|
|
#endif
|
2012-03-27 12:06:52 +02:00
|
|
|
|
|
|
|
#endif
|
2012-03-15 09:01:36 +01:00
|
|
|
|