NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
serial_4way_impl.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  * Author: 4712
17 */
18 
19 #include "drivers/gpio.h"
20 
21 typedef struct {
23  uint16_t pinpos;
24  uint16_t pin;
28 
29 extern uint8_t escSelected;
30 
31 bool isEscHi(uint8_t selEsc);
32 bool isEscLo(uint8_t selEsc);
33 void setEscHi(uint8_t selEsc);
34 void setEscLo(uint8_t selEsc);
35 void setEscInput(uint8_t selEsc);
36 void setEscOutput(uint8_t selEsc);
37 
38 #define ESC_IS_HI isEscHi(escSelected)
39 #define ESC_IS_LO isEscLo(escSelected)
40 #define ESC_SET_HI setEscHi(escSelected)
41 #define ESC_SET_LO setEscLo(escSelected)
42 #define ESC_INPUT setEscInput(escSelected)
43 #define ESC_OUTPUT setEscOutput(escSelected)
44 
45 typedef struct ioMem_s {
46  uint16_t len;
47  uint16_t addr;
48  uint8_t *data;
49 } ioMem_t;
struct ioMem_s ioMem_t
gpio_config_t gpio_config_INPUT
Definition: serial_4way_impl.h:25
uint8_t escSelected
Definition: serial_4way_impl.h:21
void setEscInput(uint8_t selEsc)
uint8_t * data
Definition: serial_4way_impl.h:48
void setEscHi(uint8_t selEsc)
bool isEscLo(uint8_t selEsc)
uint16_t pinpos
Definition: serial_4way_impl.h:23
GPIO_TypeDef * gpio
Definition: serial_4way_impl.h:22
gpio_config_t gpio_config_OUTPUT
Definition: serial_4way_impl.h:26
uint16_t addr
Definition: serial_4way_impl.h:47
Definition: gpio.h:102
Definition: platform.h:43
bool isEscHi(uint8_t selEsc)
uint16_t pin
Definition: serial_4way_impl.h:24
Definition: serial_4way_impl.h:45
void setEscLo(uint8_t selEsc)
void setEscOutput(uint8_t selEsc)
uint16_t len
Definition: serial_4way_impl.h:46