i2c

package module
v0.0.0-...-1235f17 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2013 License: BSD-2-Clause Imports: 5 Imported by: 10

README

Go code written by George McBay ([email protected]) under BSD License.  
Portions adapted from Adafruit's Raspberry-Pi Python Code Library.

---------------------------------------------------------------------------------------

Adafruit's Raspberry-Pi Python Code Library
============
  Here is a growing collection of libraries and example python scripts
  for controlling a variety of Adafruit electronics with a Raspberry Pi
  
  In progress!

  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried, Kevin Townsend and Mikey Sklar for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
  
  To download, we suggest logging into your Pi with Internet accessibility and typing:
  git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git

Documentation

Index

Constants

View Source
const (
	// as defined in /usr/include/linux/i2c-dev.h
	I2C_SLAVE = 0x0703
	I2C_SMBUS = 0x0720
	// as defined in /usr/include/linux/i2c.h
	I2C_SMBUS_WRITE          = 0
	I2C_SMBUS_READ           = 1
	I2C_SMBUS_I2C_BLOCK_DATA = 8
	I2C_SMBUS_BLOCK_MAX      = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type I2CBus

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

func Bus

func Bus(bus byte) (i2cbus *I2CBus, err error)

Returns an instance to an I2CBus. If we already have an I2CBus created for the requested bus number, just return that, otherwise set up a new one and open up its associated i2c-dev file

func (*I2CBus) ReadByteBlock

func (i2cbus *I2CBus) ReadByteBlock(addr, reg byte, readLength byte) (list []byte, err error)

func (*I2CBus) WriteByte

func (i2cbus *I2CBus) WriteByte(addr, reg, value byte) (err error)

func (*I2CBus) WriteByteBlock

func (i2cbus *I2CBus) WriteByteBlock(addr, reg byte, list []byte) (err error)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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