sharedi2c

package module
v0.0.0-...-6f46d3a Latest Latest
Warning

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

Go to latest
Published: May 22, 2015 License: MIT Imports: 3 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sharedi2c

embd-based i2c writer

provides a channel-based interface to an i2c bus for writing individual bytes, requires https://github.com/kidoman/embd

Example:

writer := sharedi2c.NewSharedWriter(port)
msg := sharedi2c.I2CMsg{Addr: addr, Value: data}
w.writer.SendMsg(msg)

As writers are created, they are either given a channel to an existing port, or a new channel is created if a port hasn't been used before.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I2CMsg

type I2CMsg struct {
	Addr  byte
	Value byte
	Info  string
}

type SharedWriter

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

func NewSharedWriter

func NewSharedWriter(busId byte) *SharedWriter

func (*SharedWriter) SendMsg

func (w *SharedWriter) SendMsg(m I2CMsg)

Jump to

Keyboard shortcuts

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