NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
msp.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  */
17 
18 #pragma once
19 
20 #include "common/streambuf.h"
21 
22 typedef struct mspPacket_s {
24  int16_t cmd;
25  int16_t result;
26 } mspPacket_t;
27 
28 struct msp {
30  uint32_t activeBoxIds;
31 
35  #ifdef USE_SERIAL_4WAY_BLHELI_INTERFACE
36  bool mspEnterEsc4way;
37  #endif
38 
39  struct ninja *ninja;
40  struct config *config;
41 };
42 
43 struct ninja;
44 
45 void msp_init(struct msp *self, struct ninja *ninja, struct config *config);
46 int msp_process(struct msp *self, mspPacket_t *command, mspPacket_t *reply);
Definition: config.h:81
Definition: ninja.h:40
sbuf_t buf
Definition: msp.h:23
struct mspPacket_s mspPacket_t
void msp_init(struct msp *self, struct ninja *ninja, struct config *config)
Definition: msp.c:1476
struct ninja * ninja
switch to 4wayIf (on current port)
Definition: msp.h:39
Definition: streambuf.h:25
int16_t result
Definition: msp.h:25
Definition: msp.h:22
uint32_t activeBoxIds
mask of enabled IDs, calculated on start based on enabled features. boxId_e is used as bit index...
Definition: msp.h:30
bool isRebootScheduled
cause reboot after MSP processing complete
Definition: msp.h:33
Definition: msp.h:28
struct config * config
Definition: msp.h:40
int16_t cmd
Definition: msp.h:24
int msp_process(struct msp *self, mspPacket_t *command, mspPacket_t *reply)
Definition: msp.c:1485