go_inthex

package module
v0.0.0-...-44ed702 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 7 Imported by: 0

README

go-inthex

Go Intel HEX encoding / decoding library

Documentation

Index

Constants

View Source
const (
	RecordData = RecordCode(iota)
	RecordEOF
	RecordExtendedSegmentAddress
	RecordStartSegmentAddress
	RecordExtendedLinearAddress
	RecordStartLinearAddress
)
View Source
const ExtendedLinearAddressMask uint32 = 0xFFFF0000
View Source
const RecordExtendedSegmentAddressMask uint32 = 0x000FFFF0

Variables

This section is empty.

Functions

func Checksum

func Checksum(data []byte) (sum uint8)

func Encode

func Encode(stream *Stream) (hex []byte, err error)

Types

type Record

type Record struct {
	Code    RecordCode
	Address uint16
	Data    []byte
}

func RecordFromString

func RecordFromString(data string) (Record, error)

func (Record) String

func (r Record) String() string

type RecordCode

type RecordCode uint8

type Region

type Region struct {
	Address uint32
	Data    []byte
	Extra   []string
}

func (*Region) Append

func (r *Region) Append(data []byte)

func (*Region) IsContiguousAddress

func (r *Region) IsContiguousAddress(addr uint32) bool

type Stream

type Stream struct {
	Regions []Region

	StartSegmentAddress uint32
	StartLinearAddress  uint32
}

func Decode

func Decode(data []byte) (stream *Stream, err error)

func (*Stream) Data

func (s *Stream) Data() (data []byte, baseAddress uint32)

Data Returns a binary image, from the lowest base address

Jump to

Keyboard shortcuts

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