xiaodisplay

package
v0.0.0-...-606fc2f Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bolt

func Bolt(display ssd1306.Device, x int16, y int16, c color.RGBA)

func Circle

func Circle(display ssd1306.Device, x0 int16, y0 int16, r int16, c color.RGBA)

func Clear

func Clear(display ssd1306.Device)

func DottedRect

func DottedRect(display ssd1306.Device, x1 int16, x2 int16, y1 int16, y2 int16, c color.RGBA)

func DrawChar

func DrawChar(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, char rune, color color.RGBA)

DrawChar sets a single rune in the buffer of the display.

func DrawCharRotated

func DrawCharRotated(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, char rune, color color.RGBA, rotation Rotation)

DrawCharRotated sets a single rune in the buffer of the display.

func FilledBolt

func FilledBolt(display ssd1306.Device, x int16, y int16, c color.RGBA)

func FilledCircle

func FilledCircle(display ssd1306.Device, x0 int16, y0 int16, r int16, c color.RGBA)

func FilledRect

func FilledRect(display ssd1306.Device, x1 int16, x2 int16, y1 int16, y2 int16, c color.RGBA)

func GetGlyph

func GetGlyph(font *tinyfont.Font, r rune) tinyfont.Glyph

GetGlyph returns the glyph corresponding to the specified rune in the font.

func Heading

func Heading(display ssd1306.Device, x int16, y int16, text string)

func HeadingRotate

func HeadingRotate(display ssd1306.Device, x int16, y int16, text string, rotation Rotation)

func Init

func Init() ssd1306.Device

func Line

func Line(display ssd1306.Device, start_x int32, end_x int32, start_y int32, end_y int32, color color.RGBA)

func LineWidth

func LineWidth(font *tinyfont.Font, str string) (innerWidth uint32, outboxWidth uint32)

LineWidth returns the inner and outbox widths corresponding to font and str.

func Rect

func Rect(display ssd1306.Device, x1 int16, x2 int16, y1 int16, y2 int16, c color.RGBA)

func Text

func Text(display ssd1306.Device, x int16, y int16, text string)

func TextRotate

func TextRotate(display ssd1306.Device, x int16, y int16, text string, rotation Rotation)

func WriteLine

func WriteLine(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, str string, c color.RGBA)

WriteLine writes a string in the selected font in the buffer.

func WriteLineColors

func WriteLineColors(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, str string, colors []color.RGBA)

WriteLineColors writes a string in the selected font in the buffer. Each char is in a different color if not enough colors are defined, colors are cycled.

func WriteLineColorsRotated

func WriteLineColorsRotated(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, str string, colors []color.RGBA, rotation Rotation)

WriteLineColorsRotated writes a string in the selected font in the buffer. Each char is in a different color if not enough colors are defined, colors are cycled.

func WriteLineRotated

func WriteLineRotated(display ssd1306.Device, font *tinyfont.Font, x int16, y int16, str string, c color.RGBA, rotation Rotation)

WriteLineRotated writes a string in the selected font in the buffer.

Types

type Font

type Font struct {
	Glyphs   []tinyfont.Glyph
	YAdvance uint8
}

type Rotation

type Rotation uint8
const (
	NO_ROTATION  Rotation = 0
	ROTATION_90  Rotation = 1 // 90 degrees clock-wise rotation
	ROTATION_180 Rotation = 2
	ROTATION_270 Rotation = 3

	LineFeed       = 0x0A
	CarriageReturn = 0x0D
)

Jump to

Keyboard shortcuts

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