g25

package
v0.0.0-...-9eb3501 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: MPL-2.0 Imports: 4 Imported by: 0

README

godoc

Aria G25

Package g25 implements drivers for the GPIO of the Aria G25 produced by Acme Systems.

Sample usage:

package main

import (
	"log"
	"time"

	"github.com/advancedclimatesystems/io/gpio/acme/g25"
	"github.com/advancedclimatesystems/io/gpio"
)

func main() {
	outPin, _ := g25.NewPin("N16")
	_ = outPin.SetDirection(gpio.OutDirection)

	inPin, _ := g25.NewPin("N20")
	_ = inPin.SetDirection(gpio.InDirection)
	_ = inPin.SetEdge(gpio.RisingEdge, func(p *gpio.Pin) {
		log.Printf("wow")
	})

	for i := 0; i < 4; i++ {
		_ = outPin.SetHigh()
		time.Sleep(1000 * time.Millisecond)
		_ = outPin.SetLow()
		time.Sleep(1000 * time.Millisecond)
	}
}

Documentation

Overview

Package g25 contains GPIO drivers for the Acme Systems Aria G25

The Aria G25 contains up to 60 GPIO pins. This package implements all GPIO operations such as getting/setting the value, setting the direction and changing the active low. The package provides a mapping between the pinnumber, the atmel ID and the kernel ID. https://www.acmesystems.it/aria

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPin

func NewPin(id string) (gpio.GPIO, error)

NewPin creates a new pin with a kernel ID based on the pin name found here: https://www.acmesystems.it/aria. It assumes the kernel has version 3.1x if this is not the case, use the NewPinV26 instead.

Example
outPin, _ := NewPin("N16")
_ = outPin.SetDirection(gpio.OutDirection)

inPin, _ := NewPin("N20")
_ = inPin.SetDirection(gpio.InDirection)
_ = inPin.SetEdge(gpio.RisingEdge, func(p *gpio.Pin) {
	log.Printf("wow")
})

for i := 0; i < 4; i++ {
	_ = outPin.SetHigh()
	time.Sleep(1000 * time.Millisecond)
	_ = outPin.SetLow()
	time.Sleep(1000 * time.Millisecond)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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