This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Keyboard] Add support for Mode SixtyFive M65HA and M65HI (qmk#14685)
- Loading branch information
1 parent
ea0948e
commit e50b5e9
Showing
24 changed files
with
963 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright 2020 QMK | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define CH_CFG_ST_FREQUENCY 10000 | ||
|
||
#define CH_CFG_OPTIMIZE_SPEED FALSE | ||
|
||
#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE | ||
|
||
#include_next <chconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
Copyright 2020 Álvaro "Gondolindrim" Volpato <alvaro.volpato@usp.br> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
/* USB Device descriptor parameter */ | ||
#define VENDOR_ID 0x00DE | ||
#define PRODUCT_ID 0x6566 // 65A + 1 since the pre-alpha version was 6565 | ||
#define DEVICE_VER 0x0065 // A for release Alpha | ||
#define MANUFACTURER Mode | ||
#define PRODUCT SixtyFive HA | ||
|
||
/* key matrix size */ | ||
#define MATRIX_ROWS 6 | ||
#define MATRIX_COLS 15 | ||
|
||
#define MATRIX_COL_PINS { B10, B12, C8 , C4 , C5 , B0 , C10, B13, B14, B15, A15, C6 , C7 , A8 , C9} | ||
#define MATRIX_ROW_PINS { A7 , A10, D2 , C12, B1 , C11 } | ||
#define DIODE_DIRECTION COL2ROW | ||
|
||
/* define if matrix has ghost */ | ||
//#define MATRIX_HAS_GHOST | ||
|
||
/* Set 0 if debouncing isn't needed */ | ||
#define DEBOUNCE 5 | ||
|
||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
#define LOCKING_SUPPORT_ENABLE | ||
/* Locking resynchronize hack */ | ||
#define LOCKING_RESYNC_ENABLE | ||
|
||
#define EEPROM_I2C_24LC256 | ||
//#define I2C1_CLOCK_SPEED 400000 | ||
//#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 | ||
|
||
#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE | ||
|
||
#define STM32_HSECLK 8000000 | ||
|
||
#define OPENDRAIN_INDICATORS | ||
#define LED_CAPS_LOCK_PIN A6 | ||
|
||
/* | ||
* Feature disable options | ||
* These options are also useful to firmware size reduction. | ||
*/ | ||
|
||
/* disable debug print */ | ||
//#define NO_DEBUG | ||
|
||
/* disable print */ | ||
//#define NO_PRINT | ||
|
||
/* disable action features */ | ||
//#define NO_ACTION_LAYER | ||
//#define NO_ACTION_TAPPING | ||
//#define NO_ACTION_ONESHOT | ||
//#define NO_ACTION_MACRO | ||
//#define NO_ACTION_FUNCTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Copyright 2020 QMK | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define HAL_USE_I2C TRUE | ||
|
||
#include_next <halconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"keyboard_name": "Mode SixtyFive HA", | ||
"url": "", | ||
"maintainer": "Gondolindrim", | ||
"layouts": { | ||
"LAYOUT_all": { | ||
"layout": [ | ||
{ "label": "K00", "x": 0, "y": 0 }, | ||
{ "label": "K01", "x": 1, "y": 0 }, | ||
{ "label": "K02", "x": 2, "y": 0 }, | ||
{ "label": "K03", "x": 3, "y": 0 }, | ||
{ "label": "K04", "x": 4, "y": 0 }, | ||
{ "label": "K05", "x": 5, "y": 0 }, | ||
{ "label": "K06", "x": 6, "y": 0 }, | ||
{ "label": "K07", "x": 7, "y": 0 }, | ||
{ "label": "K08", "x": 8, "y": 0 }, | ||
{ "label": "K09", "x": 9, "y": 0 }, | ||
{ "label": "K0A", "x": 10, "y": 0 }, | ||
{ "label": "K0B", "x": 11, "y": 0 }, | ||
{ "label": "K0C", "x": 12, "y": 0 }, | ||
{ "label": "K0D", "x": 13, "y": 0, "w": 2 }, | ||
{ "label": "K0E", "x": 15, "y": 0 }, | ||
|
||
{ "label": "K10", "x": 0, "y": 1, "w": 1.5 }, | ||
{ "label": "K11", "x": 1.5, "y": 1 }, | ||
{ "label": "K12", "x": 2.5, "y": 1 }, | ||
{ "label": "K13", "x": 3.5, "y": 1 }, | ||
{ "label": "K14", "x": 4.5, "y": 1 }, | ||
{ "label": "K15", "x": 5.5, "y": 1 }, | ||
{ "label": "K16", "x": 6.5, "y": 1 }, | ||
{ "label": "K17", "x": 7.5, "y": 1 }, | ||
{ "label": "K18", "x": 8.5, "y": 1 }, | ||
{ "label": "K19", "x": 9.5, "y": 1 }, | ||
{ "label": "K1A", "x": 10.5, "y": 1 }, | ||
{ "label": "K1B", "x": 11.5, "y": 1 }, | ||
{ "label": "K1C", "x": 12.5, "y": 1 }, | ||
{ "label": "K1D", "x": 13.5, "y": 1, "w": 1.5}, | ||
{ "label": "K1E", "x": 15, "y": 1 }, | ||
|
||
{ "label": "K20", "x": 0, "y": 2, "w": 1.75 }, | ||
{ "label": "K21", "x": 1.75, "y": 2 }, | ||
{ "label": "K22", "x": 2.75, "y": 2 }, | ||
{ "label": "K23", "x": 3.75, "y": 2 }, | ||
{ "label": "K24", "x": 4.75, "y": 2 }, | ||
{ "label": "K25", "x": 5.75, "y": 2 }, | ||
{ "label": "K26", "x": 6.75, "y": 2 }, | ||
{ "label": "K27", "x": 7.75, "y": 2 }, | ||
{ "label": "K28", "x": 8.75, "y": 2 }, | ||
{ "label": "K29", "x": 9.75, "y": 2 }, | ||
{ "label": "K2A", "x": 10.75, "y": 2 }, | ||
{ "label": "K2B", "x": 11.75, "y": 2 }, | ||
{ "label": "K2D", "x": 12.75, "y": 2, "w": 2.25 }, | ||
{ "label": "K2E", "x": 15, "y": 2 }, | ||
|
||
{ "label": "K30", "x": 0, "y": 3, "w": 2.25 }, | ||
{ "label": "K32", "x": 2.25, "y": 3 }, | ||
{ "label": "K33", "x": 3.25, "y": 3 }, | ||
{ "label": "K34", "x": 4.25, "y": 3 }, | ||
{ "label": "K35", "x": 5.25, "y": 3 }, | ||
{ "label": "K36", "x": 6.25, "y": 3 }, | ||
{ "label": "K37", "x": 7.25, "y": 3 }, | ||
{ "label": "K38", "x": 8.25, "y": 3 }, | ||
{ "label": "K39", "x": 9.25, "y": 3 }, | ||
{ "label": "K3A", "x": 10.25, "y": 3 }, | ||
{ "label": "K3B", "x": 11.25, "y": 3 }, | ||
{ "label": "K3C", "x": 12.25, "y": 3, "w": 1.75 }, | ||
{ "label": "K3D", "x": 14, "y": 3 }, | ||
{ "label": "K3E", "x": 15, "y": 3 }, | ||
|
||
{ "label": "K40", "x": 0, "y": 4, "w": 1.25 }, | ||
{ "label": "K41", "x": 1.25, "y": 4, "w": 1.25 }, | ||
{ "label": "K42", "x": 2.5, "y": 4, "w": 1.25 }, | ||
{ "label": "K56", "x": 3.75, "y": 4, "w": 6.25 }, | ||
{ "label": "K5A", "x": 10, "y": 4, "w": 1.25 }, | ||
{ "label": "K5B", "x": 11.25, "y": 4, "w": 1.25 }, | ||
{ "label": "K5C", "x": 13, "y": 4 }, | ||
{ "label": "K5D", "x": 14, "y": 4 }, | ||
{ "label": "K5E", "x": 15, "y": 4 } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright 2020 Álvaro "Gondolindrim" Volpato <alvaro.volpato@usp.br> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include QMK_KEYBOARD_H | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
[0] = LAYOUT_all( | ||
KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_DEL , | ||
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, | ||
KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_PGDN, | ||
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_END , | ||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RGHT | ||
), | ||
[1] = LAYOUT_all( | ||
RESET , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_TRNS, KC_MUTE, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
), | ||
[2] = LAYOUT_all( | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
), | ||
[3] = LAYOUT_all( | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright 2020 Álvaro "Gondolindrim" Volpato <alvaro.volpato@usp.br> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include QMK_KEYBOARD_H | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
[0] = LAYOUT_all( | ||
KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSPC, KC_DEL , | ||
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, | ||
KC_CAPS, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_PGDN, | ||
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_END , | ||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RGHT | ||
), | ||
[1] = LAYOUT_all( | ||
RESET , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_TRNS, KC_MUTE, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
), | ||
[2] = LAYOUT_all( | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
), | ||
[3] = LAYOUT_all( | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VIA_ENABLE = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Copyright 2020 Álvaro "Gondolindrim" Volpato <alvaro.volpato@usp.br> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "m65ha_alpha.h" | ||
|
||
void board_init(void) { | ||
setPinInput(B9); | ||
setPinInput(B10); | ||
} | ||
|
||
#define LED_PIN_ON_STATE 1 | ||
void led_init_ports(void) { | ||
|
||
/** If the OPENDRAIN_INDICATORS option is not defined in config.h, the indicator | ||
pins default to push-pull output. Else, they are defined as open-drain. The | ||
pin mode configuration is done through the INDICATOR_PIN_MODE which is | ||
attributed right at the beggining. **/ | ||
|
||
#ifndef OPENDRAIN_INDICATORS | ||
# define INDICATOR_PIN_MODE PAL_MODE_OUTPUT_PUSHPULL | ||
#else | ||
# define INDICATOR_PIN_MODE PAL_MODE_OUTPUT_OPENDRAIN | ||
#endif | ||
|
||
#ifdef LED_NUM_LOCK_PIN | ||
palSetLineMode(LED_NUM_LOCK_PIN, INDICATOR_PIN_MODE); | ||
#endif | ||
#ifdef LED_CAPS_LOCK_PIN | ||
palSetLineMode(LED_CAPS_LOCK_PIN, INDICATOR_PIN_MODE); | ||
#endif | ||
#ifdef LED_SCROLL_LOCK_PIN | ||
palSetLineMode(LED_SCROLL_LOCK_PIN, INDICATOR_PIN_MODE); | ||
#endif | ||
#ifdef LED_COMPOSE_PIN | ||
palSetLineMode(LED_COMPOSE_PIN, INDICATOR_PIN_MODE); | ||
#endif | ||
#ifdef LED_KANA_PIN | ||
palSetLineMode(LED_KANA_PIN, INDICATOR_PIN_MODE); | ||
#endif | ||
} | ||
|
||
bool led_update_kb(led_t led_state) { | ||
bool res = led_update_user(led_state); | ||
if(res) { | ||
// writePin sets the pin high for 1 and low for 0. | ||
// In this example the pins are inverted, setting | ||
// it low/0 turns it on, and high/1 turns the LED off. | ||
// This behavior depends on whether the LED is between the pin | ||
// and VCC or the pin and GND. | ||
writePin(LED_CAPS_LOCK_PIN, !led_state.caps_lock); | ||
} | ||
return res; | ||
} |
Oops, something went wrong.