gpio.h (1476B)
1 /* Copyright 2021 QMK 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 */ 16 #pragma once 17 18 #include "pin_defs.h" 19 20 #if __has_include_next("gpio.h") 21 # include_next "gpio.h" /* Include the platforms gpio.h */ 22 #endif 23 24 // ======== DEPRECATED DEFINES - DO NOT USE ======== 25 26 #define setPinInput(pin) gpio_set_pin_input(pin) 27 #define setPinInputHigh(pin) gpio_set_pin_input_high(pin) 28 #define setPinInputLow(pin) gpio_set_pin_input_low(pin) 29 #define setPinOutputPushPull(pin) gpio_set_pin_output_push_pull(pin) 30 #define setPinOutputOpenDrain(pin) gpio_set_pin_output_open_drain(pin) 31 #define setPinOutput(pin) gpio_set_pin_output_push_pull(pin) 32 33 #define writePinHigh(pin) gpio_write_pin_high(pin) 34 #define writePinLow(pin) gpio_write_pin_low(pin) 35 #define writePin(pin, level) gpio_write_pin(pin, level) 36 37 #define readPin(pin) gpio_read_pin(pin) 38 39 #define togglePin(pin) gpio_toggle_pin(pin)