Module esp32c3_hal::gpio
source · Expand description
General Purpose I/Os
Overview
The GPIO peripheral provides access to General Purpose Input/Output pins on ESP chips.
This driver supports various operations on GPIO pins, including setting the pin mode, direction, and manipulating the pin state (setting high/low, toggling). It provides an interface to interact with GPIO pins on ESP chips, allowing developers to control and read the state of the pins. This module also implements a number of traits from embedded-hal to provide a common interface for GPIO pins.
To get access to the pins, you first need to convert them into a HAL
designed struct from the pac struct GPIO
and IO_MUX
using IO::new
.
Example
let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
let mut led = io.pins.gpio5.into_push_pull_output();
Structs
- General Purpose Input/Output driver
Enums
- Peripheral input signals for the GPIO mux
- Peripheral output signals for the GPIO mux
Constants
- Convenience constant for
Option::None
pin
Traits
Functions
Type Aliases
- Convenience type-alias for a no-pin / don’t care - pin