ESP32

Pin mode

When utility pins are exposed through model parameters, an optional mode may be given as well. Pins have 3 modes available as described below.

ValueDescriptionNotes
0Configures the pin as active-low
1Configures the pin as active-high
2Configures the pin as open-drain active-lowDefault

Supported models

Today, ESP32s come in multiple flavors. Toit supports the classical ESP32 chips running a dual-core on the Xtensa LX6 architecture:

  • ESP32-D0WDQ6
  • ESP32-D0WD-V*

They are embedded in the following official modules:

  • ESP32-WROOM-32*
  • ESP32-WROVER-*

And most likely any other module with the above mentioned chips, with a minimum of 4 MB flash.

Unsupported models

This also means that Toit doesn't support the following:

  • ESP32-S2 (Single-core / Xtensa LX7)
  • ESP32-C3 (Single-core / RISC-V)
  • ESP32-S3 (Xtensa LX7)
  • ESP32-C6 (Single-core / RISC-V)

Model parameters

The Toit model, called esp32-4mb, supports a number of model-specific parameters to control core peripherals.

Power

In case the core peripherals are behind a secondary power circuit, the pwr option can be used to turn it on.

NameDescription
model.pwrPin number for the pwr line. Lazily driven active for the duration a core peripheral is needed.
model.pwr.modeThe mode of the pwr pin.

Cellular

Cellular can be enabled using the follow model parameters. When enabled, the Cellular subsystem will use the device's Cellular connectivity settings that can be configured in the Toit Console at runtime.

NameDescriptionNotes
model.cellular.enabledIf set to 1, loads the Cellular subsystem.Required
model.cellular.sara_r4If set to 1, activates the u-blox Sara R4 chip in the Cellular system.
model.cellular.sara_r5If set to 1, activates the u-blox Sara R5 chip in the Cellular system.
model.cellular.pwrPin number for the power-on line. This pin is periodically driven active to request the Cellular module to turn on.Required
model.cellular.pwr.modeThe mode of the pwr pin.
model.cellular.resetPin number for the power-on line. This pin is occasionally driven active if the Cellular module fails to turn on.
model.cellular.reset.modeThe mode of the reset pin.
model.cellular.txPin number for the UART TX line.Required
model.cellular.rxPin number for the UART RX line.Required
model.cellular.rtsPin number for the UART RTS line.
model.cellular.ctsPin number for the UART CTS line.