wire

package
Version: v0.0.0-...-f612f80 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

TwoWire - TWI/I2C library for Wiring deprecated

Index

Constants

View Source
const (
	I2C_RETRIES = 0x0701 /* number of times a device address should be polled when not acknowledging */
	I2C_TIMEOUT = 0x0702 /* set timeout in units of 10 ms */
	/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
	 * are NOT supported! (due to code brokenness)
	 */
	I2C_SLAVE       = 0x0703 /* Use this slave address */
	I2C_SLAVE_FORCE = 0x0706 /* Use this slave address, even if it is already in use by a driver! */
	I2C_TENBIT      = 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
	I2C_FUNCS       = 0x0705 /* Get the adapter functionality mask */
	I2C_RDWR        = 0x0707 /* Combined R/W transfer (one STOP only) */
	I2C_PEC         = 0x0708 /* != 0 to use PEC with SMBus */
	I2C_SMBUS       = 0x0720 /* SMBus transfer */
)
View Source
const I2CCLOCK_CHANGE = 0x0740

Variables

This section is empty.

Functions

This section is empty.

Types

type TwoWire

type TwoWire struct {
	I2CHandle int
	// contains filtered or unexported fields
}
var Wire *TwoWire

Preinstantiate Objects

func NewTwoWire

func NewTwoWire() *TwoWire

func (*TwoWire) Available

func (this *TwoWire) Available() int

must be called in: slave rx event callback or after RequestFrom(address, numBytes)

func (*TwoWire) Begin

func (this *TwoWire) Begin()

func (*TwoWire) BeginTransmission

func (this *TwoWire) BeginTransmission(address int)

func (*TwoWire) Close

func (this *TwoWire) Close()

func (*TwoWire) EndTransmission

func (this *TwoWire) EndTransmission() int

func (*TwoWire) Flush

func (this *TwoWire) Flush()

NOT IMPLEMENTED

func (*TwoWire) OnReceive

func (this *TwoWire) OnReceive(fn func())

NOT IMPLEMENTED sets function called on slave read

func (*TwoWire) OnRequest

func (this *TwoWire) OnRequest(fn func(arg int))

NOT IMPLEMENTED sets function called on slave write

func (*TwoWire) Peek

func (this *TwoWire) Peek() int

must be called in: slave rx event callback or after RequestFrom(address, numBytes)

func (*TwoWire) Read

func (this *TwoWire) Read() int

must be called in: slave rx event callback or after RequestFrom(address, numBytes)

func (*TwoWire) RequestFrom

func (this *TwoWire) RequestFrom(address, quantity int) int

func (*TwoWire) SetBusFreq

func (this *TwoWire) SetBusFreq(speed_hz uint)

bus freq range 10kHz-400kHz

func (*TwoWire) Write

func (this *TwoWire) Write(data []byte) int

must be called in: slave tx event callback or after BeginTransmission(address)

Source Files

Jump to

Keyboard shortcuts

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