esp32

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CheckExecuteCommand

func CheckExecuteCommand(port *serial.SerialObj, command *command.CommandObj, timeout time.Duration, retries int) (*portal.ResponseObj, error)

func GetUID

func GetUID(port *serial.SerialObj, timeout time.Duration) ([]byte, error)

func ReadEfuse

func ReadEfuse(port *serial.SerialObj, timeout time.Duration, eFuseIndex uint32) ([]byte, error)

func ReadRegister

func ReadRegister(port *serial.SerialObj, timeout time.Duration, register uint32) ([]byte, error)

func RunCommand

func RunCommand(port *serial.SerialObj, command *command.CommandObj, timeout time.Duration) (*portal.ResponseObj, error)

Types

type ChipDescription

type ChipDescription struct {
	ChipType code.EspType
	Revision byte
}

func (*ChipDescription) String

func (c *ChipDescription) String() string

type CountingWriter

type CountingWriter struct {
	// contains filtered or unexported fields
}

func (*CountingWriter) Write

func (c *CountingWriter) Write(p []byte) (n int, err error)

type ESP32ROM

type ESP32ROM struct {
	SerialPort *serial.SerialObj
	// contains filtered or unexported fields
}

func NewESP32ROM

func NewESP32ROM(serialPort *serial.SerialObj, logger *output.LogObj) *ESP32ROM

func (*ESP32ROM) AttachSpiFlash

func (e *ESP32ROM) AttachSpiFlash() (err error)

func (*ESP32ROM) Connect

func (e *ESP32ROM) Connect(maxRetries uint) error

func (*ESP32ROM) GetChipDescription

func (e *ESP32ROM) GetChipDescription() (*ChipDescription, error)

func (*ESP32ROM) GetChipMAC

func (e *ESP32ROM) GetChipMAC() (string, error)

func (*ESP32ROM) GetFeatures

func (e *ESP32ROM) GetFeatures() (Features, error)

func (*ESP32ROM) ReadFlash

func (e *ESP32ROM) ReadFlash(offset uint32, size uint32) ([]byte, error)

func (*ESP32ROM) ReadPartitionList

func (e *ESP32ROM) ReadPartitionList() (PartitionList, error)

func (*ESP32ROM) Reset

func (e *ESP32ROM) Reset() error

func (*ESP32ROM) Sync

func (e *ESP32ROM) Sync() (err error)

func (*ESP32ROM) WriteFlash

func (e *ESP32ROM) WriteFlash(offset uint32, data []byte, useCompression bool) (err error)

type Features

type Features map[code.FeatureType]bool

func (Features) String

func (f Features) String() string

type Partition

type Partition struct {
	Name    string           `json:"name"`
	Type    PartitionType    `json:"type"`
	SubType PartitionSubType `json:"subtype"`
	Offset  int              `json:"offset"`
	Size    int              `json:"size"`
}

func (*Partition) String

func (p *Partition) String() string

type PartitionBinaryReader

type PartitionBinaryReader struct {
	// contains filtered or unexported fields
}

func NewPartitionBinaryReader

func NewPartitionBinaryReader(reader io.Reader) *PartitionBinaryReader

func (*PartitionBinaryReader) Read

func (p *PartitionBinaryReader) Read() (partition *Partition, err error)

func (*PartitionBinaryReader) ReadAll

func (p *PartitionBinaryReader) ReadAll() (partitionList PartitionList, err error)

type PartitionBinaryWriter

type PartitionBinaryWriter struct {
	// contains filtered or unexported fields
}

func NewPartitionBinaryWriter

func NewPartitionBinaryWriter(writer io.Writer) *PartitionBinaryWriter

func (*PartitionBinaryWriter) WriteAll

func (p *PartitionBinaryWriter) WriteAll(partitionList PartitionList) error

type PartitionList

type PartitionList []Partition

func (PartitionList) String

func (p PartitionList) String() string

type PartitionSubType

type PartitionSubType int

PartitionSubType as defined in esp_partition_subtype_t

