From e3b77418c4ef68f6af6cdcdfc4bbbb1cf7592cab Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Mon, 19 Jun 2023 16:14:12 +0200 Subject: [PATCH] ESP32H2: Improve examples documentation (#598) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: 🎨 Improve print format * docs: 📝 Update advanced_serial documentation * docs: 📝 Update examples documentation --- esp32-hal/examples/advanced_serial.rs | 6 +++++- esp32c2-hal/examples/advanced_serial.rs | 6 +++++- esp32c3-hal/examples/advanced_serial.rs | 6 +++++- esp32c6-hal/examples/advanced_serial.rs | 6 +++++- esp32h2-hal/examples/advanced_serial.rs | 10 +++++++++- esp32h2-hal/examples/aes.rs | 2 ++ esp32h2-hal/examples/mcpwm.rs | 2 +- esp32s2-hal/examples/advanced_serial.rs | 6 +++++- esp32s3-hal/examples/advanced_serial.rs | 6 +++++- 9 files changed, 42 insertions(+), 8 deletions(-) diff --git a/esp32-hal/examples/advanced_serial.rs b/esp32-hal/examples/advanced_serial.rs index 707f3f365..1f070ed14 100644 --- a/esp32-hal/examples/advanced_serial.rs +++ b/esp32-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO16 +//! - RX => GPIO17 #![no_std] #![no_main] @@ -71,7 +75,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32c2-hal/examples/advanced_serial.rs b/esp32c2-hal/examples/advanced_serial.rs index 22eacf04b..2e07d072e 100644 --- a/esp32c2-hal/examples/advanced_serial.rs +++ b/esp32c2-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -72,7 +76,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32c3-hal/examples/advanced_serial.rs b/esp32c3-hal/examples/advanced_serial.rs index 0c4094e07..6a76025ab 100644 --- a/esp32c3-hal/examples/advanced_serial.rs +++ b/esp32c3-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -79,7 +83,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32c6-hal/examples/advanced_serial.rs b/esp32c6-hal/examples/advanced_serial.rs index 322374c5a..a11be9ca6 100644 --- a/esp32c6-hal/examples/advanced_serial.rs +++ b/esp32c6-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -80,7 +84,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32h2-hal/examples/advanced_serial.rs b/esp32h2-hal/examples/advanced_serial.rs index b0812ffc2..0e2950eba 100644 --- a/esp32h2-hal/examples/advanced_serial.rs +++ b/esp32h2-hal/examples/advanced_serial.rs @@ -2,6 +2,14 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -80,7 +88,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32h2-hal/examples/aes.rs b/esp32h2-hal/examples/aes.rs index 3f82b86ad..56530ed23 100644 --- a/esp32h2-hal/examples/aes.rs +++ b/esp32h2-hal/examples/aes.rs @@ -1,3 +1,5 @@ +//! Encrypt/Decrypt a message using AES + #![no_std] #![no_main] use aes::{ diff --git a/esp32h2-hal/examples/mcpwm.rs b/esp32h2-hal/examples/mcpwm.rs index e63d42cf4..70913b8ae 100644 --- a/esp32h2-hal/examples/mcpwm.rs +++ b/esp32h2-hal/examples/mcpwm.rs @@ -1,7 +1,7 @@ //! Uses timer0 and operator0 of the MCPWM0 //! //! to output a 50% duty -//! signal at 16 kHz. +//! signal at 20 kHz. //! //! The signal will be output to the pin assigned to `pin`. (GPIO4) diff --git a/esp32s2-hal/examples/advanced_serial.rs b/esp32s2-hal/examples/advanced_serial.rs index 3a8e65c50..6197099a9 100644 --- a/esp32s2-hal/examples/advanced_serial.rs +++ b/esp32s2-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -71,7 +75,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), } diff --git a/esp32s3-hal/examples/advanced_serial.rs b/esp32s3-hal/examples/advanced_serial.rs index ecc524a53..00bad4e14 100644 --- a/esp32s3-hal/examples/advanced_serial.rs +++ b/esp32s3-hal/examples/advanced_serial.rs @@ -2,6 +2,10 @@ //! You can short the TX and RX pin and see it reads what was written. //! Additionally you can connect a logic analzyer to TX and see how the changes //! of the configuration change the output signal. +//! +//! The following wiring is assumed: +//! - TX => GPIO1 +//! - RX => GPIO2 #![no_std] #![no_main] @@ -71,7 +75,7 @@ fn main() -> ! { let read = block!(serial1.read()); match read { - Ok(read) => println!("Read {:02x}", read), + Ok(read) => println!("Read 0x{:02x}", read), Err(err) => println!("Error {:?}", err), }