mfd

package
v1.2.3-beta Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HRESULT codes
	S_OK             = 0x00000000
	E_PAGENOTACTIVE  = 0xFF040001
	E_BUFFERTOOSMALL = 0xFF040000 | uintptr(syscall.ERROR_BUFFER_OVERFLOW)

	FLAG_SET_AS_ACTIVE = 0x00000001
)
View Source
const Filename = "mfd.json"

Filename is the name of the file written with MFD data

Variables

This section is empty.

Functions

func DeInitDevice

func DeInitDevice()

DeInitDevice unregisters the device driver interaction. Should be called before terminating the program

func InitDevice

func InitDevice(pages uint32, softButtonCallback func()) error

InitDevice sets up the device for use

func UpdateDisplay

func UpdateDisplay(display Display) error

UpdateDisplay updates the displayed text with a new set of pages.

func Write

func Write(mfd Display)

Write writes the MFD file

Types

type Display

type Display struct {
	Pages []Page `json:"pages"`
}

Display is the main display structure to write

func (Display) Copy

func (d Display) Copy() Display

Copy creates a deep copy of this Display

type Page

type Page struct {
	Lines []string `json:"lines"`
}

Page is a single page of information to show on the MFD

func NewPage

func NewPage() Page

NewPage returns a new page

func (*Page) Add

func (p *Page) Add(s string, args ...interface{})

Add appends a new (optionally formatted) string to the LineBuffer

func (Page) Copy

func (p Page) Copy() Page

Copy makes a deep copy of this Page

Jump to

Keyboard shortcuts

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