The ESP32 supports a wide range of peripherals, many of them supported directly by Toit, like the I2C protocol, the SPI communication interface, and GPIO pins.
Many chips support both SPI and I2C. While Toit makes it easy to write drivers that are usable by both, there are some clear advantages and disadvantages between the two.
- Supports longer distances
- Only requires two wires
- Is significantly faster
- Frequency configurable per device, not the bus
With Toit, working with General-Purpose Input/Output (GPIO) pins is easy and they can be configured and manipulated at runtime. In the GPIO section you'll learn how to use the GPIO pins with Toit.