sim

package
v0.0.0-...-28d9e09 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ALControl

type ALControl struct{ *ALStatusControl }

func (ALControl) Latch

func (c ALControl) Latch(shadow []byte, shadowWriteMask []bool)

func (ALControl) Read

func (c ALControl) Read(offs uint16, dp *uint8) bool

func (ALControl) WriteInteract

func (c ALControl) WriteInteract(offs uint16) bool

type ALStatus

type ALStatus struct{ *ALStatusControl }

func (ALStatus) Latch

func (s ALStatus) Latch(shadow []byte, shadowWriteMask []bool)

func (ALStatus) Read

func (s ALStatus) Read(offs uint16, dp *uint8) bool

func (ALStatus) WriteInteract

func (s ALStatus) WriteInteract(offs uint16) bool

type ALStatusControl

type ALStatusControl struct {
	Store uint16
}

func NewALStatusControl

func NewALStatusControl() *ALStatusControl

func (*ALStatusControl) ControlReg

func (sc *ALStatusControl) ControlReg() ALControl

func (*ALStatusControl) InError

func (a *ALStatusControl) InError() bool

func (*ALStatusControl) IsECATWritable

func (a *ALStatusControl) IsECATWritable() bool

func (*ALStatusControl) SetError

func (a *ALStatusControl) SetError(seterr bool)

func (*ALStatusControl) StatusReg

func (sc *ALStatusControl) StatusReg() ALStatus

type DevMapping

type DevMapping struct {
	StartAddr   uint16
	LengthField uint16
	DeviceField MMDevice
}

func (DevMapping) Device

func (d DevMapping) Device() MMDevice

func (DevMapping) Length

func (d DevMapping) Length() uint16

func (DevMapping) Start

func (d DevMapping) Start() uint16

type FrameProcessor

type FrameProcessor interface {
	ProcessFrame(*ecfr.Frame) *ecfr.Frame
}

type L2Bus

type L2Bus struct {
	Slaves []FrameProcessor
	// contains filtered or unexported fields
}

func (*L2Bus) Close

func (b *L2Bus) Close() error

func (*L2Bus) Cycle

func (b *L2Bus) Cycle() (iframes []*ecfr.Frame, err error)

func (*L2Bus) New

func (b *L2Bus) New(maxdatalen int) (fr *ecfr.Frame, err error)

type L2EEPROM

type L2EEPROM struct {
	Array [8 * 1024]uint16

	Addr        uint32
	DataScratch [8]byte // already in wire encoding

	PDIControl         bool
	WriteEnable        bool
	ChecksumError      bool
	EENotLoaded        bool
	MissingAcknowledge bool
	ErrorWriteEnable   bool
	Busy               bool
}

func NewL2EEPROM

func NewL2EEPROM() *L2EEPROM

func (*L2EEPROM) Reg

func (ee *L2EEPROM) Reg() *L2EEPROMRegisterSet

type L2EEPROMRegisterSet

type L2EEPROMRegisterSet struct{ *L2EEPROM }

func (L2EEPROMRegisterSet) Latch

func (ee L2EEPROMRegisterSet) Latch(shadow []byte, shadowWriteMask []bool)

func (*L2EEPROMRegisterSet) Read

func (ee *L2EEPROMRegisterSet) Read(offs uint16, dp *uint8) bool

func (*L2EEPROMRegisterSet) WriteInteract

func (ee *L2EEPROMRegisterSet) WriteInteract(offs uint16) bool

type L2Slave

type L2Slave struct {
	BackingMemory [1 << 16]byte

	ALStatusControl *ALStatusControl
	EEPROM          *L2EEPROM
	// contains filtered or unexported fields
}

func NewL2Slave

func NewL2Slave() *L2Slave

func (*L2Slave) ProcessFrame

func (s *L2Slave) ProcessFrame(infr *ecfr.Frame) (ofr *ecfr.Frame)

type MMDevice

type MMDevice interface {
	Read(offs uint16, dp *uint8) bool
	WriteInteract(offs uint16) bool
	Latch(shadow []byte, shadowWriteMask []bool)
}

type MMapping

type MMapping interface {
	Start() uint16
	Length() uint16
	Device() MMDevice
}

Jump to

Keyboard shortcuts

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