esp-hal: Add (where missing) used GPIOs to example descriptions (#1810)

* esp-hal: Add (where missing) used GPIOs to example descriptions

* review comments
This commit is contained in:
Juraj Sadel 2024-07-17 10:34:13 +02:00 committed by GitHub
parent e33b060734
commit 884db5aa32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
50 changed files with 255 additions and 145 deletions

View File

@ -3,6 +3,13 @@
//! //!
//! Alternatively, you could also connect the IO pin to GND or 3V3 to see the //! Alternatively, you could also connect the IO pin to GND or 3V3 to see the
//! maximum and minimum raw values read. //! maximum and minimum raw values read.
//!
//! The following wiring is assumed for ESP32:
//! - Analog pin => GPIO32
//! The following wiring is assumed for ESP32S2/S3:
//! - Analog pin => GPIO3
//! The following wiring is assumed for others:
//! - Analog pin => GPIO2
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,6 +1,11 @@
//! Connect a potentiometer to PIN2 and see the read values change when //! Connect a potentiometer to GPIO and see the read values change when
//! rotating the shaft. Alternatively you could also connect the PIN to GND or //! rotating the shaft. Alternatively you could also connect the PIN to GND or
//! 3V3 to see the maximum and minimum raw values read. //! 3V3 to see the maximum and minimum raw values read.
//!
//! The following wiring is assumed for ESP32S3:
//! - Analog pin => GPIO3
//! The following wiring is assumed for others:
//! - Analog pin => GPIO2
//% CHIPS: esp32c2 esp32c3 esp32c6 esp32s3 //% CHIPS: esp32c2 esp32c3 esp32c6 esp32s3

View File

@ -1,6 +1,7 @@
//! Blinks an LED //! Blinks an LED
//! //!
//! This assumes that a LED is connected to the pin assigned to `led`. (GPIO0) //! The following wiring is assumed:
//! - LED => GPIO0
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,9 +1,10 @@
//! Blinks 3 LEDs //! Blinks 3 LEDs
//! //!
//! This assumes that LEDs are connected to GPIO2, 4 and 5. //! The boot button is treated as an input, and will print a message when pressed.
//! This additionally demonstrates passing GPIO to a function in a generic way.
//! //!
//! GPIO1 is treated as an input, and will print a message when pressed. This //! The following wiring is assumed:
//! Additionally demonstrates passing GPIO to a function in a generic way. //! - LEDs => GPIO2, GPIO4, GPIO5
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -5,6 +5,13 @@
//! //!
//! When targeting the ESP32, the pins for `DAC1` and `DAC2` are GPIO25 and //! When targeting the ESP32, the pins for `DAC1` and `DAC2` are GPIO25 and
//! GPIO26 respectively; for the ESP32-S2, they are GPIO17 and GPIO18. //! GPIO26 respectively; for the ESP32-S2, they are GPIO17 and GPIO18.
//!
//! The following wiring is assumed for ESP32:
//! - DAC1 => GPIO25
//! - DAC2 => GPIO26
//! The following wiring is assumed for ESP32S2:
//! - DAC1 => GPIO17
//! - DAC2 => GPIO18
//% CHIPS: esp32 esp32s2 //% CHIPS: esp32 esp32s2

View File

@ -1,14 +1,14 @@
//! Embassy I2C //! Embassy I2C
//! //!
//! Folowing pins are used:
//! SDA GPIO4
//! SCL GPIO5
//!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.
//! //!
//! This is an example of running the embassy executor with IC2. It uses an //! This is an example of running the embassy executor with IC2. It uses an
//! LIS3DH to get accelerometer data. //! LIS3DH to get accelerometer data.
//!
//! Folowing pins are used:
//! - SDA => GPIO4
//! - SCL => GPIO5
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -3,9 +3,9 @@
//! This example dumps the calibration data from a BMP180 sensor by reading by reading //! This example dumps the calibration data from a BMP180 sensor by reading by reading
//! with the direct I2C API and the embedded-hal-async I2C API. //! with the direct I2C API and the embedded-hal-async I2C API.
//! //!
//! //! Folowing pins are used: //! Folowing pins are used:
//! SDA GPIO4 //! - SDA => GPIO4
//! SCL GPIO5 //! - SCL => GPIO5
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,15 +1,15 @@
//! This shows how to continously receive data via I2S. //! This shows how to continously receive data via I2S.
//! //!
//! Pins used:
//! MCLK GPIO0 (not ESP32)
//! BCLK GPIO2
//! WS GPIO4
//! DIN GPIO5
//!
//! Without an additional I2S source device you can connect 3V3 or GND to DIN //! Without an additional I2S source device you can connect 3V3 or GND to DIN
//! to read 0 or 0xFF or connect DIN to WS to read two different values. //! to read 0 or 0xFF or connect DIN to WS to read two different values.
//! //!
//! You can also inspect the MCLK, BCLK and WS with a logic analyzer. //! You can also inspect the MCLK, BCLK and WS with a logic analyzer.
//!
//! The following wiring is assumed:
//! - MCLK => GPIO0 (not supported on ESP32)
//! - BCLK => GPIO2
//! - WS => GPIO4
//! - DIN => GPIO5
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,18 +1,17 @@
//! This shows how to transmit data continously via I2S. //! This shows how to transmit data continously via I2S.
//! //!
//! Pins used:
//! BCLK GPIO2
//! WS GPIO4
//! DOUT GPIO5
//!
//! Without an additional I2S sink device you can inspect the BCLK, WS //! Without an additional I2S sink device you can inspect the BCLK, WS
//! and DOUT with a logic analyzer. //! and DOUT with a logic analyzer.
//! //!
//! You can also connect e.g. a PCM510x to hear an annoying loud sine tone (full //! You can also connect e.g. a PCM510x to hear an annoying loud sine tone (full
//! scale), so turn down the volume before running this example. //! scale), so turn down the volume before running this example.
//! //!
//! Wiring is like this: //! The following wiring is assumed:
//! - BCLK => GPIO2
//! - WS => GPIO4
//! - DOUT => GPIO5
//! //!
//! PCM510x:
//! | Pin | Connected to | //! | Pin | Connected to |
//! |-------|-----------------| //! |-------|-----------------|
//! | BCK | GPIO1 | //! | BCK | GPIO1 |

View File

@ -2,6 +2,9 @@
//! //!
//! The second core runs a simple LED blinking task, that is controlled by a //! The second core runs a simple LED blinking task, that is controlled by a
//! signal set by the task running on the other core. //! signal set by the task running on the other core.
//!
//! The following wiring is assumed:
//! - LED => GPIO0
//% CHIPS: esp32 esp32s3 //% CHIPS: esp32 esp32s3
//% FEATURES: embassy embassy-generic-timers //% FEATURES: embassy embassy-generic-timers

View File

@ -2,6 +2,9 @@
//! //!
//! The second core runs a simple LED blinking task, that is controlled by a //! The second core runs a simple LED blinking task, that is controlled by a
//! signal set by the task running on the other core. //! signal set by the task running on the other core.
//!
//! The following wiring is assumed:
//! - LED => GPIO0
//% CHIPS: esp32 esp32s3 //% CHIPS: esp32 esp32s3
//% FEATURES: embassy embassy-generic-timers //% FEATURES: embassy embassy-generic-timers

View File

@ -1,7 +1,8 @@
//! This shows using Parallel IO to input 4 bit parallel data at 1MHz clock //! This shows using Parallel IO to input 4 bit parallel data at 1MHz clock
//! rate. //! rate.
//! //!
//! Uses GPIO 1, 2, 3 and 4 as the data pins. //! The following wiring is assumed:
//! - Data pins => GPIO1, GPIO2, GPIO3, and GPIO4.
//% CHIPS: esp32c6 esp32h2 //% CHIPS: esp32c6 esp32h2
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,9 +1,10 @@
//! This shows using Parallel IO to output 4 bit parallel data at 1MHz clock //! This shows using Parallel IO to output 4 bit parallel data at 1MHz clock
//! rate. //! rate.
//! //!
//! Uses GPIO 1, 2, 3 and 4 as the data pins. //! The following wiring is assumed:
//! GPIO 5 as the "valid pin" (driven high during an active transfer) and GPIO //! - Data pins => GPIO1, GPIO2, GPIO3, and GPIO4
//! 8 as the clock signal output. //! - Valid pin => GPIO5 (driven high during an active transfer)
//! - Clock output pin => GPIO8
//! //!
//! You can use a logic analyzer to see how the pins are used. //! You can use a logic analyzer to see how the pins are used.

View File

@ -1,5 +1,7 @@
//! Demonstrates decoding pulse sequences with RMT //! Demonstrates decoding pulse sequences with RMT
//! Connect GPIO5 to GPIO4 //!
//! The following wiring is assumed:
//! - Connect GPIO4 and GPIO5
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,6 +1,9 @@
//! Demonstrates generating pulse sequences with RMT //! Demonstrates generating pulse sequences with RMT
//! //!
//! Connect a logic analyzer to GPIO4 to see the generated pulses. //! Connect a logic analyzer to GPIO4 to see the generated pulses.
//!
//! The following wiring is assumed:
//! - generated pulses => GPIO4
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -3,12 +3,12 @@
//! This is an example of running the embassy executor and asynchronously //! This is an example of running the embassy executor and asynchronously
//! writing to and reading from uart //! writing to and reading from uart
#![no_std]
#![no_main]
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers
#![no_std]
#![no_main]
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, signal::Signal}; use embassy_sync::{blocking_mutex::raw::NoopRawMutex, signal::Signal};
use esp_backtrace as _; use esp_backtrace as _;

