msp

package
v0.0.2-break-up-packages Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MspAPIVersion = 1
	MspFCVariant  = 2
	MspFCVersion  = 3
	MspBoardInfo  = 4
	MspBuildInfo  = 5

	MspFeature    = 36
	MspSetFeature = 37

	MspCFSerialConfig    = 54
	MspSetCFSerialConfig = 55

	MspRXMap = 64

	MspReboot = 68

	MspPID = 112

	MspSetRawRC = 200

	MspSetPID = 202

	MspEepromWrite = 250

	MspDebugMsg = 253
)
View Source
const (
	SerialFunctionMSP        = 1 << 0
	SerialFunctionDebugTrace = 1 << 15
)
View Source
const (
	MspFCFeatureDebugTrace = 1 << 31
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MSP

type MSP struct {
	// contains filtered or unexported fields
}

func NewMSP

func NewMSP(portName string, baudRate int) (*MSP, error)

func (*MSP) Close

func (m *MSP) Close() error

Close closes the underlying serial port. Note that reading from or writing to a closed MSP will cause a panic.

func (*MSP) ReadFrame

func (m *MSP) ReadFrame() (*MSPFrame, error)

func (*MSP) RebootIntoBootloader

func (m *MSP) RebootIntoBootloader() (int, error)

RebootIntoBootloader reboots the board into bootloader mode

func (*MSP) WriteCmd

func (m *MSP) WriteCmd(cmd uint16, args ...interface{}) (int, error)

type MSPError

type MSPError interface {
	error
	IsMSPError() bool
}

type MSPFrame

type MSPFrame struct {
	Code    uint16
	Payload []byte
	// contains filtered or unexported fields
}

func (*MSPFrame) Byte

func (f *MSPFrame) Byte(idx int) byte

func (*MSPFrame) BytesRemaining

func (f *MSPFrame) BytesRemaining() int

func (*MSPFrame) Read

func (f *MSPFrame) Read(out interface{}) error

Reads out from the frame Payload and advances the payload position pointer by the size of the variable pointed by out.

type MSPSerialConfig

type MSPSerialConfig struct {
	Identifier              uint8
	FunctionMask            uint16
	MSPBaudRateIndex        uint8
	GPSBaudRateIndex        uint8
	TelemetryBaudRateIndex  uint8
	PeripheralBaudRateIndex uint8 // Actually blackboxBaudRateIndex in BF
}

Jump to

Keyboard shortcuts

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