gpio

package
v0.0.0-...-f33cfb8 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package gpio implements helpers for GPIO configuration on NXP SoCs.

This package is only meant to be used with `GOOS=tamago GOARCH=arm` as supported by the TamaGo framework for bare metal Go on ARM SoCs, see https://github.com/usbarmory/tamago.

Index

Constants

View Source
const (
	GPIO_DR   = 0x00
	GPIO_GDIR = 0x04
)

GPIO registers

Variables

This section is empty.

Functions

This section is empty.

Types

type GPIO

type GPIO struct {
	// Controller index
	Index int
	// Base register
	Base uint32
	// Clock gate register
	CCGR uint32
	// Clock gate
	CG int
	// contains filtered or unexported fields
}

GPIO controller instance

func (*GPIO) Init

func (hw *GPIO) Init(num int) (gpio *Pin, err error)

Init initializes a GPIO.

type Pin

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

Pin instance

func (*Pin) High

func (gpio *Pin) High()

High configures a GPIO signal as high.

func (*Pin) In

func (gpio *Pin) In()

In configures a GPIO as input.

func (*Pin) Low

func (gpio *Pin) Low()

Low configures a GPIO signal as low.

func (*Pin) Out

func (gpio *Pin) Out()

Out configures a GPIO as output.

func (*Pin) Value

func (gpio *Pin) Value() (high bool)

Value returns the GPIO signal level.

Jump to

Keyboard shortcuts

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