ttp229

package
v0.0.0-...-0087ba1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ttp229 is for the 16 keys or 8 keys touch pad detector IC Datasheet (BSF version): https://www.sunrom.com/download/SUNROM-TTP229-BSF_V1.1_EN.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buser

type Buser interface {
	// contains filtered or unexported methods
}

Buser interface since there are different versions with different protocols

type Configuration

type Configuration struct {
	Inputs byte
}

Configuration

type Device

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

Device wraps a connection to a TTP229 device.

func NewPin

func NewPin(scl, sdo machine.Pin) Device

NewPin creates a new TTP229 connection through 2 machine.Pin, this is suitable for the BSF variant of the TTP229.

func (*Device) Configure

func (d *Device) Configure(cfg Configuration) bool

Configure sets up the device for communication

func (*Device) GetKey

func (d *Device) GetKey() int8

GetKey returns the current pressed key (only returns one key, even in multitouch mode)

func (*Device) IsKeyDown

func (d *Device) IsKeyDown(key byte) bool

IsKeyDown returns true if the given key was just pressed (and it wasn't previously)

func (*Device) IsKeyPressed

func (d *Device) IsKeyPressed(key byte) bool

IsKeyPressed returns true if the given key is pressed

func (*Device) IsKeyUp

func (d *Device) IsKeyUp(key byte) bool

IsKeyUp returns true if the given key was released

func (*Device) ReadKeys

func (d *Device) ReadKeys() uint16

ReadKeys returns the pressed keys as bits of a uint16

type PinBus

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

PinBus holds the structure for GPIO protocol

Jump to

Keyboard shortcuts

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