Class daisy::NeoTrellis¶
ClassList > daisy > NeoTrellis
Device support for the Adafruit Neotrellis device. More...
#include <neotrellis.h>
Classes¶
Type | Name |
---|---|
struct | Config |
Public Types¶
Type | Name |
---|---|
enum | KeypadEdge |
enum | KeypadFuncAddRegs |
enum | ModuleBaseAddress |
enum | Result |
enum | StatusFuncAddRegs |
typedef void(* | TrellisCallback |
union | keyEvent |
union | keyEventRaw |
union | keyState |
Public Attributes¶
Type | Name |
---|---|
NeoPixelI2C | pixels |
Public Functions¶
Type | Name |
---|---|
void | ActivateKey (uint8_t x, uint8_t y, uint8_t edge, bool enable) |
void | EnableKeypadInterrupt () |
bool | GetFalling (uint8_t idx) |
uint8_t | GetKeypadCount () |
bool | GetRising (uint8_t idx) |
bool | GetState (uint8_t idx) |
Result | GetTransportError () |
Result | Init (Config config) |
NeoTrellis () |
|
void | Process (bool polling=true) |
uint8_t | Read8 (uint8_t reg_high, uint8_t reg_low, int delay) |
void | ReadKeypad (keyEventRaw * buf, uint8_t count) |
void | ReadLen (uint8_t reg_high, uint8_t reg_low, uint8_t * buff, uint8_t len, int delay) |
void | RegisterCallback (uint8_t x, uint8_t y, TrellisCallback(*)(keyEvent) cb) |
void | SWReset () |
void | SetKeypadEvent (uint8_t key, uint8_t edge, bool enable) |
void | UnregisterCallback (uint8_t x, uint8_t y) |
void | Write8 (uint8_t reg_high, uint8_t reg_low, uint8_t value) |
~NeoTrellis () |
Detailed Description¶
Author:
beserge
Date:
December 2021
Public Types Documentation¶
enum KeypadEdge¶
keypad module edge definitions
enum KeypadFuncAddRegs¶
enum daisy::NeoTrellis::KeypadFuncAddRegs {
SEESAW_KEYPAD_STATUS = 0x00,
SEESAW_KEYPAD_EVENT = 0x01,
SEESAW_KEYPAD_INTENSET = 0x02,
SEESAW_KEYPAD_INTENCLR = 0x03,
SEESAW_KEYPAD_COUNT = 0x04,
SEESAW_KEYPAD_FIFO = 0x10
};
keypad module function address registers
enum ModuleBaseAddress¶
enum daisy::NeoTrellis::ModuleBaseAddress {
SEESAW_STATUS_BASE = 0x00,
SEESAW_GPIO_BASE = 0x01,
SEESAW_SERCOM0_BASE = 0x02,
SEESAW_TIMER_BASE = 0x08,
SEESAW_ADC_BASE = 0x09,
SEESAW_DAC_BASE = 0x0A,
SEESAW_INTERRUPT_BASE = 0x0B,
SEESAW_DAP_BASE = 0x0C,
SEESAW_EEPROM_BASE = 0x0D,
SEESAW_NEOPIXEL_BASE = 0x0E,
SEESAW_TOUCH_BASE = 0x0F,
SEESAW_KEYPAD_BASE = 0x10,
SEESAW_ENCODER_BASE = 0x11,
SEESAW_SPECTRUM_BASE = 0x12
};
Module Base Addreses The module base addresses for different seesaw modules.
enum Result¶
enum StatusFuncAddRegs¶
enum daisy::NeoTrellis::StatusFuncAddRegs {
SEESAW_STATUS_HW_ID = 0x01,
SEESAW_STATUS_VERSION = 0x02,
SEESAW_STATUS_OPTIONS = 0x03,
SEESAW_STATUS_TEMP = 0x04,
SEESAW_STATUS_SWRST = 0x7F
};
status module function address registers
typedef TrellisCallback¶
union keyEvent¶
extended key event stucture for keypad module
union keyEventRaw¶
union keyState¶
key state struct that will be written to seesaw chip keypad module
Public Attributes Documentation¶
variable pixels¶
Public Functions Documentation¶
function ActivateKey¶
activate or deactivate a given key event
Parameters:
key
the key number to map the event toedge
the edge sensitivity of the eventenable
pass true to enable the passed event, false to disable it.
function EnableKeypadInterrupt¶
Enable the keypad interrupt that fires when events are in the fifo.
function GetFalling¶
Has this key just been released? (aka falling edge) Updated via the Process() function.
Parameters:
idx
Key to check
Returns:
True if just released, false otherwise
function GetKeypadCount¶
Get the number of events currently in the fifo
Returns:
the number of events in the fifo
function GetRising¶
Has this key just been pressed? (aka rising edge) Updated via the Process() function.
Parameters:
idx
Key to check
Returns:
True if just pressed, false otherwise
function GetState¶
Is this key currently pressed or released? Updated via the Process() function.
Parameters:
idx
Key to check
Returns:
True if pressed, false otherwise
function GetTransportError¶
Get and reset the transport error flag
Returns:
Whether the transport has errored since the last check
function Init¶
Initialize the NeoTrellis device
Parameters:
config
Configuration settings
function NeoTrellis¶
function Process¶
read all events currently stored in the seesaw fifo and call any callbacks.
Parameters:
polling
pass true if the interrupt pin is not being used, false if it is. Defaults to true.
function Read8¶
Reads an 8 bit value
Parameters:
reg
the register address to read from
Returns:
the data uint8_t read from the device
function ReadKeypad¶
function ReadLen¶
inline void daisy::NeoTrellis::ReadLen (
uint8_t reg_high,
uint8_t reg_low,
uint8_t * buff,
uint8_t len,
int delay
)
function RegisterCallback¶
inline void daisy::NeoTrellis::RegisterCallback (
uint8_t x,
uint8_t y,
TrellisCallback(*)( keyEvent ) cb
)
register a callback for a key addressed by key index.
Parameters:
x
the column index of the key. column 0 is on the lefthand side of the matix.y
the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards.cb
the function to be called when an event from the specified key is detected.
function SWReset¶
Perform a software reset. This resets all seesaw registers to their default values. This is called automatically from Init().
function SetKeypadEvent¶
activate or deactivate a key and edge on the keypad module
Parameters:
key
the key number to activateedge
the edge to trigger onenable
passing true will enable the passed event, passing false will disable it.
function UnregisterCallback¶
Unregister a callback for a key addressed by key index.
Parameters:
x
the column index of the key. column 0 is on the lefthand side of the matix.y
the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards.
function Write8¶
Writes an 8 bit value
Parameters:
reg
the register address to write tovalue
the value to write to the register
function ~NeoTrellis¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/neotrellis.h