memio

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: BSD-3-Clause Imports: 8 Imported by: 52

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSlice

type ByteSlice []byte

ByteSlice is a wrapper around []byte.

func (*ByteSlice) Size

func (s *ByteSlice) Size() int64

Size of []byte.

func (*ByteSlice) String

func (s *ByteSlice) String() string

String formats a []byte in hex.

type Port added in v0.9.0

type Port struct {
	*os.File
}

Port implements memory and IO port access via an os.File.

func NewMemIOPort added in v0.9.0

func NewMemIOPort(f *os.File) *Port

NewMemIOPort returns a Port, given an os.File.

func (*Port) Close added in v0.9.0

func (m *Port) Close() error

Close implements Close.

func (*Port) Read added in v0.9.0

func (m *Port) Read(out UintN, addr int64) error

Read implements Reader for a Port

func (*Port) Write added in v0.9.0

func (m *Port) Write(in UintN, addr int64) error

Write implements Writer for a Port

type PortReadWriter added in v0.9.0

type PortReadWriter interface {
	PortReader
	PortWriter
	io.Closer
}

PortReadWriter implements io.ReadWriter for IO ports.

type PortReader added in v0.9.0

type PortReader interface {
	In(uint16, UintN) error
}

PortReader is the interface for IO port read access.

type PortWriter added in v0.9.0

type PortWriter interface {
	Out(uint16, UintN) error
}

PortWriter is the interface for IO port write access.

type ReadWriteCloser added in v0.9.0

type ReadWriteCloser interface {
	Reader
	Writer
	io.Closer
}

ReadWriteCloser implements io.ReadWriteCloser

type Reader added in v0.9.0

type Reader interface {
	Read(UintN, int64) error
}

Reader is the interface for reading from memory and IO ports.

type Uint16

type Uint16 uint16

Uint16 is a wrapper around uint16.

func (*Uint16) Size

func (u *Uint16) Size() int64

Size of uint16 is 2.

func (*Uint16) String

func (u *Uint16) String() string

String formats a uint16 in hex.

type Uint32

type Uint32 uint32

Uint32 is a wrapper around uint32.

func (*Uint32) Size

func (u *Uint32) Size() int64

Size of uint32 is 4.

func (*Uint32) String

func (u *Uint32) String() string

String formats a uint32 in hex.

type Uint64

type Uint64 uint64

Uint64 is a wrapper around uint64.

func (*Uint64) Size

func (u *Uint64) Size() int64

Size of uint64 is 8.

func (*Uint64) String

func (u *Uint64) String() string

String formats a uint64 in hex.

type Uint8

type Uint8 uint8

Uint8 is a wrapper around uint8.

func (*Uint8) Size

func (u *Uint8) Size() int64

Size of uint8 is 1.

func (*Uint8) String

func (u *Uint8) String() string

String formats a uint8 in hex.

type UintN

type UintN interface {
	// Return size in bytes.
	Size() int64

	// Return string formatted in hex.
	String() string
	// contains filtered or unexported methods
}

UintN is a wrapper around uint types and provides a few io-related functions.

type Writer added in v0.9.0

type Writer interface {
	Write(UintN, int64) error
}

Writer is the interface for writing to memory and IO ports.

Jump to

Keyboard shortcuts

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