Skip to content

support msp version 2 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2e680a9
support msp version 2
amfern Mar 27, 2020
797a2a6
fix msp v2 packet parsing
amfern Mar 27, 2020
4f95d40
fork multiwii-serial-protocol
amfern Apr 30, 2020
cebb423
use rust vec instead of Cow, avoid lifetime static to the caller
amfern Mar 30, 2020
8ccba3b
add msp2 message ids
amfern Apr 15, 2020
937f816
upgrade packet_struct to latest
amfern Apr 16, 2020
d8ac5b4
add msp structs
amfern Apr 16, 2020
8e5a794
add inav common settings msp
amfern Apr 19, 2020
7ee2090
rename section_type to setting_type
amfern Apr 21, 2020
708c077
use enum for serial baurdrates
amfern Apr 25, 2020
57348aa
prefix osd layout with msp
amfern Apr 26, 2020
e11cbb5
redefine serial identifier with enum
amfern Apr 26, 2020
17cec50
refactor msp servo mix rule packet
amfern Apr 26, 2020
ef9e45b
upgrade version to 0.1.5
amfern Jun 18, 2020
5fece2b
add MspServoConfig packet
amfern Jun 18, 2020
01bde57
implement inav osd layout
amfern Jun 21, 2020
6bdc906
bump version 0.1.6
amfern Jun 22, 2020
56d61c1
implement convert trait for baudate and serialidentifier
amfern Jun 22, 2020
0d8745b
bump version 0.1.7
amfern Jun 22, 2020
4396767
add OSD_CHAR msp commands
amfern Jun 24, 2020
954a89e
bump version 0.1.8
amfern Jun 24, 2020
3863ad0
support inav flavor of smix
amfern Jun 25, 2020
ba4d575
optional support common setting int32 feature
amfern Jun 25, 2020
38d4f48
bump version 0.1.9
amfern Jun 25, 2020
673d619
fix servo struct to use int setting
amfern Jun 28, 2020
522de64
bump version 0.1.11
amfern Jun 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[package]
name = "multiwii_serial_protocol"
name = "multiwii_serial_protocol_v2"
description = "A Multiwii Serial Protocol (MSP) implementation for Rust"
repository = "https://github.com/hashmismatch/multiwii_serial_protocol.rs"
version = "0.1.1"
authors = ["Rudi Benkovic <[email protected]>"]
repository = "https://github.com/amfern/multiwii_serial_protocol.rs"
version = "0.1.11"
authors = ["Rudi Benkovic <[email protected]>", "Ilya Guterman <[email protected]>"]
license = "MIT OR Apache-2.0"
readme = "README.md"

[dependencies]
packed_struct = "0.2"
packed_struct_codegen = "0.2"
packed_struct = "0.3"
packed_struct_codegen = "0.3"
serde = "1.0"
serde_derive = "1.0"
crc-any = "2.3"

[features]
default = ["std"]
std = []
no_std = []
no_std = []
suppport_int32_setting_type = []
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ A Multiwii Serial Protocol (MSP) implementation for Rust

## Introduction

An incomplete implementation of the MSP protocol, with some Cleanflight and Betaflight extensions. Allows one to implement a flight controller that can connect to the Cleanflight or Baseflight configurator.
This is a fork of https://github.com/hashmismatch/multiwii_serial_protocol.rs!

An incomplete implementation of the MSP2 protocol, with some Cleanflight, Betaflight and iNav extensions. Allows one to implement a flight controller that can connect to the Cleanflight or Baseflight configurator.

# Installation

MSP is available on crates.io and can be included in your Cargo enabled project like this:

```toml
[dependencies]
multiwii_serial_protocol = "0.1.0"
multiwii_serial_protocol_2 = "0.1.9"
```

Then include it in your code like this:

```rust
extern crate multiwii_serial_protocol;
extern crate multiwii_serial_protocol_2;
```

License: MIT OR Apache-2.0
33 changes: 31 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(PrimitiveEnum_u8)]
#[derive(PrimitiveEnum)]
#[derive(Debug, Copy, Clone, PartialEq)]
#[allow(non_camel_case_types)]

Expand Down Expand Up @@ -57,6 +57,12 @@ pub enum MspCommandCode {
MSP_TRANSPONDER_CONFIG = 82,
MSP_SET_TRANSPONDER_CONFIG = 83,

MSP_OSD_CONFIG = 84, //out message Get osd settings - baseflight
MSP_SET_OSD_CONFIG = 85, //in message Set osd settings - baseflight

MSP_OSD_CHAR_READ = 86, //out message Get osd settings - betaflight
MSP_OSD_CHAR_WRITE = 87, //in message Set osd settings - betaflight

MSP_LED_STRIP_MODECOLOR = 127,
MSP_SET_LED_STRIP_MODECOLOR = 221,

Expand Down Expand Up @@ -157,5 +163,28 @@ pub enum MspCommandCode {
MSP_SET_PID_ADVANCED = 95,

MSP_SENSOR_CONFIG = 96,
MSP_SET_SENSOR_CONFIG = 97
MSP_SET_SENSOR_CONFIG = 97,

// Inav
MSP2_COMMON_SETTING = 0x1003, //in/out message Returns the value for a setting
MSP2_COMMON_SET_SETTING = 0x1004, //in message Sets the value for a setting

MSP2_MOTOR_MIXER = 0x1005,
MSP2_SET_MOTOR_MIXER = 0x1006,

MSP2_COMMON_SETTING_INFO = 0x1007,
MSP2_COMMON_PG_LIST = 0x1008,

MSP2_SERIAL_CONFIG = 0x1009,
MSP2_SET_SERIAL_CONFIG = 0x100A,

MSP2_INAV_OSD_LAYOUTS = 0x2012,
MSP2_INAV_OSD_SET_LAYOUT_ITEM = 0x2013,
MSP2_INAV_OSD_ALARMS = 0x2014,
MSP2_INAV_OSD_SET_ALARMS = 0x2015,
MSP2_INAV_OSD_PREFERENCES = 0x2016,
MSP2_INAV_OSD_SET_PREFERENCES = 0x2017,

MSP2_INAV_SERVO_MIXER = 0x2020,
MSP2_INAV_SET_SERVO_MIXER = 0x2021,
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ extern crate alloc;

extern crate packed_struct;

extern crate crc_any;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the use style imports, anyhow this surely better fits the rest of the code the way it is.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just tried to make it work, not so proficient with rust to have opinion yet


#[macro_use]
extern crate packed_struct_codegen;

Expand Down
Loading