diff --git a/src/assets/rust_layers.svg b/src/assets/rust_layers.svg new file mode 100644 index 0000000..c9e55ff --- /dev/null +++ b/src/assets/rust_layers.svg @@ -0,0 +1 @@ +Peripheral Access CrateHardware Abstraction Layer ImplDriverDriverApplicationBoard Support CrateUsesImplementsHardware Abstraction Layer TraitsMicrocontroller \ No newline at end of file diff --git a/src/portability/index.md b/src/portability/index.md index 615c397..6fcd7e1 100644 --- a/src/portability/index.md +++ b/src/portability/index.md @@ -20,6 +20,10 @@ How do we do this in Rust? Enter **embedded-hal**... In a nutshell it is a set of traits which define implementation contracts between **HAL implementations**, **drivers** and **applications (or firmwares)**. Those contracts include both capabilities (i.e. if a trait is implemented for a certain type, the **HAL implementation** provides a certain capability) and methods (i.e. if you can construct a type implementing a trait it is guarenteed that you have the methods specified in the trait available). +A typical layering might look like this: + +![](../assets/rust_layers.svg) + Some of the defined traits in **embedded-hal** are: * GPIO (input and output pins) * Serial communication