gpiote

package
v0.0.0-...-168ccc2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableIRQ

func DisableIRQ(mask te.EventMask)

func EnableIRQ

func EnableIRQ(mask te.EventMask)

func IRQEnabled

func IRQEnabled() te.EventMask

func NVIRQ

func NVIRQ() nvic.IRQ

Types

type Chan

type Chan int8

Chan represents GPIOTE channel. There are 4 channels (8 in nRF52) numbered from 0 to 3 (7 in nRF52).

func (Chan) CLR

func (c Chan) CLR() Task

CLR returns task for clear pin associated with channel c (nRF52).

func (Chan) Config

func (c Chan) Config() (gpio.Pin, Config)

Config returns current configuration of channel c.

func (Chan) IN

func (c Chan) IN() Event

IN returns event generated from pin associated with channel c.

func (Chan) OUT

func (c Chan) OUT() Task

OUT returns task for writing to pin associated with channel c.

func (Chan) SET

func (c Chan) SET() Task

SET returns task for set pin associated with channel c (nRF52).

func (Chan) Setup

func (c Chan) Setup(pin gpio.Pin, cfg Config)

Setup setups channel c to use pin and cfg configuration.

type Config

type Config uint32
const (
	ModeDiscon Config = 0 // Disconnect pin from GPIOTE module.
	ModeEvent  Config = 1 // Pin generates IN event.
	ModeTask   Config = 3 // Pin controlled by OUT, SET, CLR task.

	PolarityNone   Config = 0 << 16 // No task on pin, no event from pin.
	PolarityLoToHi Config = 1 << 16 // OUT sets pin, IN when rising edge.
	PolarityHiToLo Config = 2 << 16 // OUT clears pin, IN when falling edge.
	PolarityToggle Config = 3 << 16 // OUT toggles pin, IN when any change.

	OutInitLow  Config = 0       // Low initial output value.
	OutInitHigh Config = 1 << 20 // High initial output value.
)

type Event

type Event byte
const PORT Event = 31 // From multiple input pins with SENSE mechanism enabled.

func (Event) Event

func (e Event) Event() *te.Event

type Task

type Task byte

func (Task) Task

func (t Task) Task() *te.Task

Jump to

Keyboard shortcuts

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