Esp32.Chip (esp32 v0.2.0)

Copy Markdown View Source

Per-family constants, copied from esptool's target definitions.

Summary

Functions

Image header nibble for a flash frequency such as "40m".

Image header byte for a flash size such as "4MB".

Byte size of a flash size label the chip accepts, such as "4MB" or "512KB".

Chip family for a security-info chip id.

Chip family for the value of the ROM magic register 0x40001000.

Whether the ROM loader's FLASH_BEGIN takes the fifth (encrypted) word.

Base name of the flasher stub in priv/stubs, or nil when none is shipped.

Register and value that indicate the ROM console is on USB-OTG, if detectable.

Types

name()

@type name() ::
  :esp8266
  | :esp32
  | :esp32s2
  | :esp32s3
  | :esp32c3
  | :esp32c2
  | :esp32c6
  | :esp32c61
  | :esp32c5
  | :esp32h2
  | :esp32h21
  | :esp32h4
  | :esp32p4
  | :esp32e22
  | :esp32s31

Functions

bootloader_offset(name)

@spec bootloader_offset(name()) :: non_neg_integer()

flash_freq(name, freq)

@spec flash_freq(name(), String.t()) :: {:ok, non_neg_integer()} | :error

Image header nibble for a flash frequency such as "40m".

flash_size(name, size)

@spec flash_size(name(), String.t()) :: {:ok, non_neg_integer()} | :error

Image header byte for a flash size such as "4MB".

flash_size_bytes(name, size)

@spec flash_size_bytes(name(), String.t()) :: {:ok, pos_integer()} | :error

Byte size of a flash size label the chip accepts, such as "4MB" or "512KB".

from_id(id)

@spec from_id(integer() | nil) :: name() | nil

Chip family for a security-info chip id.

from_magic(magic)

@spec from_magic(integer() | nil) :: name() | nil

Chip family for the value of the ROM magic register 0x40001000.

names()

@spec names() :: [name()]

rom_extended_flash_begin?(name)

@spec rom_extended_flash_begin?(name()) :: boolean()

Whether the ROM loader's FLASH_BEGIN takes the fifth (encrypted) word.

stub(name)

@spec stub(name()) :: String.t() | nil

Base name of the flasher stub in priv/stubs, or nil when none is shipped.

usb_otg_check(name)

@spec usb_otg_check(name()) :: {non_neg_integer(), non_neg_integer()} | nil

Register and value that indicate the ROM console is on USB-OTG, if detectable.