diff --git a/Cargo.lock b/Cargo.lock
index c713af5..35e8e56 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,6 +2,21 @@
# It is not intended for manual editing.
version = 4
+[[package]]
+name = "aho-corasick"
+version = "1.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
+
[[package]]
name = "bare-metal"
version = "0.2.5"
@@ -17,6 +32,18 @@ version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719"
+[[package]]
+name = "bitflags"
+version = "2.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
[[package]]
name = "cortex-m"
version = "0.7.7"
@@ -46,9 +73,15 @@ checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.119",
]
+[[package]]
+name = "crc-any"
+version = "2.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46db9f663dfb869b80fcf59e32d7a80fc6c464a4f6328f3f06a00f5e36d05f8c"
+
[[package]]
name = "critical-section"
version = "1.2.0"
@@ -65,6 +98,21 @@ dependencies = [
"void",
]
+[[package]]
+name = "embedded-io"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9eb1aa714776b75c7e67e1da744b81a129b3ff919c8712b5e1b32252c1f07cc7"
+
+[[package]]
+name = "embedded-io-async"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2564b9f813c544241430e147d8bc454815ef9ac998878d30cc3055449f7fd4c0"
+dependencies = [
+ "embedded-io",
+]
+
[[package]]
name = "equivalent"
version = "1.0.2"
@@ -111,14 +159,66 @@ dependencies = [
"stm32f7",
]
+[[package]]
+name = "kaptan-mavlink"
+version = "0.1.0"
+dependencies = [
+ "bitflags",
+ "kaptan-spec",
+ "mavlink",
+ "mavlink-bindgen",
+ "mavlink-core",
+ "num-derive",
+ "num-traits",
+]
+
[[package]]
name = "kaptan-spec"
version = "0.1.0"
dependencies = [
- "syn",
+ "syn 2.0.119",
"trybuild",
]
+[[package]]
+name = "mavlink"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef539c358c31f69d47816dac709eebbcb733166ae1bcdeeb4463383c042e3e7c"
+dependencies = [
+ "bitflags",
+ "mavlink-bindgen",
+ "mavlink-core",
+ "num-derive",
+ "num-traits",
+]
+
+[[package]]
+name = "mavlink-bindgen"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "055c957f9fe541226e5b6f0a8aef09b81b9ac865bfc2d083bd6440ed1692602f"
+dependencies = [
+ "crc-any",
+ "proc-macro2",
+ "quick-xml",
+ "quote",
+ "regex",
+ "thiserror",
+]
+
+[[package]]
+name = "mavlink-core"
+version = "0.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b31cc9f930c7edce0c1933659d405a330a28346cdf087bd283a56a6d72eb3d85"
+dependencies = [
+ "byteorder",
+ "crc-any",
+ "embedded-io",
+ "embedded-io-async",
+]
+
[[package]]
name = "memchr"
version = "2.8.3"
@@ -140,6 +240,26 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d"
+[[package]]
+name = "num-derive"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "panic-halt"
version = "1.0.0"
@@ -161,6 +281,15 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "quick-xml"
+version = "0.39.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdcc8dd4e2f670d309a5f0e83fe36dfdc05af317008fea29144da1a2ac858e5e"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "quote"
version = "1.0.46"
@@ -170,6 +299,35 @@ dependencies = [
"proc-macro2",
]
+[[package]]
+name = "regex"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
+
[[package]]
name = "rtic"
version = "2.3.0"
@@ -198,7 +356,7 @@ dependencies = [
"indexmap",
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.119",
]
[[package]]
@@ -251,7 +409,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 2.0.119",
]
[[package]]
@@ -298,6 +456,17 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "syn"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2fac314a64dc9a36e61a9eb4261a5e9bbfbc922b27e518af97bc32b926cf967"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
[[package]]
name = "target-triple"
version = "1.0.0"
@@ -313,6 +482,26 @@ dependencies = [
"winapi-util",
]
+[[package]]
+name = "thiserror"
+version = "2.0.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.0",
+]
+
[[package]]
name = "toml"
version = "1.1.3+spec-1.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index d807457..0ed0810 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,7 @@
[workspace]
members = [
"boards/kakute-f7-mini-v3",
+ "libs/kaptan-mavlink",
"libs/kaptan-spec",
]
resolver = "2"
diff --git a/libs/kaptan-mavlink/Cargo.toml b/libs/kaptan-mavlink/Cargo.toml
new file mode 100644
index 0000000..e1e5572
--- /dev/null
+++ b/libs/kaptan-mavlink/Cargo.toml
@@ -0,0 +1,25 @@
+[package]
+name = "kaptan-mavlink"
+edition.workspace = true
+license.workspace = true
+repository.workspace = true
+rust-version.workspace = true
+version.workspace = true
+
+[lints]
+workspace = true
+
+[features]
+default = ["dialect-kaptan"]
+dialect-kaptan = []
+
+[dependencies]
+mavlink = { version = "0.18", default-features = false, features = ["embedded", "dialect-common"] }
+mavlink-core = { version = "0.18", default-features = false, features = ["embedded"] }
+bitflags = "2"
+num-derive = "0.4"
+num-traits = "0.2"
+
+[build-dependencies]
+kaptan-spec = { path = "../kaptan-spec", features = ["std"] }
+mavlink-bindgen = "0.18"
\ No newline at end of file
diff --git a/libs/kaptan-mavlink/build.rs b/libs/kaptan-mavlink/build.rs
new file mode 100644
index 0000000..3010406
--- /dev/null
+++ b/libs/kaptan-mavlink/build.rs
@@ -0,0 +1,16 @@
+use std::path::PathBuf;
+
+fn main() {
+ kaptan_spec::validate_package();
+
+ let manifest_directory = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
+ let dialect = manifest_directory.join("definitions/kaptan.xml");
+ let output_directory = std::env::var("OUT_DIR").unwrap();
+ let generated = mavlink_bindgen::generate(
+ mavlink_bindgen::XmlDefinitions::Files(vec![dialect]),
+ output_directory,
+ )
+ .unwrap();
+
+ mavlink_bindgen::emit_cargo_build_messages(&generated);
+}
diff --git a/libs/kaptan-mavlink/definitions/kaptan.xml b/libs/kaptan-mavlink/definitions/kaptan.xml
new file mode 100644
index 0000000..7e10b37
--- /dev/null
+++ b/libs/kaptan-mavlink/definitions/kaptan.xml
@@ -0,0 +1,9 @@
+
+
+ 3
+ 0
+
+
+
+
+
\ No newline at end of file
diff --git a/libs/kaptan-mavlink/src/lib.rs b/libs/kaptan-mavlink/src/lib.rs
new file mode 100644
index 0000000..0d7b532
--- /dev/null
+++ b/libs/kaptan-mavlink/src/lib.rs
@@ -0,0 +1,11 @@
+//! MAVLink support for Kaptan.
+
+#![no_std]
+
+/// Supported MAVLink message types for Kaptan.
+pub mod message {
+ pub use mavlink::MAVLinkV2MessageRaw;
+ pub use mavlink::dialects::common::*;
+
+ include!(concat!(env!("OUT_DIR"), "/mod.rs"));
+}
diff --git a/libs/kaptan-mavlink/src/lib.spec.md b/libs/kaptan-mavlink/src/lib.spec.md
new file mode 100644
index 0000000..1f21b23
--- /dev/null
+++ b/libs/kaptan-mavlink/src/lib.spec.md
@@ -0,0 +1,10 @@
+# --- version: 0.1.0 ---
+
+---
+title: MAVLink Support for Kaptan
+status: in-progress
+owners:
+ - Onur Özkan
+---
+
+## TODO
\ No newline at end of file