@ -1,6 +1,6 @@
/* -*- mode: c++ -*-
/* -*- mode: c++ -*-
* Kaleidoscope - Hardware - OLKB - Planck - - Planck hardware support for Kaleidoscope
* Kaleidoscope - Hardware - OLKB - Planck - - Planck hardware support for Kaleidoscope
* Copyright ( C ) 2018 , 2019 Keyboard . io , Inc
* Copyright ( C ) 2018 , 2019 , 2020 Keyboard . io , Inc
*
*
* This program is free software : you can redistribute it and / or modify
* This program is free software : you can redistribute it and / or modify
* it under the terms of version 3 of the GNU General Public License as
* it under the terms of version 3 of the GNU General Public License as
@ -28,11 +28,32 @@ namespace kaleidoscope {
namespace device {
namespace device {
namespace olkb {
namespace olkb {
ATMEGA32U4_KEYBOARD (
struct PlanckProps : kaleidoscope : : device : : ATmega32U4KeyboardProps {
Planck , HalfKay , " planck " ,
struct KeyScannerProps : public kaleidoscope : : driver : : keyscanner : : ATmegaProps {
ROW_PIN_LIST ( { PIN_D0 , PIN_D5 , PIN_B5 , PIN_B6 } ) ,
static constexpr uint8_t matrix_rows = 4 ;
COL_PIN_LIST ( { PIN_F1 , PIN_F0 , PIN_B0 , PIN_C7 , PIN_F4 , PIN_F5 , PIN_F6 , PIN_F7 , PIN_D4 , PIN_D6 , PIN_B4 , PIN_D7 } )
static constexpr uint8_t matrix_columns = 12 ;
) ;
typedef MatrixAddr < matrix_rows , matrix_columns > KeyAddr ;
# ifndef KALEIDOSCOPE_VIRTUAL_BUILD
static constexpr uint8_t matrix_row_pins [ matrix_rows ] = { PIN_D0 , PIN_D5 , PIN_B5 , PIN_B6 } ;
static constexpr uint8_t matrix_col_pins [ matrix_columns ] = { PIN_F0 , PIN_F1 , PIN_F4 , PIN_F5 , PIN_F6 , PIN_F7 , PIN_B3 , PIN_B1 , PIN_B0 , PIN_D5 , PIN_B7 , PIN_C7 } ;
# endif // KALEIDOSCOPE_VIRTUAL_BUILD
} ;
typedef kaleidoscope : : driver : : keyscanner : : ATmega < KeyScannerProps > KeyScanner ;
typedef kaleidoscope : : driver : : bootloader : : avr : : HalfKay Bootloader ;
static constexpr const char * short_name = " planck " ;
} ;
# ifndef KALEIDOSCOPE_VIRTUAL_BUILD
class Planck : public kaleidoscope : : device : : ATmega32U4Keyboard < PlanckProps > { } ;
# else // ifndef KALEIDOSCOPE_VIRTUAL_BUILD
/* Device definition omitted for virtual device builds.
* We need to forward declare the device name , though , as there are
* some legacy extern references to boards whose definition
* depends on this .
*/
class Planck ;
# endif // ifndef KALEIDOSCOPE_VIRTUAL_BUILD
# define PER_KEY_DATA(dflt, \
# define PER_KEY_DATA(dflt, \
R0C0 , R0C1 , R0C2 , R0C3 , R0C4 , R0C5 , R0C6 , R0C7 , R0C8 , R0C9 , R0C10 , R0C11 , \
R0C0 , R0C1 , R0C2 , R0C3 , R0C4 , R0C5 , R0C6 , R0C7 , R0C8 , R0C9 , R0C10 , R0C11 , \