const (
	// PartitionSubTypeFactory Factory application partition
	PartitionSubTypeFactory PartitionSubType = iota
	// PartitionSubTypeOTA0 OTA partition 0
	PartitionSubTypeOTA0
	// PartitionSubTypeOTA1 OTA partition 1
	PartitionSubTypeOTA1
	// PartitionSubTypeOTA2 OTA partition 2
	PartitionSubTypeOTA2
	// PartitionSubTypeOTA3 OTA partition 3
	PartitionSubTypeOTA3
	// PartitionSubTypeOTA4 OTA partition 4
	PartitionSubTypeOTA4
	// PartitionSubTypeOTA5 OTA partition 5
	PartitionSubTypeOTA5
	// PartitionSubTypeOTA6 OTA partition 6
	PartitionSubTypeOTA6
	// PartitionSubTypeOTA7 OTA partition 7
	PartitionSubTypeOTA7
	// PartitionSubTypeOTA8 OTA partition 8
	PartitionSubTypeOTA8
	// PartitionSubTypeOTA9 OTA partition 9
	PartitionSubTypeOTA9
	// PartitionSubTypeOTA10 OTA partition 10
	PartitionSubTypeOTA10
	// PartitionSubTypeOTA11 OTA partition 11
	PartitionSubTypeOTA11
	// PartitionSubTypeOTA12 OTA partition 12
	PartitionSubTypeOTA12
	// PartitionSubTypeOTA13 OTA partition 13
	PartitionSubTypeOTA13
	// PartitionSubTypeOTA14 OTA partition 14
	PartitionSubTypeOTA14
	// PartitionSubTypeOTA15 OTA partition 15
	PartitionSubTypeOTA15
	// PartitionSubTypeTest Test application partition
	PartitionSubTypeTest
	// PartitionSubTypePHY PHY init data partition
	PartitionSubTypePHY
	// PartitionSubTypeNVS NVS partition
	PartitionSubTypeNVS
	// PartitionSubTypeCoredump COREDUMP partition
	PartitionSubTypeCoredump
	// PartitionSubTypeNvsKeys Partition for NVS keys
	PartitionSubTypeNvsKeys
	// PartitionSubTypeEfuse Partition for emulate eFuse bits
	PartitionSubTypeEfuse
	// PartitionSubTypeEspHttpd ESPHTTPD partition
	PartitionSubTypeEspHttpd
	// PartitionSubTypeFAT FAT partition
	PartitionSubTypeFAT
	// PartitionSubTypeSpiffs SPIFFS partition
	PartitionSubTypeSpiffs
)

func ParsePartitionSubType

func ParsePartitionSubType(value string) (PartitionSubType, error)

ParsePartitionSubType parses a string into a PartitionSubType

func PartitionSubTypeFromUint8

func PartitionSubTypeFromUint8(value uint8) PartitionSubType

We don't need to know the partition type here, because no sub types (currently) overlap

func (PartitionSubType) MarshalJSON

func (p PartitionSubType) MarshalJSON() ([]byte, error)

func (PartitionSubType) String

func (p PartitionSubType) String() string

String returns a string representation of the given PartitionSubType

func (PartitionSubType) ToUint8

func (p PartitionSubType) ToUint8() uint8

ToUint8 returns a uint8 representation as defined in the ESP-IDF

func (PartitionSubType) UnmarshalJSON

func (p PartitionSubType) UnmarshalJSON(data []byte) error

type PartitionType

type PartitionType int
const (
	// PartitionTypeApp Application partition type
	PartitionTypeApp PartitionType = iota
	// PartitionTypeData Data partition type
	PartitionTypeData
)

func ParsePartitionType

func ParsePartitionType(value string) (PartitionType, error)

ParsePartitionType parses a string into a PartitionType

func PartitionTypeFromUint8

func PartitionTypeFromUint8(value uint8) PartitionType

func (PartitionType) MarshalJSON

func (p PartitionType) MarshalJSON() ([]byte, error)

func (PartitionType) String

func (p PartitionType) String() string

String returns a string representation of the given PartitionType

func (PartitionType) ToUint8

func (p PartitionType) ToUint8() uint8

ToUint8 returns a uint8 representation as defined in the ESP-IDF

func (PartitionType) UnmarshalJSON

func (p PartitionType) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL