Adding more servos
[inav.git] / src / main / io / serial_4way_impl.h
blobfd0ce1051e51069be4c5c8b78d1dc3c93b013fc5
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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.
9 * Cleanflight 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.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16 * Author: 4712
18 #pragma once
20 #include "drivers/io_types.h"
22 typedef struct {
23 IO_t io;
24 } escHardware_t;
26 extern uint8_t selected_esc;
28 bool isEscHi(uint8_t selEsc);
29 bool isEscLo(uint8_t selEsc);
30 void setEscHi(uint8_t selEsc);
31 void setEscLo(uint8_t selEsc);
32 void setEscInput(uint8_t selEsc);
33 void setEscOutput(uint8_t selEsc);
35 #define ESC_IS_HI isEscHi(selected_esc)
36 #define ESC_IS_LO isEscLo(selected_esc)
37 #define ESC_SET_HI setEscHi(selected_esc)
38 #define ESC_SET_LO setEscLo(selected_esc)
39 #define ESC_INPUT setEscInput(selected_esc)
40 #define ESC_OUTPUT setEscOutput(selected_esc)
42 typedef struct ioMem_s {
43 uint8_t D_NUM_BYTES;
44 uint8_t D_FLASH_ADDR_H;
45 uint8_t D_FLASH_ADDR_L;
46 uint8_t *D_PTR_I;
47 } ioMem_t;