devices

package module
v3.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

README

periph - Peripherals I/O in Go

Documentation is at https://periph.io

Join us for a chat on gophers.slack.com/messages/periph, get an invite here.

mascot

PkgGoDev codecov

Example

Blink a LED:

package main

import (
    "time"
    "periph.io/x/conn/v3/gpio"
    "periph.io/x/host/v3"
    "periph.io/x/host/v3/rpi"
)

func main() {
    host.Init()
    t := time.NewTicker(500 * time.Millisecond)
    for l := gpio.Low; ; l = !l {
        rpi.P1_33.Out(l)
        <-t.C
    }
}

Curious? Look at supported devices for more examples!

Authors

periph was initiated with ❤️️ and passion by Marc-Antoine Ruel. The full list of contributors is in AUTHORS and CONTRIBUTORS.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

This project is not affiliated with the Go project.

Documentation

Overview

Package devices is a container for device drivers.

Subpackages contain the concrete implementations. Devices accept port interface, constructors return concrete type.

Directories

Path Synopsis
Package ads1x15 controls ADS1015/ADS1115 Analog-Digital Converters (ADC) via I²C interface.
Package ads1x15 controls ADS1015/ADS1115 Analog-Digital Converters (ADC) via I²C interface.
Package apa102 drives a strip of APA102 LEDs connected on a SPI port.
Package apa102 drives a strip of APA102 LEDs connected on a SPI port.
Package as7262 controls an AMS 6 channel visible spectral sensor via an i2c interface.
Package as7262 controls an AMS 6 channel visible spectral sensor via an i2c interface.
Package bh1750 controls a ROHM BH1750 ambient light sensor, over an i2c bus.
Package bh1750 controls a ROHM BH1750 ambient light sensor, over an i2c bus.
Package bitbang implements conn by banging on the bits (GPIO pins).
Package bitbang implements conn by banging on the bits (GPIO pins).
Package bmxx80 controls a Bosch BMP180/BME280/BMP280 device over I²C, or SPI for the BMx280.
Package bmxx80 controls a Bosch BMP180/BME280/BMP280 device over I²C, or SPI for the BMx280.
bmx280smoketest
Package bmx280smoketest is leveraged by periph-smoketest to verify that two BME280/BMP280, one over I²C, one over SPI, read roughly the same temperature, humidity and pressure.
Package bmx280smoketest is leveraged by periph-smoketest to verify that two BME280/BMP280, one over I²C, one over SPI, read roughly the same temperature, humidity and pressure.
Package cap1xxx controls a Microchip cap1105/cap1106/cap1114/cap1133/cap1126/cap1128/cap1166/cap1188 device over I²C.
Package cap1xxx controls a Microchip cap1105/cap1106/cap1114/cap1133/cap1126/cap1128/cap1166/cap1188 device over I²C.
Package ccs811 controls CCS811 Volatile Organic Compounds sensor via I²C interface.
Package ccs811 controls CCS811 Volatile Organic Compounds sensor via I²C interface.
Package ds18b20 interfaces to Dallas Semi / Maxim DS18S20, DS18B20 and MAX31820 1-wire temperature sensors.
Package ds18b20 interfaces to Dallas Semi / Maxim DS18S20, DS18B20 and MAX31820 1-wire temperature sensors.
Package ds248x controls a Maxim DS2483 or DS2482-100 1-wire interface chip over I²C.
Package ds248x controls a Maxim DS2483 or DS2482-100 1-wire interface chip over I²C.
Package ep0099 controls a EP-0099 Raspberry Pi HAT with 4 relays via I2C.
Package ep0099 controls a EP-0099 Raspberry Pi HAT with 4 relays via I2C.
epd
Package epd controls Waveshare e-paper series displays.
Package epd controls Waveshare e-paper series displays.
image2bit
Package image2bit implements two bit gray scale (white, light gray, dark gray, black) 2D graphics.
Package image2bit implements two bit gray scale (white, light gray, dark gray, black) 2D graphics.
Package hd44780 controls the Hitachi LCD display chipset HD-44780
Package hd44780 controls the Hitachi LCD display chipset HD-44780
Package ht16k33 implements interfacing code to Holtek HT16K33 Alphanumeric 16x8 LED driver.
Package ht16k33 implements interfacing code to Holtek HT16K33 Alphanumeric 16x8 LED driver.
Package hx711 implements an interface to the 24-bits HX711 analog to digital converter.
Package hx711 implements an interface to the 24-bits HX711 analog to digital converter.
Package ina219 controls a Texas Instruments ina219 high side current, voltage and power monitor IC over an i2c bus.
Package ina219 controls a Texas Instruments ina219 high side current, voltage and power monitor IC over an i2c bus.
ina219smoketest
Package ina219smoketest tests the ina219 device.
Package ina219smoketest tests the ina219 device.
Package inky drives an Inky pHAT, pHAT v2 or wHAT E ink display.
Package inky drives an Inky pHAT, pHAT v2 or wHAT E ink display.
Package lepton drives a FLIR Lepton Infra Red (IR) camera.
Package lepton drives a FLIR Lepton Infra Red (IR) camera.
cci
Package cci declares the Camera Command Interface to interact with a FLIR Lepton over I²C.
Package cci declares the Camera Command Interface to interact with a FLIR Lepton over I²C.
image14bit
Package image14bit implements 14-bit per pixel images.
Package image14bit implements 14-bit per pixel images.
internal
Package internal contains code shared between cci and lepton.
Package internal contains code shared between cci and lepton.
Package lirc implements InfraRed receiver support through native linux app lirc.
Package lirc implements InfraRed receiver support through native linux app lirc.
Package mcp23xxx provides driver for the MCP23 family of IO extenders
Package mcp23xxx provides driver for the MCP23 family of IO extenders
Package mcp9808 controls a Microchip MCP9808 digital I²C temperature sensor.
Package mcp9808 controls a Microchip MCP9808 digital I²C temperature sensor.
mcp9808smoketest
Package mcp9808smoketest implements a smoke test for the mcp9808.
Package mcp9808smoketest implements a smoke test for the mcp9808.
Package mfrc522 controls a Mifare RFID card reader.
Package mfrc522 controls a Mifare RFID card reader.
commands
Package commands contains the command that a MFRC522 supports.
Package commands contains the command that a MFRC522 supports.
Package mpu9250 MPU-9250 is a 9-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP)
Package mpu9250 MPU-9250 is a 9-axis MotionTracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and a Digital Motion Processor™ (DMP)
accelerometer
Package accelerometer contains constants for the MPU9250.
Package accelerometer contains constants for the MPU9250.
reg
Package reg defines constants for the MPU9250.
Package reg defines constants for the MPU9250.
Package nrzled is a driver for LEDs ws2811/ws2812/ws2812b and compatible devices like sk6812 and ucs1903 that uses a single wire NRZ encoded communication protocol.
Package nrzled is a driver for LEDs ws2811/ws2812/ws2812b and compatible devices like sk6812 and ucs1903 that uses a single wire NRZ encoded communication protocol.
Package pca9548 is a driver for an 8 port I²C multiplexer that is available from multiple vendors.
Package pca9548 is a driver for an 8 port I²C multiplexer that is available from multiple vendors.
Package pca9685 includes utilities to controls pca9685 module and servo motors.
Package pca9685 includes utilities to controls pca9685 module and servo motors.
Package piblaster implements interfacing code is piblaster.
Package piblaster implements interfacing code is piblaster.
Package rainbowhat implements interfacing code to Pimoroni's Rainbow hat.
Package rainbowhat implements interfacing code to Pimoroni's Rainbow hat.
Package screen1d implements a 1D display.Drawer that outputs to terminal (stdout) using ANSI color codes.
Package screen1d implements a 1D display.Drawer that outputs to terminal (stdout) using ANSI color codes.
Package sn3218 controls a SN3218 LED driver with 18 LEDs over an i2c bus.
Package sn3218 controls a SN3218 LED driver with 18 LEDs over an i2c bus.
Package ssd1306 controls a 128x64 monochrome OLED display via a SSD1306 controller.
Package ssd1306 controls a 128x64 monochrome OLED display via a SSD1306 controller.
image1bit
Package image1bit implements black and white (1 bit per pixel) 2D graphics.
Package image1bit implements black and white (1 bit per pixel) 2D graphics.
ssd1306smoketest
Package ssd1306smoketest is leveraged by periph-smoketest to verify that two SSD1306, one over I²C, one over SPI, can display the same output.
Package ssd1306smoketest is leveraged by periph-smoketest to verify that two SSD1306, one over I²C, one over SPI, can display the same output.
Package st7567 implements an interface to the single-chip dot matrix LCD
Package st7567 implements an interface to the single-chip dot matrix LCD
Package tca95xx provides an interface to the Texas Instruments TCA95 series of 8-bit I²C extenders.
Package tca95xx provides an interface to the Texas Instruments TCA95 series of 8-bit I²C extenders.
Package tlv493d implements interfacing code to the Infineon TLV493D haff effect sensor.
Package tlv493d implements interfacing code to the Infineon TLV493D haff effect sensor.
Package tm1637 controls a TM1637 device over GPIO pins.
Package tm1637 controls a TM1637 device over GPIO pins.
Package unicornhd implements interfacing code to Pimoroni's Unicorn HD hat.
Package unicornhd implements interfacing code to Pimoroni's Unicorn HD hat.
Package videosink provides a display driver implementing an HTTP request handler.
Package videosink provides a display driver implementing an HTTP request handler.
Package waveshare2in13v2 controls Waveshare 2.13 v2 e-paper displays.
Package waveshare2in13v2 controls Waveshare 2.13 v2 e-paper displays.

Jump to

Keyboard shortcuts

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