View File

@ -1,18 +1,16 @@
//! Embassy SPI //! Embassy SPI
//! //!
//! Folowing pins are used:
//! SCLK GPIO0
//! MISO GPIO2
//! MOSI GPIO4
//! CS GPIO5
//!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.
//! //!
//! Connect MISO and MOSI pins to see the outgoing data is read as incoming //! Connect MISO and MOSI pins to see the outgoing data is read as incoming
//! data. //! data.
//! //!
//! This is an example of running the embassy executor with SPI. //! The following wiring is assumed:
//! SCLK => GPIO0
//! MISO => GPIO2
//! MOSI => GPIO4
//! CS => GPIO5
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -9,6 +9,10 @@
//! //!
//! This example should work with another ESP board running the `twai` example //! This example should work with another ESP board running the `twai` example
//! with `IS_SENDER` set to `true`. //! with `IS_SENDER` set to `true`.
//!
//! The following wiring is assumed:
//! - TX => GPIO0
//! - RX => GPIO2
//% CHIPS: esp32c3 esp32c6 esp32s2 esp32s3 //% CHIPS: esp32c3 esp32c6 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,6 +1,10 @@
//! CDC-ACM serial port example using embassy. //! CDC-ACM serial port example using embassy.
//! //!
//! This example should be built in release mode. //! This example should be built in release mode.
//!
//! The following wiring is assumed:
//! - DP => GPIO20
//! - DM => GPIO19
//% CHIPS: esp32s2 esp32s3 //% CHIPS: esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,6 +1,6 @@
//! embassy wait //! embassy wait
//! //!
//! This is an example of asynchronously `Wait`ing for a pin state to change. //! This is an example of asynchronously `Wait`ing for a pin state (boot button) to change.
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: async embassy embassy-generic-timers //% FEATURES: async embassy embassy-generic-timers

