@ -1,6 +1,6 @@
/* -*- mode: c++ -*-
* Kaleidoscope - Hardware - Technomancy - Atreus - - Atreus hardware support for Kaleidoscope
* Copyright ( C ) 2018 , 2019 Keyboard . io , Inc
* Copyright ( C ) 2018 , 2019 , 2020 Keyboard . io , Inc
*
* Based on QMK ( commit e9a67f8fd )
* ( C ) Jack Humbert , Jun Wako , Phil Hagelberg , and others
@ -35,21 +35,48 @@ namespace kaleidoscope {
namespace device {
namespace technomancy {
ATMEGA32U4_KEYBOARD (
Atreus , HalfKay , " atreus " ,
struct AtreusProps : kaleidoscope : : device : : ATmega32U4KeyboardProps {
struct KeyScannerProps : public kaleidoscope : : driver : : keyscanner : : ATmegaProps {
static constexpr uint8_t matrix_rows = 4 ;
static constexpr uint8_t matrix_columns = 12 ;
typedef MatrixAddr < matrix_rows , matrix_columns > KeyAddr ;
# ifndef KALEIDOSCOPE_VIRTUAL_BUILD
# ifdef KALEIDOSCOPE_HARDWARE_ATREUS_PINOUT_ASTAR
ROW_PIN_LIST ( { PIN_D0 , PIN_D1 , PIN_D3 , PIN_D2 } ) ,
COL_PIN_LIST ( { PIN_D7 , PIN_C6 , PIN_B5 , PIN_B4 , PIN_E6 , PIN_D4 , PIN_B6 , PIN_F6 , PIN_F7 , PIN_D6 , PIN_B7 } )
static constexpr uint8_t matrix_row_pins [ matrix_rows ] = { PIN_D0 , PIN_D1 , PIN_D3 , PIN_D2 } ;
static constexpr uint8_t matrix_col_pins [ matrix_columns ] = { PIN_D7 , PIN_C6 , PIN_B5 , PIN_B4 , PIN_E6 , PIN_D4 , PIN_B6 , PIN_F6 , PIN_F7 , PIN_D6 , PIN_B7 } ;
# endif
# ifdef KALEIDOSCOPE_HARDWARE_ATREUS_PINOUT_ASTAR_DOWN
ROW_PIN_LIST ( { PIN_D0 , PIN_D1 , PIN_D3 , PIN_D2 } ) ,
COL_PIN_LIST ( { PIN_B7 , PIN_D6 , PIN_F7 , PIN_F6 , PIN_B6 , PIN_D4 , PIN_E6 , PIN_B4 , PIN_B5 , PIN_C6 , PIN_D7 } )
static constexpr uint8_t matrix_row_pins [ matrix_rows ] = { PIN_D0 , PIN_D1 , PIN_D3 , PIN_D2 } ;
static constexpr uint8_t matrix_col_pins [ matrix_columns ] = { PIN_B7 , PIN_D6 , PIN_F7 , PIN_F6 , PIN_B6 , PIN_D4 , PIN_E6 , PIN_B4 , PIN_B5 , PIN_C6 , PIN_D7 } ;
# endif
# ifdef KALEIDOSCOPE_HARDWARE_ATREUS_PINOUT_LEGACY_TEENSY2
ROW_PIN_LIST ( { PIN_D0 , PIN_D1 , PIN_D2 , PIN_D3 } ),
COL_PIN_LIST ( { PIN_F6 , PIN_F5 , PIN_F4 , PIN_B7 , PIN_B6 , PIN_B5 , PIN_B4 , PIN_B3 , PIN_B2 , PIN_B1 , PIN_B0 } )
static constexpr uint8_t matrix_row_pins [ matrix_rows ] = { PIN_D0 , PIN_D1 , PIN_D2 , PIN_D3 } ;
static constexpr uint8_t matrix_col_pins [ matrix_columns ] = { PIN_F6 , PIN_F5 , PIN_F4 , PIN_B7 , PIN_B6 , PIN_B5 , PIN_B4 , PIN_B3 , PIN_B2 , PIN_B1 , PIN_B0 } ;
# endif
) ;
# endif // ifndef KALEIDOSCOPE_VIRTUAL_BUILD
} ;
typedef kaleidoscope : : driver : : keyscanner : : ATmega < KeyScannerProps > KeyScanner ;
typedef kaleidoscope : : driver : : bootloader : : avr : : HalfKay BootLoader ;
static constexpr const char * short_name = " atreus " ;
} ;
# ifndef KALEIDOSCOPE_VIRTUAL_BUILD
class Atreus : public kaleidoscope : : device : : ATmega32U4Keyboard < AtreusProps > { } ;
# 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 Atreus ;
# endif // ifndef KALEIDOSCOPE_VIRTUAL_BUILD
# define PER_KEY_DATA(dflt, \
R0C0 , R0C1 , R0C2 , R0C3 , R0C4 , R0C7 , R0C8 , R0C9 , R0C10 , R0C11 , \