serial

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 4 Imported by: 3

README

serial

Wrapper for periph's serial communication for Raspberry Pi.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I2C

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

I2C defines an I2C type to read and write from/to registers.

func NewI2C

func NewI2C(bus string, addr uint16) (*I2C, error)

NewI2C returns a new I2C interface at the specified bus and address. If `bus` is set to "", the first available bus is used. The address must always be specified.

func (*I2C) Close added in v0.1.1

func (i *I2C) Close()

Close closes the bus used by I2C.

func (*I2C) Read

func (i *I2C) Read(reg byte) (byte, error)

Read reads a single byte from a register.

func (*I2C) ReadBytes

func (i *I2C) ReadBytes(reg byte, n int) ([]byte, error)

ReadBytes reads n bytes from a register.

func (*I2C) Write

func (i *I2C) Write(reg byte, data ...byte) error

Write writes a byte or bytes to a register.

Jump to

Keyboard shortcuts

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