View File

@ -1,4 +1,7 @@
//! Control LED on GPIO1 by the systimer via ETM //! Control LED by the systimer via ETM without involving the CPU.
//! The following wiring is assumed:
//! - LED => GPIO1
//% CHIPS: esp32c6 esp32h2 //% CHIPS: esp32c6 esp32h2

View File

@ -1,4 +1,7 @@
//! Control LED on GPIO1 by the BOOT-BUTTON via ETM //! Control LED by the boot button via ETM without involving the CPU.
//! The following wiring is assumed:
//! - LED => GPIO1
//% CHIPS: esp32c6 esp32h2 //% CHIPS: esp32c6 esp32h2

View File

@ -2,6 +2,9 @@
//! //!
//! This prints "Interrupt" when the boot button is pressed. //! This prints "Interrupt" when the boot button is pressed.
//! It also blinks an LED like the blinky example. //! It also blinks an LED like the blinky example.
//!
//! The following wiring is assumed:
//! - LED => GPIO2
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -7,6 +7,17 @@
//! crate functionality to circle through the HSV hue color space (with //! crate functionality to circle through the HSV hue color space (with
//! saturation and value both at 255). Additionally, we apply a gamma correction //! saturation and value both at 255). Additionally, we apply a gamma correction
//! and limit the brightness to 10 (out of 255). //! and limit the brightness to 10 (out of 255).
//!
//! The following wiring is assumed for ESP32:
//! - LED => GPIO33
//! The following wiring is assumed for ESP32C3:
//! - LED => GPIO8
//! The following wiring is assumed for ESP32C6, ESP32H2:
//! - LED => GPIO8
//! The following wiring is assumed for ESP32S2:
//! - LED => GPIO18
//! The following wiring is assumed for ESP32S3:
//! - LED => GPIO48
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,15 +1,15 @@
//! This shows how to continously receive data via I2S. //! This shows how to continously receive data via I2S.
//! //!
//! Pins used:
//! MCLK GPIO0 (not ESP32)
//! BCLK GPIO2
//! WS GPIO4
//! DIN GPIO5
//!
//! Without an additional I2S source device you can connect 3V3 or GND to DIN //! Without an additional I2S source device you can connect 3V3 or GND to DIN
//! to read 0 or 0xFF or connect DIN to WS to read two different values. //! to read 0 or 0xFF or connect DIN to WS to read two different values.
//! //!
//! You can also inspect the MCLK, BCLK and WS with a logic analyzer. //! You can also inspect the MCLK, BCLK and WS with a logic analyzer.
//!
//! The following wiring is assumed:
//! - MCLK => GPIO0 (not supported on ESP32)
//! - BCLK => GPIO2
//! - WS => GPIO4
//! - DIN => GPIO5
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,18 +1,17 @@
//! This shows how to transmit data continously via I2S. //! This shows how to transmit data continously via I2S.
//! //!
//! Pins used:
//! BCLK GPIO2
//! WS GPIO4
//! DOUT GPIO5
//!
//! Without an additional I2S sink device you can inspect the MCLK, BCLK, WS //! Without an additional I2S sink device you can inspect the MCLK, BCLK, WS
//! andDOUT with a logic analyzer. //! andDOUT with a logic analyzer.
//! //!
//! You can also connect e.g. a PCM510x to hear an annoying loud sine tone (full //! You can also connect e.g. a PCM510x to hear an annoying loud sine tone (full
//! scale), so turn down the volume before running this example. //! scale), so turn down the volume before running this example.
//! //!
//! Wiring is like this: //! The following wiring is assumed:
//! - BCLK => GPIO2
//! - WS => GPIO4
//! - DOUT => GPIO5
//! //!
//! PCM510x:
//! | Pin | Connected to | //! | Pin | Connected to |
//! |-------|-----------------| //! |-------|-----------------|
//! | BCK | GPIO0 | //! | BCK | GPIO0 |

