Loading...
Searching...
No Matches
gpio_arch_common.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Gunar Schorcht
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
20#ifndef GPIO_ARCH_COMMON_H
21#define GPIO_ARCH_COMMON_H
22
23#include "periph/gpio.h"
24
25#ifndef DOXYGEN
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
32#define GPIO_MODE_INPUT GPIO_IN
33#define GPIO_MODE_OUTPUT GPIO_OUT
34#define GPIO_MODE_INPUT_OUTPUT GPIO_IN_OUT
35
39typedef enum {
40 _GPIO = 0,
41#ifndef CPU_ESP8266
42 _ADC,
43 _CAN,
44 _DAC,
45 _EMAC,
46#endif /* !CPU_ESP8266 */
47 _I2C,
48 _PWM,
49 _SPI,
50 _SPIF,
51 _UART,
52 _NOT_EXIST
53} gpio_pin_usage_t;
54
62int gpio_set_pin_usage(gpio_t pin, gpio_pin_usage_t usage);
63
70gpio_pin_usage_t gpio_get_pin_usage(gpio_t pin);
71
78const char* gpio_get_pin_usage_str(gpio_t pin);
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif /* DOXYGEN */
85#endif /* GPIO_ARCH_COMMON_H */
Low-level GPIO peripheral driver interface definitions.