pcal9535a

package
v0.0.0-...-51cfa91 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package pcal9535a adds support for the low volage GPIO expander as found in the Raspberry Pi Relay board by Seeed Studio.

Index

Constants

View Source
const (
	REG_MODE = 0x06
)

More details at - http://wiki.seeedstudio.com/wiki/Raspberry_Pi_Relay_Board_v1.0

Variables

This section is empty.

Functions

This section is empty.

Types

type PCAL9535A

type PCAL9535A struct {
	Bus  embd.I2CBus
	Addr byte
	D    byte
}

func New

func New(bus embd.I2CBus, addr byte) (*PCAL9535A, error)

New creates and connects to a PCAL9535A GPIO expander.

func (*PCAL9535A) GetPin

func (c *PCAL9535A) GetPin(pin uint) bool

Gets the state of supplied pin true = high or on, while false = low or off.

func (*PCAL9535A) SetPin

func (c *PCAL9535A) SetPin(pin uint, on bool) error

Sets the nominated GPIO pin to either high (on = true) or low (on = false)

Jump to

Keyboard shortcuts

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