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 syslink protocol, a UART-based
25 * protocol for communication between the NRF51 MCU and the STM32 MCU on
26 * the Crazyflie flight controller board.
28 * For more details, see https://wiki.bitcraze.io/doc:crazyflie:syslink:index
31 #define SYSLINK_MTU 32
33 #define SYSLINK_START_BYTE1 0xBC
34 #define SYSLINK_START_BYTE2 0xCF
36 #define SYSLINK_RADIO_GROUP 0x00
37 #define SYSLINK_RADIO_RAW 0x00
38 #define SYSLINK_RADIO_CHANNEL 0x01
39 #define SYSLINK_RADIO_DATARATE 0x02
40 #define SYSLINK_RADIO_CONTWAVE 0x03
41 #define SYSLINK_RADIO_RSSI 0x04
42 #define SYSLINK_RADIO_ADDRESS 0x05
43 #define SYSLINK_RADIO_RAW_BROADCAST 0x06
45 #define SYSLINK_PM_GROUP 0x10
46 #define SYSLINK_PM_SOURCE 0x10
47 #define SYSLINK_PM_ONOFF_SWITCHOFF 0x11
48 #define SYSLINK_PM_BATTERY_VOLTAGE 0x12
49 #define SYSLINK_PM_BATTERY_STATE 0x13
50 #define SYSLINK_PM_BATTERY_AUTOUPDATE 0x14
52 #define SYSLINK_OW_GROUP 0x20
53 #define SYSLINK_OW_SCAN 0x20
54 #define SYSLINK_OW_GETINFO 0x21
55 #define SYSLINK_OW_READ 0x22
56 #define SYSLINK_OW_WRITE 0x23
58 typedef struct syslinkPacket_s
62 char data
[SYSLINK_MTU
];
63 } __attribute__((packed
)) syslinkPacket_t
;
65 // State machine states for receiving syslink packets