Structure
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
[workspace]
|
||||
members = [
|
||||
# Device types
|
||||
"node",
|
||||
"master",
|
||||
# Examples
|
||||
"examples/playground"
|
||||
]
|
||||
|
||||
|
@ -4,3 +4,12 @@ Physical is a library for interacting with the physical world from a computer. T
|
||||
|
||||
* Collecting and digitizing data from the physical world.
|
||||
* Controlling devices that take physical action.
|
||||
|
||||
## Concepts
|
||||
The main concepts of Physical are:
|
||||
* Peripheral: A peripheral is a board that hosts physical I/O and usually does analog to digital conversion or
|
||||
digital to analog conversion. A peripheral cannot function on its own, it must be connected to a node. This is more
|
||||
narrow than the
|
||||
definition of a peripheral in embedded systems generally.
|
||||
* Node: A node hosts peripherals. A node can have a master but does not need one.
|
||||
* Master: A master hosts nodes. It is possible for a device to be both a node and a master at the same time.
|
@ -10,9 +10,4 @@ readme.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
thiserror.workspace = true
|
||||
uom.workspace = true
|
||||
log.workspace = true
|
||||
env_logger.workspace = true
|
||||
futures-lite.workspace = true
|
||||
async-io.workspace = true
|
||||
physical = { path = "../.." }
|
13
master/Cargo.toml
Normal file
13
master/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "physical-master"
|
||||
description = "A master hosts nodes."
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
readme.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
physical = { path = ".." }
|
14
master/src/lib.rs
Normal file
14
master/src/lib.rs
Normal file
@ -0,0 +1,14 @@
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
13
node/Cargo.toml
Normal file
13
node/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "physical-node"
|
||||
description = "A node hosts peripherals."
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
readme.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
physical = { path = ".." }
|
14
node/src/lib.rs
Normal file
14
node/src/lib.rs
Normal file
@ -0,0 +1,14 @@
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user