lan865x

package
v0.0.0-...-8fa69d0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const MTU = 1536

Variables

View Source
var ErrRegsFailure = errors.New("tc6regs call failed")
View Source
var ErrSendFailure = errors.New("tc6send failed")

Functions

This section is empty.

Types

type HwIntf

type HwIntf interface {
	Reset() error
	IntrActive() bool
	SpiTxRx(tx, rx []byte, done func(err error)) error
}

type Inst

type Inst struct {
	MAC  *t1s.MACConf
	PLCA *t1s.PLCAConf

	UpperProto t1s.UpperProto
	Dev        HwIntf

	// DebugInfo and DebugError can be set to functions
	// logging at info resp. error level.
	// This way a direct dependency on a [slog.Logger] can be
	// avoided for now, which may increase chances for tinygo
	// to better optimize for size in case logging is disabled.
	DebugInfo  func(msg string, a ...any)
	DebugError func(msg string, a ...any)
	// contains filtered or unexported fields
}

Inst contains the state of one LAN865x driver instance. To create an instance, public fields MAC, PLCA, UpperProto, Dev should be populated first. Then .Init may be called to initialize the driver.

If PLCA is set to nil, then CSMA/CD is used.

func (*Inst) Init

func (inst *Inst) Init() bool

func (*Inst) SendEthDown

func (inst *Inst) SendEthDown(packet []byte) error

func (*Inst) Service

func (inst *Inst) Service() (allDone bool)

func (*Inst) SetPLCA

func (inst *Inst) SetPLCA(enable bool, nodeId uint8, nodeCount uint8) error

type TicksProvider

type TicksProvider interface {
	Milliseconds() uint32
}
var Ticks TicksProvider

Ticks must be set to an actual implementation of TicksProvider before a driver can be initialized.

Directories

Path Synopsis
internal
cgo

Jump to

Keyboard shortcuts

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