View File

@ -2,21 +2,21 @@
//! //!
//! This example reads a JPEG from an OV2640 and writes it to the console as hex. //! This example reads a JPEG from an OV2640 and writes it to the console as hex.
//! //!
//! Pins used: //! The following wiring is assumed:
//! SIOD GPIO4 //! - SIOD => GPIO4
//! SIOC GPIO5 //! - SIOC => GPIO5
//! XCLK GPIO15 //! - XCLK => GPIO15
//! VSYNC GPIO6 //! - VSYNC => GPIO6
//! HREF GPIO7 //! - HREF => GPIO7
//! PCLK GPIO13 //! - PCLK => GPIO13
//! D2 GPIO11 //! - D2 => GPIO11
//! D3 GPIO9 //! - D3 => GPIO9
//! D4 GPIO8 //! - D4 => GPIO8
//! D5 GPIO10 //! - D5 => GPIO10
//! D6 GPIO12 //! - D6 => GPIO12
//! D7 GPIO18 //! - D7 => GPIO18
//! D8 GPIO17 //! - D8 => GPIO17
//! D9 GPIO16 //! - D9 => GPIO16
//% CHIPS: esp32s3 //% CHIPS: esp32s3

View File

@ -2,20 +2,19 @@
//! //!
//! This example clears the screen with red and then blue every second. //! This example clears the screen with red and then blue every second.
//! //!
//! Pins used: //! The following wiring is assumed:
//! //! - Backlight => GPIO45
//! Backlight GPIO45 //! - Reset => GPIO4
//! Reset GPIO4 //! - CD => GPIO0
//! CD GPIO0 //! - WR => GPIO47
//! WR GPIO47 //! - D0 => GPIO9
//! D0 GPIO9 //! - D1 => GPIO46
//! D1 GPIO46 //! - D2 => GPIO3
//! D2 GPIO3 //! - D3 => GPIO8
//! D3 GPIO8 //! - D4 => GPIO18
//! D4 GPIO18 //! - D5 => GPIO17
//! D5 GPIO17 //! - D6 => GPIO16
//! D6 GPIO16 //! - D7 => GPIO15
//! D7 GPIO15
//% CHIPS: esp32s3 //% CHIPS: esp32s3

