-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Executor (initial) - Notifier (support new rust version) - LockFree (initial) - Cross (initial) - Devices (initial)
- Loading branch information
1 parent
48a7ac4
commit 56017e1
Showing
61 changed files
with
3,851 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
[package] | ||
name = "varuemb" | ||
version = "0.2.0" | ||
edition = "2021" | ||
rust-version = "1.77" | ||
authors = ["Volkalex28 <[email protected]>"] | ||
description = """Toolchain for easy creation of asynchronous embedded applications on rust-lang""" | ||
license = "MIT" | ||
homepage = "https://github.com/Volkalex28/varu-emb#readme" | ||
repository = "https://github.com/Volkalex28/varu-emb" | ||
readme = "README.md" | ||
categories = ["asynchronous", "data-structures", "embedded"] | ||
keywords = ["channels", "embassy", "async", "notification", "rpc"] | ||
include = [ | ||
"/src", | ||
"/utils", | ||
"/notifier", | ||
"/README.md", | ||
"/LICENSE", | ||
] | ||
|
||
# [dependencies.varuemb-utils] | ||
# path = "utils/" | ||
categories = ["asynchronous", "data-structures", "embedded"] | ||
description = """Toolchain for easy creation of asynchronous embedded applications on rust-lang""" | ||
include = ["/src", "/executor", "/lockfree", "/utils", "/notifier", "/README.md", "/LICENSE"] | ||
keywords = ["channels", "embassy", "async", "notification", "rpc"] | ||
readme = "README.md" | ||
|
||
# [dependencies.varuemb-notifier] | ||
# path = "notifier/" | ||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true | ||
|
||
[dependencies] | ||
varuemb-notifier = { path = "notifier" } | ||
varuemb-utils = { path = "utils" } | ||
[workspace.package] | ||
authors = ["Volkalex28 <[email protected]>"] | ||
edition = "2021" | ||
homepage = "https://github.com/Volkalex28/varu-emb#readme" | ||
license = "MIT" | ||
repository = "https://github.com/Volkalex28/varu-emb" | ||
rust-version = "1.77" | ||
version = "0.3.0" | ||
|
||
[workspace] | ||
members = ["utils", "notifier"] | ||
members = ["cross", "executor", "lockfree", "notifier", "utils", "build"] | ||
|
||
[features] | ||
default = ["cross", "devices", "executor", "utils"] | ||
std = ["cross/std", "executor/std"] | ||
|
||
[dependencies] | ||
cross = { path = "cross", package = "varuemb-cross", optional = true } | ||
devices = { path = "devices", package = "varuemb-devices", optional = true } | ||
executor = { path = "executor", package = "varuemb-executor", optional = true } | ||
lockfree = { path = "lockfree", package = "varuemb-lockfree", optional = true } | ||
notifier = { path = "notifier", package = "varuemb-notifier", optional = true } | ||
utils = { path = "utils", package = "varuemb-utils", optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "varuemb-build" | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true | ||
|
||
[features] | ||
default = ["cross"] | ||
|
||
[dependencies] | ||
cross = { path = "cross", package = "varuemb-cross-build", optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[package] | ||
name = "varuemb-cross-build" | ||
version = "0.1.0" | ||
edition = "2021" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub struct Cfg; | ||
|
||
impl Cfg { | ||
pub fn link() { | ||
println!("cargo::rustc-check-cfg=cfg(cross_platform, values(any()))"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[cfg(feature = "cross")] | ||
pub use cross; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "varuemb-cross" | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true | ||
|
||
[features] | ||
std = ["embedded-io/std"] | ||
|
||
[dependencies] | ||
embedded-hal = { version = "1.0.0" } | ||
embedded-hal-async = { version = "1.0.0" } | ||
embedded-io = { version = "0.6.1" } | ||
embedded-io-async = { version = "0.6.1" } | ||
forward-traits = { git = "https://github.com/Volkalex28/forward-traits.git", branch = "asynch" } | ||
proc = { path = "proc", package = "varuemb-cross-proc" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "varuemb-cross-proc" | ||
version = "0.1.0" | ||
|
||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
derive_builder = { version = "0.20.0" } | ||
heck = { version = "0.5.0" } | ||
linked-hash-map = { version = "0.5" } | ||
proc-macro2 = { version = "1.0" } | ||
quote = { version = "1.0" } | ||
syn = { version = "2.0", features = ["full", "extra-traits"] } | ||
syn_derive = { version = "0.1" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
use super::tokens; | ||
use crate::Parenthesized; | ||
use syn::parse::{Nothing, Parse}; | ||
use syn::punctuated::Punctuated; | ||
use syn::token; | ||
use syn_derive::Parse; | ||
|
||
pub type Members = Punctuated<Member, token::Comma>; | ||
|
||
#[derive(Debug, Parse)] | ||
pub enum Property<D: Parse = Nothing> { | ||
#[parse(peek = tokens::error)] | ||
Error { | ||
token: tokens::error, | ||
#[allow(unused)] | ||
colon: token::Colon, | ||
ty: syn::Type, | ||
}, | ||
|
||
#[parse(peek = token::Async)] | ||
Async { | ||
token: token::Async, | ||
#[parse(Parenthesized::parse_opt)] | ||
data: Option<Parenthesized<D>>, | ||
}, | ||
|
||
#[parse(peek = tokens::blocking)] | ||
Blocking { | ||
token: tokens::blocking, | ||
#[parse(Parenthesized::parse_opt)] | ||
data: Option<Parenthesized<D>>, | ||
}, | ||
} | ||
|
||
#[derive(Debug, Parse)] | ||
pub enum Interface { | ||
#[parse(peek = tokens::i2c)] | ||
I2c { | ||
#[allow(unused)] | ||
token: tokens::i2c, | ||
props: Parenthesized<Property>, | ||
}, | ||
|
||
#[parse(peek = tokens::io)] | ||
Io { | ||
#[allow(unused)] | ||
token: tokens::io, | ||
props: Parenthesized<Property<io::Part>>, | ||
}, | ||
|
||
#[parse(peek = tokens::spi)] | ||
Spi { | ||
#[allow(unused)] | ||
token: tokens::spi, | ||
props: Parenthesized<Property<spi::Type>>, | ||
}, | ||
} | ||
|
||
#[derive(Debug, Parse)] | ||
pub struct Member { | ||
pub ident: syn::Member, | ||
#[allow(unused)] | ||
pub colon: token::Colon, | ||
pub interface: Interface, | ||
} | ||
|
||
pub mod io { | ||
use super::*; | ||
|
||
#[derive(Debug, Parse)] | ||
pub enum Part { | ||
#[parse(peek = tokens::read)] | ||
Read(tokens::read), | ||
#[parse(peek = tokens::write)] | ||
Write(tokens::write), | ||
} | ||
|
||
mod tokens { | ||
syn::custom_keyword!(read); | ||
syn::custom_keyword!(write); | ||
} | ||
} | ||
|
||
pub mod spi { | ||
use super::*; | ||
|
||
#[derive(Debug, Parse)] | ||
pub enum Type { | ||
#[parse(peek = tokens::bus)] | ||
Bus(tokens::bus), | ||
#[parse(peek = tokens::device)] | ||
Device(tokens::device), | ||
} | ||
|
||
mod tokens { | ||
syn::custom_keyword!(bus); | ||
syn::custom_keyword!(device); | ||
} | ||
} |
Oops, something went wrong.