pdo

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPdoLength    uint8 = 8
	BufferCountRpdo uint8 = 2
	MinPdoNumber          = uint16(1)
	MaxPdoNumber          = uint16(512)
	MinRpdoNumber         = MinPdoNumber
	MaxRpdoNumber         = uint16(256)
	MinTpdoNumber         = MaxRpdoNumber + 1
	MaxTpdoNumber         = MaxPdoNumber
)
View Source
const (
	TransmissionTypeSyncAcyclic = 0    // synchronous (acyclic)
	TransmissionTypeSync1       = 1    // synchronous (cyclic every sync)
	TransmissionTypeSync240     = 0xF0 // synchronous (cyclic every 240-th sync)
	TransmissionTypeSyncEventLo = 0xFE // event-driven, lower value (manufacturer specific)
	TransmissionTypeSyncEventHi = 0xFF // event-driven, higher value (device profile and application profile specific)
)

Variables

This section is empty.

Functions

func ReadDummy

func ReadDummy(stream *od.Stream, data []byte, countRead *uint16) error

RPDOTPDO read method that fakes reading an OD variable

func WriteDummy

func WriteDummy(stream *od.Stream, data []byte, countWritten *uint16) error

RPDOTPDO write method that fakes writing an OD variable

Types

type PDOCommon

type PDOCommon struct {
	Valid bool

	IsRPDO bool
	// contains filtered or unexported fields
}

Common to TPDO & RPDO

func NewPDO

func NewPDO(
	odict *od.ObjectDictionary,
	entry *od.Entry,
	isRPDO bool,
	em *emergency.EMCY,
	erroneoursMap *uint32,
) (*PDOCommon, error)

Create and initialize a common PDO object

func (*PDOCommon) Type

func (base *PDOCommon) Type() string

type RPDO

type RPDO struct {
	*canopen.BusManager
	// contains filtered or unexported fields
}

func NewRPDO

func NewRPDO(
	bm *canopen.BusManager,
	odict *od.ObjectDictionary,
	emcy *emergency.EMCY,
	sync *sync.SYNC,
	entry14xx *od.Entry,
	entry16xx *od.Entry,
	predefinedIdent uint16,
) (*RPDO, error)

func (*RPDO) Handle

func (rpdo *RPDO) Handle(frame canopen.Frame)

Handle RPDO related RX CAN frames

func (*RPDO) Process

func (rpdo *RPDO) Process(timeDifferenceUs uint32, timerNext *uint32, nmtIsOperational bool, syncWas bool)

Process RPDO state machine and TX CAN frames This should be called periodically

type TPDO

type TPDO struct {
	*canopen.BusManager
	// contains filtered or unexported fields
}

func NewTPDO

func NewTPDO(
	bm *canopen.BusManager,
	odict *od.ObjectDictionary,
	emcy *emergency.EMCY,
	sync *sync.SYNC,
	entry18xx *od.Entry,
	entry1Axx *od.Entry,
	predefinedIdent uint16,

) (*TPDO, error)

Create a new TPDO

func (*TPDO) Process

func (tpdo *TPDO) Process(timeDifferenceUs uint32, timerNextUs *uint32, nmtIsOperational bool, syncWas bool) error

Process TPDO state machine and TX CAN frames This should be called periodically

Jump to

Keyboard shortcuts

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