mk3

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BYTES_LENGTH_BUTTON_REPORT uint32 = 14

Number of bytes to serialize struct ButtonReport

View Source
const BYTES_LENGTH_COLORED_LIGHT uint32 = 1

Number of bytes to serialize struct ColoredLight

View Source
const BYTES_LENGTH_LIGHT_STATE uint32 = 91

Number of bytes to serialize struct LightState

View Source
const BYTES_LENGTH_PAD_REPORT uint32 = 64

Number of bytes to serialize struct PadReport

View Source
const BYTES_LENGTH_SCREEN_STATE uint32 = 265

Number of bytes to serialize struct ScreenState

Variables

This section is empty.

Functions

This section is empty.

Types

type ButtonReport

type ButtonReport struct {
	Magic          byte   `json:"magic"`           // 8bit
	PressedButtons uint64 `json:"pressed_buttons"` // 40bit
	EncoderTouched bool   `json:"encoder_touched"` // 1bit
	Reserved1      uint8  `json:"reserved1"`       // 7bit
	EncoderValue   uint8  `json:"encoder_value"`   // 4bit
	Reserved2      uint8  `json:"reserved2"`       // 4bit
	StripTime      uint16 `json:"strip_time"`      // 16bit
	StripValue1    uint8  `json:"strip_value1"`    // 8bit
	Reserved3      byte   `json:"reserved3"`       // 8bit
	StripValue2    uint8  `json:"strip_value2"`    // 8bit
	Reserved4      byte   `json:"reserved4"`       // 8bit
}

func (*ButtonReport) BpGetAccessor

func (m *ButtonReport) BpGetAccessor(di *bp.DataIndexer) bp.Accessor

func (*ButtonReport) BpGetByte

func (m *ButtonReport) BpGetByte(di *bp.DataIndexer, rshift int) byte

func (*ButtonReport) BpProcessInt

func (m *ButtonReport) BpProcessInt(di *bp.DataIndexer)

func (*ButtonReport) BpProcessor

func (m *ButtonReport) BpProcessor() bp.Processor

func (*ButtonReport) BpSetByte

func (m *ButtonReport) BpSetByte(di *bp.DataIndexer, lshift int, b byte)

func (*ButtonReport) Decode

func (m *ButtonReport) Decode(s []byte)

func (*ButtonReport) Encode

func (m *ButtonReport) Encode() []byte

Encode struct ButtonReport to bytes buffer.

func (*ButtonReport) Size

func (m *ButtonReport) Size() uint32

func (*ButtonReport) String

func (m *ButtonReport) String() string

Returns string representation for struct ButtonReport.

type ColoredLight

type ColoredLight struct {
	Intensity uint8 `json:"intensity"` // 2bit
	Color     uint8 `json:"color"`     // 6bit
}

func (*ColoredLight) BpGetAccessor

func (m *ColoredLight) BpGetAccessor(di *bp.DataIndexer) bp.Accessor

func (*ColoredLight) BpGetByte

func (m *ColoredLight) BpGetByte(di *bp.DataIndexer, rshift int) byte

func (*ColoredLight) BpProcessInt

func (m *ColoredLight) BpProcessInt(di *bp.DataIndexer)

func (*ColoredLight) BpProcessor

func (m *ColoredLight) BpProcessor() bp.Processor

func (*ColoredLight) BpSetByte

func (m *ColoredLight) BpSetByte(di *bp.DataIndexer, lshift int, b byte)

func (*ColoredLight) Decode

func (m *ColoredLight) Decode(s []byte)

func (*ColoredLight) Encode

func (m *ColoredLight) Encode() []byte

Encode struct ColoredLight to bytes buffer.

func (*ColoredLight) Size

func (m *ColoredLight) Size() uint32

func (*ColoredLight) String

func (m *ColoredLight) String() string

Returns string representation for struct ColoredLight.

type LightState

