uf2

package
v0.0.0-...-1bedc47 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UF2MagicStart0 = 0x0A324655 // "UF2\n"
	UF2MagicStart1 = 0x9E5D5157 // "Q\u009D"
	UF2BlockSize   = 512
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UF2Block

type UF2Block struct {
	MagicStart0 uint32
	MagicStart1 uint32
	Flags       uint32
	TargetAddr  uint32
	PayloadSize uint32
	BlockNo     uint32
	NumBlocks   uint32
	FileSize    uint32 // or familyID;
	Data        [476]byte
	MagicEnd    uint32
}

UF2Block represents a UF2 block.

type UF2File

type UF2File struct {
	Blocks []UF2Block
}

UF2File represents the structure of a UF2 file.

func Read

func Read(filename string) (*UF2File, error)

Read reads a UF2 file

func (*UF2File) Bytes

func (u *UF2File) Bytes() []byte

Bytes creates a composite slice from all the Data slices in UF2File

func (*UF2File) ReplaceBytes

func (u *UF2File) ReplaceBytes(oldBytes, newBytes []byte)

ReplaceBytes replaces old slice with new slice in the UF2File

func (*UF2File) Write

func (u *UF2File) Write(filename string) error

Write writes a new UF2 file

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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