Initial node implementation #4

Merged
zack merged 51 commits from develop into master 2023-07-19 18:09:13 +00:00
10 changed files with 137 additions and 45 deletions
Showing only changes of commit 02212e99ab - Show all commits

View File

@ -15,16 +15,20 @@ readme = "README.md"
license = "MIT" license = "MIT"
[workspace.dependencies] [workspace.dependencies]
##### no-std #####
# General utility
thiserror = "1.0.*" thiserror = "1.0.*"
uom = "0.33.*" # Units of measurement
uom = "0.34.*"
# Logging # Logging
log = "0.4.*" tracing = "0.1.*"
env_logger = "0.10.*" # Serialization
parity-scale-codec = "3.4.*"
##### std #####
# Async # Async
futures-lite = "1.12.*" futures-lite = "1.12.*"
async-io = "1.12.*" async-io = "1.13.*"
# Serialization
parity-scale-codec = "3.2.*"
[package] [package]
name = "physical" name = "physical"
@ -38,5 +42,4 @@ license.workspace = true
[dependencies] [dependencies]
thiserror.workspace = true thiserror.workspace = true
uom.workspace = true uom.workspace = true
log.workspace = true
parity-scale-codec.workspace = true parity-scale-codec.workspace = true

View File

@ -9,7 +9,11 @@ Physical is a library for interacting with the physical world from a computer. T
The main concepts of Physical are: 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 * 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 digital to analog conversion. A peripheral cannot function on its own, it must be connected to a node. This is more
narrow than the narrow than the definition of a peripheral in embedded systems generally. Peripheral support is done on the basis
definition of a peripheral in embedded systems generally. of complete boards, not individual components like an ADC. Abstractions for individual components should be made
* Node: A node hosts peripherals. A node can have a master but does not need one. separately, such as in BFHAL.
* Master: A master hosts nodes. It is possible for a device to be both a node and a master at the same time. * Node: A node hosts peripherals. A node can have a master but does not need one. A node can ignore or even override
commands from the master computer. In a complex system, nodes are intended to be kept simple, less likely to
encounter an error than the master, and in many cases should check for obvious problems in commands from the master.
* Master: A master hosts nodes. It is possible for a device to be both a node and a master at the same time,
although it may not be the best idea to make such a setup.

View File

@ -11,6 +11,6 @@ license.workspace = true
[dependencies] [dependencies]
physical = { path = ".." } physical = { path = ".." }
env_logger.workspace = true tracing.workspace = true
futures-lite.workspace = true futures-lite.workspace = true
async-io.workspace = true async-io.workspace = true

3
rustfmt.toml Normal file
View File

@ -0,0 +1,3 @@
format_strings=true
wrap_comments=true
comment_width=100