You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kaleidoscope/plugins/Kaleidoscope-Hardware-EZ-Er.../src/kaleidoscope/device/ez/ErgoDox/ErgoDoxScanner.h

58 lines
1.5 KiB

/* -*- mode: c++ -*-
* Kaleidoscope-Hardware-EZ-ErgoDox -- ErgoDox hardware support for Kaleidoscope
* Copyright (C) 2018, 2019 Keyboard.io, Inc
*
* Based on QMK (commit 8cdb4a915)
* (C) Jack Humbert, Erez Zukerman, Oleg Kostyuk
* Original QMK sources:
* - keyboards/ergodox_ez/ergodox_ez.c
* - keyboards/ergodox_ez/ergodox_ez.h
* - keyboards/ergodox_ez/matrix.c
*
* 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 3 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
#ifdef ARDUINO_AVR_ERGODOX
#include <stdint.h>
namespace kaleidoscope {
namespace device {
namespace ez {
class ErgoDoxScanner {
public:
ErgoDoxScanner() {}
void begin();
void toggleATMegaRow(int row);
void selectExtenderRow(int row);
uint8_t readCols(int row);
void reattachExpanderOnError();
private:
uint8_t expander_error_ = 0x20;
uint8_t initExpander();
};
} // namespace ez
} // namespace device
} // namespace kaleidoscope
#endif