View File

@ -1,7 +1,8 @@
//! Turns on LED with the option to change LED intensity depending on `duty` //! Turns on LED with the option to change LED intensity depending on `duty`
//! value. Possible values (`u32`) are in range 0..100. //! value. Possible values (`u32`) are in range 0..100.
//! //!
//! This assumes that a LED is connected to the pin assigned to `led`. (GPIO0) //! The following wiring is assumed:
//! - LED => GPIO0
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,9 +1,12 @@
//! This shows a very basic example of running code on the LP core. //! This shows a very basic example of running code on the LP core.
//! //!
//! Code on LP core increments a counter and continuously toggles GPIO1. The //! Code on LP core increments a counter and continuously toggles LED. The
//! current value is printed by the HP core. //! current value is printed by the HP core.
//! //!
//! Make sure to first compile the `esp-lp-hal/examples/blinky.rs` example //! Make sure to first compile the `esp-lp-hal/examples/blinky.rs` example
//!
//! The following wiring is assumed:
//! - LED => GPIO1
//% CHIPS: esp32c6 //% CHIPS: esp32c6

View File

@ -4,6 +4,10 @@
//! check `lp_core_i2c` example in the `esp-lp-hal`. //! check `lp_core_i2c` example in the `esp-lp-hal`.
//! //!
//! Make sure to first compile the `esp-lp-hal/examples/i2c.rs` example //! Make sure to first compile the `esp-lp-hal/examples/i2c.rs` example
//!
//! The following wiring is assumed:
//! - SDA => GPIO6
//! - SCL => GPIO7
//% CHIPS: esp32c6 //% CHIPS: esp32c6

View File

@ -4,6 +4,10 @@
//! check `lp_core_uart` example in the `esp-lp-hal. //! check `lp_core_uart` example in the `esp-lp-hal.
//! //!
//! Make sure to first compile the `esp-lp-hal/examples/uart.rs` example //! Make sure to first compile the `esp-lp-hal/examples/uart.rs` example
//!
//! The following wiring is assumed:
//! - TX => GPIO5
//! - RX => GPIO4
//% CHIPS: esp32c6 //% CHIPS: esp32c6

View File

@ -1,7 +1,8 @@
//! Uses timer0 and operator0 of the MCPWM0 peripheral to output a 50% duty //! Uses timer0 and operator0 of the MCPWM0 peripheral to output a 50% duty
//! signal at 20 kHz. //! signal at 20 kHz.
//! //!
//! The signal will be output to the pin assigned to `pin`. (GPIO0) //! The following wiring is assumed:
//! - Output pin => GPIO0
//% CHIPS: esp32 esp32c6 esp32h2 esp32s3 //% CHIPS: esp32 esp32c6 esp32h2 esp32s3

View File

@ -1,7 +1,8 @@
//! This shows using Parallel IO to input 4 bit parallel data at 1MHz clock //! This shows using Parallel IO to input 4 bit parallel data at 1MHz clock
//! rate. //! rate.
//! //!
//! Uses GPIO 1, 2, 3 and 4 as the data pins. //! The following wiring is assumed:
//! - Data pins => GPIO1, GPIO2, GPIO3, and GPIO4.
//% CHIPS: esp32c6 esp32h2 //% CHIPS: esp32c6 esp32h2

View File

@ -1,9 +1,10 @@
//! This shows using Parallel IO to output 4 bit parallel data at 1MHz clock //! This shows using Parallel IO to output 4 bit parallel data at 1MHz clock
//! rate. //! rate.
//! //!
//! Uses GPIO 1, 2, 3 and 4 as the data pins. //! The following wiring is assumed:
//! GPIO 5 as the "valid pin" (driven high during an active transfer) and GPIO //! - Data pins => GPIO1, GPIO2, GPIO3, and GPIO4
//! 6 as the clock signal output. //! - Valid pin => GPIO5 (driven high during an active transfer)
//! - Clock output pin => GPIO6
//! //!
//! You can use a logic analyzer to see how the pins are used. //! You can use a logic analyzer to see how the pins are used.

View File

