]>
git.gir.st - tmk_keyboard.git/blob - keyboard/kl27z_onekey/kl27z_onekey.c
2 Copyright 2012 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
34 uint8_t matrix_rows(void)
40 uint8_t matrix_cols(void)
45 void matrix_init(void)
48 palSetPadMode(GPIOA
, 4, PAL_MODE_INPUT_PULLUP
);
51 palSetPadMode(GPIOD
, 7, PAL_MODE_OUTPUT_PUSHPULL
);
53 chThdSleepMilliseconds(200);
54 palClearPad(GPIOD
, 7);
55 chThdSleepMilliseconds(200);
57 chThdSleepMilliseconds(200);
58 palClearPad(GPIOD
, 7);
61 uint8_t matrix_scan(void)
67 bool matrix_is_on(uint8_t row
, uint8_t col
)
69 return !palReadPad(GPIOA
, 4);
73 matrix_row_t
matrix_get_row(uint8_t row
)
75 return !palReadPad(GPIOA
, 4);
78 void matrix_print(void)
82 void led_set(uint8_t usb_led
) {
83 if (usb_led
& (1<<USB_LED_CAPS_LOCK
)) {
85 palSetPadMode(GPIOD
, 7, PAL_MODE_OUTPUT_PUSHPULL
);
89 palSetPadMode(GPIOD
, 7, PAL_MODE_INPUT
);
97 const uint8_t keymaps
[][MATRIX_ROWS
][MATRIX_COLS
] = {
101 const action_t fn_actions
[] = {