2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 // TODO - GPIO_TypeDef include
26 #include "drivers/io.h"
28 typedef struct ioDef_s
{
32 typedef struct ioRec_s
{
35 resourceOwner_e owner
;
39 extern ioRec_t ioRecs
[];
41 int IO_GPIOPortIdx(IO_t io
);
42 int IO_GPIOPinIdx(IO_t io
);
44 int IO_GPIO_PinSource(IO_t io
);
45 int IO_GPIO_PortSource(IO_t io
);
48 int IO_EXTI_PortSourceGPIO(IO_t io
);
49 int IO_EXTI_PinSource(IO_t io
);
52 GPIO_TypeDef
* IO_GPIO(IO_t io
);
53 uint16_t IO_Pin(IO_t io
);
55 #define IO_GPIOBYTAG(tag) IO_GPIO(IOGetByTag(tag))
56 #define IO_PINBYTAG(tag) IO_Pin(IOGetByTag(tag))
57 #define IO_GPIOPortIdxByTag(tag) DEFIO_TAG_GPIOID(tag)
58 #define IO_GPIOPinIdxByTag(tag) DEFIO_TAG_PIN(tag)
60 uint32_t IO_EXTI_Line(IO_t io
);
61 ioRec_t
*IO_Rec(IO_t io
);