aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-04-30 16:24:47 +1000
committerGitHub <noreply@github.com>2020-04-30 16:24:47 +1000
commit16a15c1cfcbfd0feb2c2cf1383676747e2f97d73 (patch)
treeaaa3c9f5a23207861d05c37ed4860af8efd40f85 /quantum
parent37a4b53c4f51b66992e687b5012c83df9cc6b138 (diff)
downloadfirmware-16a15c1cfcbfd0feb2c2cf1383676747e2f97d73.tar.gz
firmware-16a15c1cfcbfd0feb2c2cf1383676747e2f97d73.tar.bz2
firmware-16a15c1cfcbfd0feb2c2cf1383676747e2f97d73.zip
QMK-ify some GPIO macros (#8315)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/pincontrol.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/quantum/pincontrol.h b/quantum/pincontrol.h
deleted file mode 100644
index 204fddf30..000000000
--- a/quantum/pincontrol.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright 2016 Wez Furlong
- *
- * 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
-// Some helpers for controlling gpio pins
-#include <avr/io.h>
-
-enum {
- PinDirectionInput = 0,
- PinDirectionOutput = 1,
- PinLevelHigh = 1,
- PinLevelLow = 0,
-};
-
-// ex: pinMode(B0, PinDirectionOutput);
-static inline void pinMode(uint8_t pin, int mode) {
- uint8_t bv = _BV(pin & 0xf);
- if (mode == PinDirectionOutput) {
- _SFR_IO8((pin >> 4) + 1) |= bv;
- } else {
- _SFR_IO8((pin >> 4) + 1) &= ~bv;
- _SFR_IO8((pin >> 4) + 2) &= ~bv;
- }
-}
-
-// ex: digitalWrite(B0, PinLevelHigh);
-static inline void digitalWrite(uint8_t pin, int mode) {
- uint8_t bv = _BV(pin & 0xf);
- if (mode == PinLevelHigh) {
- _SFR_IO8((pin >> 4) + 2) |= bv;
- } else {
- _SFR_IO8((pin >> 4) + 2) &= ~bv;
- }
-}
-
-// Return true if the pin is HIGH
-// digitalRead(B0)
-static inline bool digitalRead(uint8_t pin) { return _SFR_IO8(pin >> 4) & _BV(pin & 0xf); }