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
9#pragma once
10
21
22#include "periph/gpio.h"
23
24#ifndef DOXYGEN
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
31#define GPIO_MODE_INPUT GPIO_IN
32#define GPIO_MODE_OUTPUT GPIO_OUT
33#define GPIO_MODE_INPUT_OUTPUT GPIO_IN_OUT
34
38typedef enum {
39 _GPIO = 0,
40#ifndef CPU_ESP8266
41 _ADC,
42 _CAN,
43 _DAC,
44 _EMAC,
45#endif /* !CPU_ESP8266 */
46 _I2C,
47 _PWM,
48 _SPI,
49 _SPIF,
50 _UART,
51 _NOT_EXIST
52} gpio_pin_usage_t;
53
61int gpio_set_pin_usage(gpio_t pin, gpio_pin_usage_t usage);
62
69gpio_pin_usage_t gpio_get_pin_usage(gpio_t pin);
70
77const char* gpio_get_pin_usage_str(gpio_t pin);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* DOXYGEN */
Low-level GPIO peripheral driver interface definitions.