@ -5,6 +5,10 @@
//! Since the PCNT units reset to zero when they reach their limits //! Since the PCNT units reset to zero when they reach their limits
//! we enable an interrupt on the upper and lower limits and //! we enable an interrupt on the upper and lower limits and
//! track the overflow in an AtomicI32 //! track the overflow in an AtomicI32
//!
//! The following wiring is assumed:
//! - Control signal => GPIO4
//! - Edge signal => GPIO5
//% CHIPS: esp32 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,20 +1,20 @@
//! SPI write and read a flash chip //! SPI write and read a flash chip
//! //!
//! Folowing pins are used: //! The following wiring is assumed:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO/IO0 GPIO1 //! - MISO => GPIO1
//! MOSI/IO1 GPIO2 //! - MOSI => GPIO2
//! IO2 GPIO3 //! - IO2 => GPIO3
//! IO3 GPIO4 //! - IO3 => GPIO4
//! CS GPIO5 //! - CS => GPIO5
//! //!
//! Folowing pins are used for ESP32: //! The following wiring is assumed for ESP32:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO/IO0 GPIO2 //! - MISO => GPIO2
//! MOSI/IO1 GPIO4 //! - MOSI => GPIO4
//! IO2 GPIO5 //! - IO2 => GPIO5
//! IO3 GPIO13 //! - IO3 => GPIO13
//! CS GPIO14 //! - CS => GPIO14
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,4 +1,9 @@
//! Demonstrates decoding pulse sequences with RMT //! Demonstrates decoding pulse sequences with RMT
//!
//! The following wiring is assumed:
//! - Input pin => GPIO4
//! - Output pin => GPIO5
//!
//! Connect GPIO5 to GPIO4 //! Connect GPIO5 to GPIO4
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,6 +1,9 @@
//! Demonstrates generating pulse sequences with RMT //! Demonstrates generating pulse sequences with RMT
//! //!
//! Connect a logic analyzer to GPIO4 to see the generated pulses. //! Connect a logic analyzer to GPIO4 to see the generated pulses.
//!
//! The following wiring is assumed:
//! - generated pulses => GPIO4
//% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3

View File

@ -1,4 +1,7 @@
//! Demonstrates deep sleep with timer and ext0 (using gpio4) wakeup //! Demonstrates deep sleep with timer and ext0 wakeup
//!
//! The following wiring is assumed:
//! - ext0 wakeup pin => GPIO4
//% CHIPS: esp32 esp32s3 //% CHIPS: esp32 esp32s3

View File

@ -1,4 +1,7 @@
//! Demonstrates deep sleep with timer and ext1 (using gpio4 & gpio2) wakeup //! Demonstrates deep sleep with timer and ext1 wakeup
//!
//! The following wiring is assumed:
//! - ext1 wakeup pins => GPIO2, GPIO4
//% CHIPS: esp32 esp32s3 //% CHIPS: esp32 esp32s3

View File

@ -1,4 +1,8 @@
//! Demonstrates deep sleep with timer, using gpio2 (low) and gpio3 (high) as wakeup sources. //! Demonstrates deep sleep with timer, using low and high level pins as wakeup sources.
//!
//! The following wiring is assumed:
//! - ext1 wakeup pin => GPIO2 (low level)
//! => GPIO3 (high level)
//% CHIPS: esp32c6 //% CHIPS: esp32c6

View File

@ -1,5 +1,11 @@
//! Demonstrates deep sleep with timer, using GPIO2 (low) and GPIO3 (high) as //! Demonstrates deep sleep with timer, using RTC pins as
//! wakeup. //! wakeup.
//!
//! The following wiring is assumed for ESP32C3:
//! - RTC wakeup pin => GPIO2 (low level)
//! - RTC wakeup pin => GPIO3 (high level)
//! The following wiring is assumed for ESP32S3:
//! - RTC wakeup pin => GPIO18 (low level)
//% CHIPS: esp32c3 esp32s3 //% CHIPS: esp32c3 esp32s3

View File