type LightState struct {
	Magic   byte             `json:"magic"`   // 8bit
	Buttons [39]ColoredLight `json:"buttons"` // 312bit
	Pads    [16]ColoredLight `json:"pads"`    // 128bit
	Strip   [35]ColoredLight `json:"strip"`   // 280bit
}

func (*LightState) BpGetAccessor

func (m *LightState) BpGetAccessor(di *bp.DataIndexer) bp.Accessor

func (*LightState) BpGetByte

func (m *LightState) BpGetByte(di *bp.DataIndexer, rshift int) byte

func (*LightState) BpProcessInt

func (m *LightState) BpProcessInt(di *bp.DataIndexer)

func (*LightState) BpProcessor

func (m *LightState) BpProcessor() bp.Processor

func (*LightState) BpSetByte

func (m *LightState) BpSetByte(di *bp.DataIndexer, lshift int, b byte)

func (*LightState) Decode

func (m *LightState) Decode(s []byte)

func (*LightState) Encode

func (m *LightState) Encode() []byte

Encode struct LightState to bytes buffer.

func (*LightState) Size

func (m *LightState) Size() uint32

func (*LightState) String

func (m *LightState) String() string

Returns string representation for struct LightState.

type PadReport

type PadReport struct {
	Magic    byte     `json:"magic"`    // 8bit
	Pad      uint8    `json:"pad"`      // 8bit
	Action   uint8    `json:"action"`   // 4bit
	Velocity uint16   `json:"velocity"` // 12bit
	Reserved [60]byte `json:"reserved"` // 480bit
}

func (*PadReport) BpGetAccessor

func (m *PadReport) BpGetAccessor(di *bp.DataIndexer) bp.Accessor

func (*PadReport) BpGetByte

func (m *PadReport) BpGetByte(di *bp.DataIndexer, rshift int) byte

func (*PadReport) BpProcessInt

func (m *PadReport) BpProcessInt(di *bp.DataIndexer)

func (*PadReport) BpProcessor

func (m *PadReport) BpProcessor() bp.Processor

func (*PadReport) BpSetByte

func (m *PadReport) BpSetByte(di *bp.DataIndexer, lshift int, b byte)

func (*PadReport) Decode

func (m *PadReport) Decode(s []byte)

func (*PadReport) Encode

func (m *PadReport) Encode() []byte

Encode struct PadReport to bytes buffer.

func (*PadReport) Size

func (m *PadReport) Size() uint32

func (*PadReport) String

func (m *PadReport) String() string

Returns string representation for struct PadReport.

type ScreenState

type ScreenState struct {
	Magic1        [3]byte   `json:"magic1"`         // 24bit
	ScreenPortion byte      `json:"screen_portion"` // 8bit
	Magic2        [5]byte   `json:"magic2"`         // 40bit
	Pixels        [256]byte `json:"pixels"`         // 2048bit
}

func (*ScreenState) BpGetAccessor

func (m *ScreenState) BpGetAccessor(di *bp.DataIndexer) bp.Accessor

func (*ScreenState) BpGetByte

func (m *ScreenState) BpGetByte(di *bp.DataIndexer, rshift int) byte

func (*ScreenState) BpProcessInt

func (m *ScreenState) BpProcessInt(di *bp.DataIndexer)

func (*ScreenState) BpProcessor

func (m *ScreenState) BpProcessor() bp.Processor

func (*ScreenState) BpSetByte

func (m *ScreenState) BpSetByte(di *bp.DataIndexer, lshift int, b byte)

func (*ScreenState) Decode

func (m *ScreenState) Decode(s []byte)

func (*ScreenState) Encode

func (m *ScreenState) Encode() []byte

Encode struct ScreenState to bytes buffer.

func (*ScreenState) Size

func (m *ScreenState) Size() uint32

func (*ScreenState) String

func (m *ScreenState) String() string

Returns string representation for struct ScreenState.

Jump to

Keyboard shortcuts

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