Merge pull request #9527 from mikeller/add_missing_acc_calibration_to_status
[betaflight.git] / src / main / msp / msp_box.h
blobb041c72df4be71e119dae5b4d1e6b0ea92991f59
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #include "fc/rc_modes.h"
25 typedef struct box_s {
26 const uint8_t boxId; // see boxId_e
27 const char *boxName; // GUI-readable box name
28 const uint8_t permanentId; // permanent ID used to identify BOX. This ID is unique for one function, DO NOT REUSE IT
29 } box_t;
31 #define PERMANENT_ID_NONE 255
33 const box_t *findBoxByBoxId(boxId_e boxId);
34 const box_t *findBoxByPermanentId(uint8_t permanentId);
36 struct boxBitmask_s;
37 int packFlightModeFlags(struct boxBitmask_s *mspFlightModeFlags);
38 struct sbuf_s;
39 void serializeBoxNameFn(struct sbuf_s *dst, const box_t *box);
40 void serializeBoxPermanentIdFn(struct sbuf_s *dst, const box_t *box);
41 typedef void serializeBoxFn(struct sbuf_s *dst, const box_t *box);
42 void serializeBoxReply(struct sbuf_s *dst, int page, serializeBoxFn *serializeBox);
43 void initActiveBoxIds(void);
44 bool getBoxIdState(boxId_e boxid);