@ -1,20 +1,20 @@
//! SPI read manufacturer id from flash chip //! SPI read manufacturer id from flash chip
//! //!
//! Folowing pins are used: //! The following wiring is assumed:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO/IO0 GPIO1 //! - MISO/IO0 => GPIO1
//! MOSI/IO1 GPIO2 //! - MOSI/IO1 => GPIO2
//! IO2 GPIO3 //! - IO2 => GPIO3
//! IO3 GPIO4 //! - IO3 => GPIO4
//! CS GPIO5 //! - CS => GPIO5
//! //!
//! Folowing pins are used for ESP32: //! The following wiring is assumed for ESP32:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO/IO0 GPIO2 //! - MISO/IO0 => GPIO2
//! MOSI/IO1 GPIO4 //! - MOSI/IO1 => GPIO4
//! IO2 GPIO5 //! - IO2 => GPIO5
//! IO3 GPIO13 //! - IO3 => GPIO13
//! CS GPIO14 //! - CS => GPIO14
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,10 +1,10 @@
//! SPI loopback test //! SPI loopback test
//! //!
//! Folowing pins are used: //! The following wiring is assumed:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO GPIO2 //! - MISO => GPIO2
//! MOSI GPIO4 //! - MOSI => GPIO4
//! CS GPIO5 //! - CS => GPIO5
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,10 +1,10 @@
//! SPI loopback test using DMA //! SPI loopback test using DMA
//! //!
//! Folowing pins are used: //! The following wiring is assumed:
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO GPIO2 //! - MISO => GPIO2
//! MOSI GPIO4 //! - MOSI => GPIO4
//! CS GPIO5 //! - CS => GPIO5
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,17 +1,17 @@
//! SPI slave loopback test using DMA //! SPI slave loopback test using DMA
//! //!
//! Following pins are used for the (bitbang) slave: //! The following wiring is assumed for the (bitbang) slave:
//! //!
//! SCLK GPIO0 //! - SCLK => GPIO0
//! MISO GPIO1 //! - MISO => GPIO1
//! MOSI GPIO2 //! - MOSI => GPIO2
//! CS GPIO3 //! - CS => GPIO3
//! //!
//! Following pins are used for the (bitbang) master: //! The following wiring is assumed for the (bitbang) master:
//! SCLK GPIO4 //! - SCLK => GPIO4
//! MISO GPIO5 //! - MISO => GPIO5
//! MOSI GPIO8 //! - MOSI => GPIO8
//! CS GPIO9 //! - CS => GPIO9
//! //!
//! Depending on your target and the board you are using you have to change the //! Depending on your target and the board you are using you have to change the
//! pins. //! pins.

View File

@ -1,13 +1,16 @@
//! This example sends a CAN message to another ESP and receives it back. //! This example sends a CAN message to another ESP and receives it back.
//! //!
//! Wiring:
//! This example works without CAN Transceivers by: //! This example works without CAN Transceivers by:
//! * setting the tx pins to open drain //! * setting the tx pins to open drain
//! * connecting all rx and tx pins together //! * connecting all rx and tx pins together
//! * adding a pull-up to the signal pins //! * adding a pull-up to the signal pins
//! //!
//! The following wiring is assumed:
//! - TX => GPIO0
//! - RX => GPIO2
//!
//! ESP1/GND --- ESP2/GND //! ESP1/GND --- ESP2/GND
//! ESP1/IO0 --- ESP1/IO2 --- ESP2/IO0 --- ESP2/IO2 --- 4.8kOhm --- ESP1/5V //! ESP1/GPIO0 --- ESP1/GPIO2 --- ESP2/GPIO0 --- ESP2/GPIO2 --- 4.8kOhm --- ESP1/5V
//! //!
//! `IS_FIRST_SENDER` below must be set to false on one of the ESP's //! `IS_FIRST_SENDER` below must be set to false on one of the ESP's

View File

@ -1,7 +1,10 @@
//! This shows a very basic example of running code on the ULP RISCV core. //! This shows a very basic example of running code on the ULP RISCV core.
//! //!
//! Code on ULP core just increments a counter and blinks GPIO 1. The current //! Code on ULP core just increments a counter and blinks with LED. The current
//! value is printed by the HP core. //! value is printed by the HP core.
//!
//! The following wiring is assumed:
//! - LED => GPIO1
//% CHIPS: esp32s2 esp32s3 //% CHIPS: esp32s2 esp32s3

View File

@ -1,6 +1,10 @@
//! CDC-ACM serial port example using polling in a busy loop. //! CDC-ACM serial port example using polling in a busy loop.
//! //!
//! This example should be built in release mode. //! This example should be built in release mode.
//!
//! The following wiring is assumed:
//! - DP => GPIO20
//! - DM => GPIO19
//% CHIPS: esp32s2 esp32s3 //% CHIPS: esp32s2 esp32s3