spi

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPI_HARDWARE_ADDR = 0
	SPI_BUS           = 0
	SPI_CHIP          = 0
	SPI_DELAY         = 0
)

Defaults

View Source
const (
	DEFAULT_HARDWARE_ADDR = 0
	DEFAULT_BUS           = 0
	DEFAULT_CHIP          = 0
)

Defaults

View Source
const SPIDEV = "/dev/spidev"
View Source
const SPI_HELP_LINK = "http://piface.github.io/pifacecommon/installation.html#enable-the-spi-module"
View Source
const SPI_IOC_MAGIC = 107

Variables

This section is empty.

Functions

func SPI_IOC_MESSAGE

func SPI_IOC_MESSAGE(n uintptr) uintptr

Write custom SPI message

func SPI_IOC_RD_BITS_PER_WORD

func SPI_IOC_RD_BITS_PER_WORD() uintptr

Read SPI device word length (1..N)

func SPI_IOC_RD_LSB_FIRST

func SPI_IOC_RD_LSB_FIRST() uintptr

Read SPI bit justification

func SPI_IOC_RD_MAX_SPEED_HZ

func SPI_IOC_RD_MAX_SPEED_HZ() uintptr

Read SPI device default max speed hz

func SPI_IOC_RD_MODE

func SPI_IOC_RD_MODE() uintptr

Read of SPI mode (SPI_MODE_0..SPI_MODE_3)

func SPI_IOC_WR_BITS_PER_WORD

func SPI_IOC_WR_BITS_PER_WORD() uintptr

Write SPI device word length (1..N)

func SPI_IOC_WR_LSB_FIRST

func SPI_IOC_WR_LSB_FIRST() uintptr

Write SPI bit justification

func SPI_IOC_WR_MAX_SPEED_HZ

func SPI_IOC_WR_MAX_SPEED_HZ() uintptr

Write SPI device default max speed hz

func SPI_IOC_WR_MODE

func SPI_IOC_WR_MODE() uintptr

Write of SPI mode (SPI_MODE_0..SPI_MODE_3)

func SPI_MESSAGE_SIZE

func SPI_MESSAGE_SIZE(n uintptr) uintptr

Types

type SPIDevice

type SPIDevice struct {
	Bus  int // 0
	Chip int // 0
	// contains filtered or unexported fields
}

func NewSPIDevice

func NewSPIDevice(bus int, chipSelect int) *SPIDevice

An SPI Device at /dev/spi<bus>.<chip_select>.

func (*SPIDevice) Close

func (spi *SPIDevice) Close() error

Closes SPI device

func (*SPIDevice) Open

func (spi *SPIDevice) Open() error

Opens SPI device

func (*SPIDevice) Send

func (spi *SPIDevice) Send(bytes_to_send [3]byte) ([]byte, error)

Sends bytes over SPI channel and returns []byte response

func (*SPIDevice) SetBitsPerWord

func (spi *SPIDevice) SetBitsPerWord(bpw uint8) error

func (*SPIDevice) SetMode

func (spi *SPIDevice) SetMode(mode uint8) error

func (*SPIDevice) SetSpeed

func (spi *SPIDevice) SetSpeed(speed uint32) error

type SPI_IOC_TRANSFER

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

Jump to

Keyboard shortcuts

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