gpio_arch_common.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include "periph/gpio.h"
20 
21 #ifndef DOXYGEN
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
28 #define GPIO_MODE_INPUT GPIO_IN
29 #define GPIO_MODE_OUTPUT GPIO_OUT
30 #define GPIO_MODE_INPUT_OUTPUT GPIO_IN_OUT
31 
35 typedef enum {
36  _GPIO = 0,
37 #ifndef CPU_ESP8266
38  _ADC,
39  _CAN,
40  _DAC,
41  _EMAC,
42 #endif /* !CPU_ESP8266 */
43  _I2C,
44  _PWM,
45  _SPI,
46  _SPIF,
47  _UART,
48  _NOT_EXIST
49 } gpio_pin_usage_t;
50 
58 int gpio_set_pin_usage(gpio_t pin, gpio_pin_usage_t usage);
59 
66 gpio_pin_usage_t gpio_get_pin_usage(gpio_t pin);
67 
74 const char* gpio_get_pin_usage_str(gpio_t pin);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* DOXYGEN */
Low-level GPIO peripheral driver interface definitions.