mfd

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 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 added in v1.3.1

func DeInitDevice()

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

func InitDevice added in v1.3.1

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

InitDevice sets up the device for use

func UpdateDisplay added in v1.3.1

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 added in v1.1.1

func NewPage() Page

NewPage returns a new page

func (*Page) Add added in v1.1.1

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