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/>.
24 * This file contains definitions for the CRTP protocol, the data transport
25 * protocol used for OTA communication to the crazyflie (via either Nordic ESB or
26 * Bluetooth LE) and transmitted from the NRF51 to the STM32 via the syslink protocol
28 * For more details, see https://wiki.bitcraze.io/projects:crazyflie:crtp
31 #define CRTP_MAX_DATA_SIZE 30
34 CRTP_PORT_CONSOLE
= 0x00,
35 CRTP_PORT_PARAM
= 0x02,
36 CRTP_PORT_SETPOINT
= 0x03,
39 CRTP_PORT_LOCALIZATION
= 0x06,
40 CRTP_PORT_SETPOINT_GENERIC
= 0x07,
41 CRTP_PORT_PLATFORM
= 0x0D,
42 CRTP_PORT_LINK
= 0x0F,
45 typedef struct crtpPacket_s
52 uint8_t data
[CRTP_MAX_DATA_SIZE
];
53 } __attribute__((packed
)) crtpPacket_t
;
57 velocityWorldType
= 1,
60 } crtpCommanderPacketType_e
;
62 // Legacy RPYT data type for supporting existing clients
63 // See https://wiki.bitcraze.io/projects:crazyflie:crtp:commander
64 typedef struct crtpCommanderRPYT_s
70 } __attribute__((packed
)) crtpCommanderRPYT_t
;
72 // Commander packet type for emulating CPPM-style setpoints
73 // Corresponds to crtpCommanderPacketType_e::cppmEmuType
74 #define CRTP_CPPM_EMU_MAX_AUX_CHANNELS 10
75 typedef struct crtpCommanderCPPMEmuPacket_s
78 uint8_t numAuxChannels
: 4; // Set to 0 through CRTP_CPPM_EMU_MAX_AUX_CHANNELS
82 uint16_t channelPitch
;
84 uint16_t channelThrust
;
85 uint16_t channelAux
[CRTP_CPPM_EMU_MAX_AUX_CHANNELS
];
86 } __attribute__((packed
)) crtpCommanderCPPMEmuPacket_t
;
88 //typedef struct crtpCommander_s
96 // uint8_t numChannels;
97 // uint16_t channels[14];
99 //} __attribute__((packed)) crtpCommander_t;