diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a7b80fd5..9e24d8c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - DMA is supported for SPI3 on ESP32-S3 (#507) - `change_bus_frequency` is now available on `SpiDma` (#529) +### Changed +- Improve examples documentation (#533) + ## [0.9.0] - 2023-05-02 ### Added diff --git a/esp32-hal/examples/aes.rs b/esp32-hal/examples/aes.rs index 5404e0dfb..7e7b82cf2 100644 --- a/esp32-hal/examples/aes.rs +++ b/esp32-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES + #![no_std] #![no_main] use aes::{ diff --git a/esp32-hal/examples/embassy_i2c.rs b/esp32-hal/examples/embassy_i2c.rs index e7d0903c6..cc34f82b4 100644 --- a/esp32-hal/examples/embassy_i2c.rs +++ b/esp32-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO32 +//! SCL GPIO33 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32-hal/examples/embassy_spi.rs b/esp32-hal/examples/embassy_spi.rs index c4b424e30..7182efa0f 100644 --- a/esp32-hal/examples/embassy_spi.rs +++ b/esp32-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO19 +//! MISO GPIO25 +//! MOSI GPIO23 +//! CS GPIO22 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32-hal/examples/rsa.rs b/esp32-hal/examples/rsa.rs index e8b132af6..898a9f876 100644 --- a/esp32-hal/examples/rsa.rs +++ b/esp32-hal/examples/rsa.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using RSA. + #![no_std] #![no_main] diff --git a/esp32c2-hal/examples/embassy_i2c.rs b/esp32c2-hal/examples/embassy_i2c.rs index b19ad94aa..5605f346e 100644 --- a/esp32c2-hal/examples/embassy_i2c.rs +++ b/esp32c2-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO1 +//! SCL GPIO2 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32c2-hal/examples/embassy_spi.rs b/esp32c2-hal/examples/embassy_spi.rs index 2c805b5a5..0ab270f84 100644 --- a/esp32c2-hal/examples/embassy_spi.rs +++ b/esp32c2-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO6 +//! MISO GPIO2 +//! MOSI GPIO7 +//! CS GPIO10 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32c3-hal/examples/aes.rs b/esp32c3-hal/examples/aes.rs index 88a5f8e86..4387cfd08 100644 --- a/esp32c3-hal/examples/aes.rs +++ b/esp32c3-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES + #![no_std] #![no_main] use aes::{ diff --git a/esp32c3-hal/examples/embassy_i2c.rs b/esp32c3-hal/examples/embassy_i2c.rs index 057aa3973..cc829c604 100644 --- a/esp32c3-hal/examples/embassy_i2c.rs +++ b/esp32c3-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO1 +//! SCL GPIO2 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32c3-hal/examples/embassy_spi.rs b/esp32c3-hal/examples/embassy_spi.rs index f39414bcc..867a6a104 100644 --- a/esp32c3-hal/examples/embassy_spi.rs +++ b/esp32c3-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO6 +//! MISO GPIO2 +//! MOSI GPIO7 +//! CS GPIO10 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32c3-hal/examples/rsa.rs b/esp32c3-hal/examples/rsa.rs index 0a27e6470..df5aef2e8 100644 --- a/esp32c3-hal/examples/rsa.rs +++ b/esp32c3-hal/examples/rsa.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using RSA. + #![no_std] #![no_main] diff --git a/esp32c6-hal/examples/aes.rs b/esp32c6-hal/examples/aes.rs index b97852341..bb6052673 100644 --- a/esp32c6-hal/examples/aes.rs +++ b/esp32c6-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES. + #![no_std] #![no_main] use aes::{ diff --git a/esp32c6-hal/examples/embassy_i2c.rs b/esp32c6-hal/examples/embassy_i2c.rs index fbbd343ac..c4cbb96f2 100644 --- a/esp32c6-hal/examples/embassy_i2c.rs +++ b/esp32c6-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO1 +//! SCL GPIO2 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32c6-hal/examples/embassy_spi.rs b/esp32c6-hal/examples/embassy_spi.rs index 78747dfae..a295083e7 100644 --- a/esp32c6-hal/examples/embassy_spi.rs +++ b/esp32c6-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO6 +//! MISO GPIO2 +//! MOSI GPIO7 +//! CS GPIO10 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32c6-hal/examples/rsa.rs b/esp32c6-hal/examples/rsa.rs index bf3f38ffa..6c4e69ae9 100644 --- a/esp32c6-hal/examples/rsa.rs +++ b/esp32c6-hal/examples/rsa.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using RSA. + #![no_std] #![no_main] diff --git a/esp32s2-hal/examples/aes.rs b/esp32s2-hal/examples/aes.rs index 1b67f5abb..b781cdbf1 100644 --- a/esp32s2-hal/examples/aes.rs +++ b/esp32s2-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES. + #![no_std] #![no_main] use aes::{ diff --git a/esp32s2-hal/examples/embassy_i2c.rs b/esp32s2-hal/examples/embassy_i2c.rs index 6598b537b..992a91bce 100644 --- a/esp32s2-hal/examples/embassy_i2c.rs +++ b/esp32s2-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO1 +//! SCL GPIO2 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32s2-hal/examples/embassy_spi.rs b/esp32s2-hal/examples/embassy_spi.rs index 7f6d14abc..9956616ec 100644 --- a/esp32s2-hal/examples/embassy_spi.rs +++ b/esp32s2-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO36 +//! MISO GPIO37 +//! MOSI GPIO35 +//! CS GPIO34 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32s2-hal/examples/rsa.rs b/esp32s2-hal/examples/rsa.rs index b37b51dea..b0668d41c 100644 --- a/esp32s2-hal/examples/rsa.rs +++ b/esp32s2-hal/examples/rsa.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using RSA. + #![no_std] #![no_main] diff --git a/esp32s3-hal/examples/aes.rs b/esp32s3-hal/examples/aes.rs index cfd23d44f..0702d21bd 100644 --- a/esp32s3-hal/examples/aes.rs +++ b/esp32s3-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES. + #![no_std] #![no_main] use aes::{ diff --git a/esp32s3-hal/examples/embassy_i2c.rs b/esp32s3-hal/examples/embassy_i2c.rs index 086425e69..e0a7119bf 100644 --- a/esp32s3-hal/examples/embassy_i2c.rs +++ b/esp32s3-hal/examples/embassy_i2c.rs @@ -1,3 +1,15 @@ +//! Embassy I2C +//! +//! Folowing pins are used: +//! SDA GPIO1 +//! SCL GPIO2 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! This is an example of running the embassy executor with IC2. It uses an +//! LIS3DH to get accelerometer data. + #![no_std] #![no_main] #![feature(type_alias_impl_trait)] diff --git a/esp32s3-hal/examples/embassy_spi.rs b/esp32s3-hal/examples/embassy_spi.rs index 4044e5149..ee354b118 100644 --- a/esp32s3-hal/examples/embassy_spi.rs +++ b/esp32s3-hal/examples/embassy_spi.rs @@ -1,7 +1,18 @@ -//! embassy hello world +//! Embassy SPI //! -//! This is an example of running the embassy executor with multiple tasks -//! concurrently. +//! Folowing pins are used: +//! SCLK GPIO6 +//! MISO GPIO2 +//! MOSI GPIO7 +//! CS GPIO10 +//! +//! Depending on your target and the board you are using you have to change the +//! pins. +//! +//! Connect MISO and MOSI pins to see the outgoing data is read as incoming +//! data. +//! +//! This is an example of running the embassy executor with SPI. #![no_std] #![no_main] diff --git a/esp32s3-hal/examples/rsa.rs b/esp32s3-hal/examples/rsa.rs index d74ad8203..fe3b8600b 100644 --- a/esp32s3-hal/examples/rsa.rs +++ b/esp32s3-hal/examples/rsa.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using RSA. + #![no_std] #![no_main]