diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b88e93..1f14bbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,6 @@ set( DebugModule "full" ##| Set the base keyboard .kll map, defaults to "defaultMap" if not found ##| Looks in Scan/ for the available BaseMaps -##| TODO Support layering in basemap set( BaseMap "defaultMap" CACHE STRING "KLL BaseMap/Scancode Keymapping" ) diff --git a/Lib/CMake/kll.cmake b/Lib/CMake/kll.cmake index 80d44c1..f41b92a 100644 --- a/Lib/CMake/kll.cmake +++ b/Lib/CMake/kll.cmake @@ -54,15 +54,21 @@ endforeach () #| If set BaseMap cannot be found, use default map set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" ) -if ( NOT EXISTS ${pathname}/${BaseMap}.kll ) - set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll ) - set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll ) -elseif ( EXISTS "${pathname}/${BaseMap}.kll" ) - set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll ) - set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll ) -else () - message ( FATAL "Could not find '${BaseMap}.kll'" ) -endif () + +string ( REPLACE " " ";" MAP_LIST ${BaseMap} ) # Change spaces to semicolons +foreach ( MAP ${MAP_LIST} ) + # Only check the Scan Module for BaseMap .kll files, default to defaultMap.kll + message("THIS -> ${pathname} ${MAP}") + if ( NOT EXISTS ${pathname}/${MAP}.kll ) + set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll ) + set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll ) + elseif ( EXISTS "${pathname}/${MAP}.kll" ) + set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${MAP}.kll ) + set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${MAP}.kll ) + else () + message ( FATAL " Could not find '${MAP}.kll' BaseMap in Scan module directory" ) + endif () +endforeach () #| Configure DefaultMap if specified if ( NOT "${DefaultMap}" STREQUAL "" ) @@ -78,7 +84,7 @@ if ( NOT "${DefaultMap}" STREQUAL "" ) set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll ) set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll ) else () - message ( FATAL "Could not find '${MAP}.kll'" ) + message ( FATAL " Could not find '${MAP}.kll' DefaultMap" ) endif () endforeach () endif () @@ -100,7 +106,7 @@ if ( NOT "${PartialMaps}" STREQUAL "" ) set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll ) set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll ) else () - message ( FATAL "Could not find '${MAP_PART}.kll'" ) + message ( FATAL " Could not find '${MAP_PART}.kll' PartialMap" ) endif () endforeach () endforeach () diff --git a/Scan/MDErgo1/defaultMap.kll b/Scan/MDErgo1/defaultMap.kll index cb2aebc..ac6158c 100644 --- a/Scan/MDErgo1/defaultMap.kll +++ b/Scan/MDErgo1/defaultMap.kll @@ -1,78 +1,30 @@ Name = MDErgo1; Version = 0.2; -Author = "HaaTa (Jacob Alexander) 2014"; +Author = "HaaTa (Jacob Alexander) 2014-2015"; KLL = 0.3c; # Modified Date -Date = 2015-08-02; - - -S0x00 : U"Esc"; -S0x01 : U"1"; -S0x02 : U"2"; -S0x03 : U"3"; -S0x04 : U"4"; -S0x05 : U"5"; -S0x06 : U"6"; -S0x07 : U"7"; -S0x08 : U"8"; -S0x09 : U"9"; -S0x0A : U"0"; -S0x0B : U"Minus"; -S0x0C : U"Equal"; -S0x0D : U"Backslash"; -S0x0E : U"Tab"; -S0x0F : U"Q"; -S0x10 : U"W"; -S0x11 : U"E"; -S0x12 : U"R"; -S0x13 : U"T"; -S0x14 : U"Y"; -S0x15 : U"U"; -S0x16 : U"I"; -S0x17 : U"O"; -S0x18 : U"P"; -S0x19 : U"LBrace"; -S0x1A : U"RBrace"; -S0x1B : U"Backspace"; -S0x1C : U"Ctrl"; -S0x1D : U"A"; -S0x1E : U"S"; -S0x1F : U"D"; -S0x20 : U"F"; -S0x21 : U"G"; -S0x22 : U"H"; -S0x23 : U"J"; -S0x24 : U"K"; -S0x25 : U"L"; -S0x26 : U"Semicolon"; -S0x27 : U"Quote"; -S0x28 : U"Enter"; -S0x29 : U"LShift"; -S0x2A : U"Z"; -S0x2B : U"X"; -S0x2C : U"C"; -S0x2D : U"V"; -S0x2E : U"B"; -S0x2F : U"N"; -S0x30 : U"M"; -S0x31 : U"Comma"; -S0x32 : U"Period"; -S0x33 : U"Slash"; -S0x34 : U"RShift"; -S0x35 : U"F1"; # Fun key -S0x36 : U"F2"; # Left Blank Key -S0x37 : U"LAlt"; -S0x38 : U"LGui"; -S0x39 : U"Space"; -S0x3A : U"RGui"; -S0x3B : U"RAlt"; -S0x3C : U"F3"; # Right Blank Key 1 -S0x3D : U"F4"; # Right Blank Key 2 -S0x3E : U"BackTick"; +Date = 2015-08-05; + +######## +# NOTE # +######## + +# Default ScanCode mappings are in rightHand.kll and leftHand.kll +# To change which node you are refering to, set the ConnectId variable +# i.e. +# ConnectId = 0; +# S0x02 : U"A"; # Sets scan code 0x02 on keyboard connected to USB +# ConnectId = 1; +# S0x02 : U"B"; # Sets scan code 0x02 on the first slave node +# +# ConnectId may be set in the previously parsed kll file +# In general you shouldn't have to worry about setting ConnectId unless you want a single configuration file +# # Defines available to the MDErgo1 Scan Module +# # LED Default Enable Mask Override # @@ -107,4 +59,27 @@ ISSILedBrightness1 = " 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* C9-1 -> C9-16 */ "; +# LCD Backlight Channel Brightness Override +# There are 3 channels, RGB +# In order to get other colors you must mix the 3 colors +# Each channel is a 16-bit register (65536 levels) +# Technically, this means, the backlight is a 48-bit RGB pixel +# In practice, it may be difficult to get color consistency at times if too bright or too dim +# +# Defaults to 6% brightness, white +STLcdBacklightRed = 0x0FFF; +STLcdBacklightGreen = 0x0FFF; +STLcdBacklightBlue = 0x0FFF; + +# LCD Image Override +# +# The easiest way to generate this data is using the bitmap2Struct.py script in the STLcd folder +# It will output the necessary uint8_t array to set here +# +STLcdDefaultImage = " +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +"; diff --git a/Scan/MDErgo1/leftHand.kll b/Scan/MDErgo1/leftHand.kll new file mode 100644 index 0000000..c814c55 --- /dev/null +++ b/Scan/MDErgo1/leftHand.kll @@ -0,0 +1,61 @@ +Name = MDErgo1 Right Hand; +Version = 0.1; +Author = "HaaTa (Jacob Alexander) 2015"; +KLL = 0.3c; + +# Modified Date +Date = 2015-08-06; + + +# Top Row +S0x02 : U"6"; +S0x03 : U"5"; +S0x04 : U"4"; +S0x05 : U"3"; +S0x06 : U"2"; +S0x07 : U"1"; +S0x08 : U"Esc"; + +# Top-Middle Row +S0x0B : U"F4"; +S0x0C : U"T"; +S0x0D : U"R"; +S0x0E : U"E"; +S0x0F : U"W"; +S0x10 : U"Q"; +S0x11 : U"Tab"; + +# Middle Row +S0x15 : U"G"; +S0x16 : U"F"; +S0x17 : U"D"; +S0x18 : U"S"; +S0x19 : U"A"; +S0x1A : U"Function1"; + +# Top Thumb Cluster +S0x1B : U"Home"; +S0x1C : U"End"; + +# Bottom-Middle Row +S0x1D : U"F5"; +S0x1E : U"B"; +S0x1F : U"V"; +S0x20 : U"C"; +S0x21 : U"X"; +S0x22 : U"Z"; +S0x23 : U"Left Shift"; + +# Bottom Thumb Cluster +S0x24 : U"Left Alt"; +S0x25 : U"Left Ctrl"; +S0x26 : U"Delete"; +S0x27 : U"Space"; + +# Bottom Row +S0x28 : U"Function5"; +S0x29 : U"Backtick"; +S0x2A : U"Right Brace"; +S0x2B : U"Left Brace"; +S0x2C : U"Function3"; + diff --git a/Scan/MDErgo1/rightHand.kll b/Scan/MDErgo1/rightHand.kll new file mode 100644 index 0000000..840b696 --- /dev/null +++ b/Scan/MDErgo1/rightHand.kll @@ -0,0 +1,62 @@ +Name = MDErgo1 Right Hand; +Version = 0.1; +Author = "HaaTa (Jacob Alexander) 2015"; +KLL = 0.3c; + +# Modified Date +Date = 2015-08-06; + + +# Top Row +S0x02 : U"7"; +S0x03 : U"8"; +S0x04 : U"9"; +S0x05 : U"0"; +S0x06 : U"Minus"; +S0x07 : U"Equal"; +S0x08 : U"Backspace"; + +# Top-Middle Row +S0x0B : U"PageUp"; +S0x0C : U"Y"; +S0x0D : U"U"; +S0x0E : U"I"; +S0x0F : U"O"; +S0x10 : U"P"; +S0x11 : U"BackSlash"; + +# Middle Row +S0x15 : U"H"; +S0x16 : U"J"; +S0x17 : U"K"; +S0x18 : U"L"; +S0x19 : U"Semicolon"; +S0x1A : U"Quote"; + +# Top Thumb Cluster +S0x1B : U"PrintScreen"; +S0x1C : U"Insert"; + +# Bottom-Middle Row +S0x1D : U"PageDown"; +S0x1E : U"N"; +S0x1F : U"M"; +S0x20 : U"Comma"; +S0x21 : U"Period"; +S0x22 : U"Slash"; +S0x23 : U"Right Shift"; + +# Bottom Thumb Cluster +S0x24 : U"Right Alt"; +S0x25 : U"Right Ctrl"; +S0x26 : U"Enter"; +S0x27 : U"Function2"; + +# Bottom Row +S0x28 : U"Left"; +S0x29 : U"Down"; +S0x2A : U"Up"; +S0x2B : U"Right"; +S0x2C : U"Function4"; + + diff --git a/Scan/MDErgo1/scan_loop.c b/Scan/MDErgo1/scan_loop.c index 8e824c3..d5e97e5 100644 --- a/Scan/MDErgo1/scan_loop.c +++ b/Scan/MDErgo1/scan_loop.c @@ -56,7 +56,7 @@ inline void Scan_setup() Connect_setup( Output_Available ); // Setup GPIO pins for matrix scanning - //Matrix_setup(); + Matrix_setup(); // Setup ISSI chip to control the leds LED_setup(); @@ -73,7 +73,7 @@ inline void Scan_setup() inline uint8_t Scan_loop() { // Scan Matrix - //Matrix_scan( Scan_scanCount++ ); + Matrix_scan( Scan_scanCount++ ); // Process any interconnect commands Connect_scan(); diff --git a/Scan/MDErgo1/slave1.kll b/Scan/MDErgo1/slave1.kll new file mode 100644 index 0000000..792ba48 --- /dev/null +++ b/Scan/MDErgo1/slave1.kll @@ -0,0 +1,11 @@ +Name = MDErgo1 Slave1; +Version = 0.1; +Author = "HaaTa (Jacob Alexander) 2015"; +KLL = 0.3c; + +# Modified Date +Date = 2015-08-06; + +# Sets all future Scan Code definitions to be applied to the first slave node +ConnectId = 1; +