serial

package
v0.0.0-...-65abd42 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package serial configures a serial port for use with Crystalfontz LCDs. Only implemented for linux.

Index

Constants

This section is empty.

Variables

View Source
var Output io.Writer

Output for tracing, not present in release builds. Enable by assigning a writer - a file, bytes.Buffer, stderr, etc.

View Source
var TraceEnter = false

If output is non-nil, tracing occurs as functions return. If TraceEnter is also true, functions will trace upon entry.

Functions

func Debug

func Debug(exit, enter bool)

If exit is true, sets Output to os.Stderr, nil if false; sets TraceEnter to value of in.

func Flush

func Flush(fd uintptr) error

func TcGetAttr

func TcGetAttr(fd uintptr) (*unix.Termios, error)

func TcSetAttr

func TcSetAttr(fd uintptr, opts *unix.Termios) error

Types

type Port

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

func Open

func Open(dev string) (*Port, error)

func (*Port) Close

func (p *Port) Close() error

func (*Port) Flush

func (p *Port) Flush() (err error)

func (*Port) Read

func (p *Port) Read(b []byte) (n int, err error)

func (*Port) TcGetAttr

func (p *Port) TcGetAttr() (*unix.Termios, error)

func (*Port) TcSetAttr

func (p *Port) TcSetAttr(opts *unix.Termios) error

func (*Port) Write

func (p *Port) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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