From a9a07d646f88792a2ce3ed348cebe750f59c13f4 Mon Sep 17 00:00:00 2001 From: Doxygen CI Date: Thu, 3 Oct 2024 16:35:08 +0000 Subject: [PATCH] Deploy docs to GitHub Pages from commit 3e96bdd4c6 Commit: 3e96bdd4c6680210519f09f1834809eab41ca692 GitHub Actions run: 11165755438 --- html/_adafruit___crickit_8h_source.html | 2 +- html/_adafruit___neo_key__1x4_8h_source.html | 4 +- html/_adafruit___neo_trellis_8h_source.html | 4 +- .../_adafruit___t_f_t_shield18_8h_source.html | 2 +- .../_adafruit__mini_t_f_t_wing_8h_source.html | 2 +- html/_adafruit__seesaw_8h.html | 29 +------------- html/_adafruit__seesaw_8h_source.html | 40 +++++++++---------- html/functions.html | 8 ++-- html/functions_vars.html | 8 ++-- html/search/all_2.js | 2 +- html/search/variables_2.js | 2 +- html/seesaw__motor_8h_source.html | 2 +- html/seesaw__servo_8h_source.html | 2 +- html/seesaw__spectrum_8h_source.html | 2 +- ...ruit__seesaw_1_1sercom__inten-members.html | 2 +- ...ion_adafruit__seesaw_1_1sercom__inten.html | 14 +++---- html/unionkey_event-members.html | 2 +- html/unionkey_event.html | 20 +++++----- html/unionkey_event_raw-members.html | 2 +- html/unionkey_event_raw.html | 20 +++++----- html/unionkey_state-members.html | 2 +- html/unionkey_state.html | 20 +++++----- 22 files changed, 82 insertions(+), 109 deletions(-) diff --git a/html/_adafruit___crickit_8h_source.html b/html/_adafruit___crickit_8h_source.html index 85f88fa..a05331d 100644 --- a/html/_adafruit___crickit_8h_source.html +++ b/html/_adafruit___crickit_8h_source.html @@ -64,7 +64,7 @@
1 #ifndef _CRICKIT_TERSTER_H
2 #define _CRICKIT_TERSTER_H
3 
4 #include "Adafruit_seesaw.h"
5 
6 #define CRICKIT_SIGNAL1 2
7 #define CRICKIT_SIGNAL2 3
8 #define CRICKIT_SIGNAL3 40
9 #define CRICKIT_SIGNAL4 41
10 #define CRICKIT_SIGNAL5 11
11 #define CRICKIT_SIGNAL6 10
12 #define CRICKIT_SIGNAL7 9
13 #define CRICKIT_SIGNAL8 8
14 
15 #define CRICKIT_SERVO4 14
16 #define CRICKIT_SERVO3 15
17 #define CRICKIT_SERVO2 16
18 #define CRICKIT_SERVO1 17
19 
20 #define CRICKIT_MOTOR_A1 22
21 #define CRICKIT_MOTOR_A2 23
22 #define CRICKIT_MOTOR_B1 19
23 #define CRICKIT_MOTOR_B2 18
24 #define CRICKIT_DRIVE1 13
25 #define CRICKIT_DRIVE2 12
26 #define CRICKIT_DRIVE3 43
27 #define CRICKIT_DRIVE4 42
28 
29 #define CRICKIT_TOUCH1 0
30 #define CRICKIT_TOUCH2 1
31 #define CRICKIT_TOUCH3 2
32 #define CRICKIT_TOUCH4 3
33 
34 #define CRICKIT_DUTY_CYCLE_OFF 0
35 #define CRICKIT_DUTY_CYCLE_MAX 65535
36 
37 /**************************************************************************/
42 /**************************************************************************/
44 public:
45  Adafruit_Crickit(){};
46  ~Adafruit_Crickit(){};
47 
48  void analogWrite(uint8_t pin, uint16_t value, uint8_t width = 8);
49  uint16_t analogRead(uint8_t pin);
50  void setPWMFreq(uint8_t pin, uint16_t freq);
51 };
52 
53 #endif
void analogWrite(uint8_t pin, uint16_t value, uint8_t width=8)
write a PWM value to a PWM-enabled pin
Definition: Adafruit_Crickit.cpp:16
void setPWMFreq(uint8_t pin, uint16_t freq)
set the PWM frequency of a PWM-enabled pin. Note that on SAMD09, SAMD11 boards the frequency will be ...
Definition: Adafruit_Crickit.cpp:52
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
Class that stores state and functions for interacting with Crickit variant of seesaw helper IC...
Definition: Adafruit_Crickit.h:43
uint16_t analogRead(uint8_t pin)
read the analog value on an ADC-enabled pin.
Definition: Adafruit_Crickit.cpp:33
diff --git a/html/_adafruit___neo_key__1x4_8h_source.html b/html/_adafruit___neo_key__1x4_8h_source.html index fac46c2..77d2005 100644 --- a/html/_adafruit___neo_key__1x4_8h_source.html +++ b/html/_adafruit___neo_key__1x4_8h_source.html @@ -67,10 +67,10 @@
uint8_t last_buttons
The last reading for the buttons.
Definition: Adafruit_NeoKey_1x4.h:58
Class that stores state and functions for interacting with the seesaw NeoKey module.
Definition: Adafruit_NeoKey_1x4.h:40
uint8_t _cols
the number of trellis boards in the X direction
Definition: Adafruit_NeoKey_1x4.h:92
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
NeoKey1x4Callback(* _callbacks[NEOKEY_1X4_KEYS])(keyEvent)
the array of callback functions
Definition: Adafruit_NeoKey_1x4.h:60
void unregisterCallback(uint8_t key)
unregister a callback on a given key
Definition: Adafruit_NeoKey_1x4.cpp:67
-
Definition: Adafruit_seesaw.h:228
+
Definition: Adafruit_seesaw.h:212
Class that stores state and functions for interacting with multiple neotrellis boards.
Definition: Adafruit_NeoKey_1x4.h:70
Adafruit_NeoKey_1x4 * _neokeys
a multidimensional array of neokey objects
Definition: Adafruit_NeoKey_1x4.h:93
diff --git a/html/_adafruit___neo_trellis_8h_source.html b/html/_adafruit___neo_trellis_8h_source.html index 6dc831b..4899882 100644 --- a/html/_adafruit___neo_trellis_8h_source.html +++ b/html/_adafruit___neo_trellis_8h_source.html @@ -67,13 +67,13 @@
uint8_t _rows
the number of trellis boards in the Y direction
Definition: Adafruit_NeoTrellis.h:89
Class that stores state and functions for interacting with multiple neotrellis boards.
Definition: Adafruit_NeoTrellis.h:66
void unregisterCallback(uint8_t key)
unregister a callback on a given key
Definition: Adafruit_NeoTrellis.cpp:62
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
Class that stores state and functions for interacting with the seesaw keypad module.
Definition: Adafruit_NeoTrellis.h:34
uint8_t _addr
the I2C address of this board
Definition: Adafruit_NeoTrellis.h:55
uint8_t _cols
the number of trellis boards in the X direction
Definition: Adafruit_NeoTrellis.h:90
void activateKey(uint8_t key, uint8_t edge, bool enable=true)
activate or deactivate a given key event
Definition: Adafruit_NeoTrellis.cpp:74
void read(bool polling=true)
read all events currently stored in the seesaw fifo and call any callbacks.
Definition: Adafruit_NeoTrellis.cpp:86
-
Definition: Adafruit_seesaw.h:228
+
Definition: Adafruit_seesaw.h:212
Adafruit_NeoTrellis * _trelli
a multidimensional array of neotrellis objects
Definition: Adafruit_NeoTrellis.h:92
TrellisCallback(* _callbacks[NEO_TRELLIS_NUM_KEYS])(keyEvent)
the array of callback functions
Definition: Adafruit_NeoTrellis.h:56
diff --git a/html/_adafruit___t_f_t_shield18_8h_source.html b/html/_adafruit___t_f_t_shield18_8h_source.html index 63a4ebb..cc5cfd2 100644 --- a/html/_adafruit___t_f_t_shield18_8h_source.html +++ b/html/_adafruit___t_f_t_shield18_8h_source.html @@ -65,7 +65,7 @@
1 #ifndef _TFT_SHIELD_18_H
2 #define _TFT_SHIELD_18_H
3 
4 #include "Adafruit_seesaw.h"
5 
6 #define TFTSHIELD_ADDR 0x2E
7 #define TFTSHIELD_RESET_PIN 3
8 
9 #define TFTSHIELD_BACKLIGHT_ON 0xFFFF
10 #define TFTSHIELD_BACKLIGHT_OFF 0x0000
11 
12 #define TFTSHIELD_BUTTON_UP_PIN 5
13 #define TFTSHIELD_BUTTON_UP (1UL << TFTSHIELD_BUTTON_UP_PIN)
14 
15 #define TFTSHIELD_BUTTON_DOWN_PIN 8
16 #define TFTSHIELD_BUTTON_DOWN (1UL << TFTSHIELD_BUTTON_DOWN_PIN)
17 
18 #define TFTSHIELD_BUTTON_LEFT_PIN 6
19 #define TFTSHIELD_BUTTON_LEFT (1UL << TFTSHIELD_BUTTON_LEFT_PIN)
20 
21 #define TFTSHIELD_BUTTON_RIGHT_PIN 9
22 #define TFTSHIELD_BUTTON_RIGHT (1UL << TFTSHIELD_BUTTON_RIGHT_PIN)
23 
24 #define TFTSHIELD_BUTTON_IN_PIN 7
25 #define TFTSHIELD_BUTTON_IN (1UL << TFTSHIELD_BUTTON_IN_PIN)
26 
27 #define TFTSHIELD_BUTTON_1_PIN 10
28 #define TFTSHIELD_BUTTON_1 (1UL << TFTSHIELD_BUTTON_1_PIN)
29 
30 #define TFTSHIELD_BUTTON_2_PIN 11
31 #define TFTSHIELD_BUTTON_2 (1UL << TFTSHIELD_BUTTON_2_PIN)
32 
33 #define TFTSHIELD_BUTTON_3_PIN 14
34 #define TFTSHIELD_BUTTON_3 (1UL << TFTSHIELD_BUTTON_3_PIN)
35 
36 #define TFTSHIELD_BUTTON_ALL \
37  (TFTSHIELD_BUTTON_UP | TFTSHIELD_BUTTON_DOWN | TFTSHIELD_BUTTON_LEFT | \
38  TFTSHIELD_BUTTON_RIGHT | TFTSHIELD_BUTTON_IN | TFTSHIELD_BUTTON_1 | \
39  TFTSHIELD_BUTTON_2 | TFTSHIELD_BUTTON_3)
40 
41 /**************************************************************************/
46 /**************************************************************************/
48 public:
51 
52  bool begin(uint8_t addr = TFTSHIELD_ADDR, int8_t flow = -1);
53 
54  void setBacklight(uint16_t value);
55  void setBacklightFreq(uint16_t freq);
56  void tftReset(bool rst = true);
57  uint32_t readButtons();
58 };
59 
60 #endif
uint32_t readButtons()
read all buttons on the wing and return as a 32 bit integer
Definition: Adafruit_TFTShield18.cpp:63
void tftReset(bool rst=true)
reset the TFT screen by setting the value of the reset pin
Definition: Adafruit_TFTShield18.cpp:53
void setBacklight(uint16_t value)
set the intensity of the backlight
Definition: Adafruit_TFTShield18.cpp:31
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
Class that stores state and functions for interacting with 1.8" tft shield variant of seesaw helper I...
Definition: Adafruit_TFTShield18.h:47
bool begin(uint8_t addr=TFTSHIELD_ADDR, int8_t flow=-1)
set up the TFT shield
Definition: Adafruit_TFTShield18.cpp:11
diff --git a/html/_adafruit__mini_t_f_t_wing_8h_source.html b/html/_adafruit__mini_t_f_t_wing_8h_source.html index 2cf3ca3..488644f 100644 --- a/html/_adafruit__mini_t_f_t_wing_8h_source.html +++ b/html/_adafruit__mini_t_f_t_wing_8h_source.html @@ -63,7 +63,7 @@
1 #pragma once
2 
3 #ifndef _MINI_TFT_WING_H
4 #define _MINI_TFT_WING_H
5 
6 #include "Adafruit_seesaw.h"
7 
8 #define TFTWING_ADDR 0x5E
9 
10 #define TFTWING_BACKLIGHT_ON 0 // inverted output!
11 #define TFTWING_BACKLIGHT_OFF 0xFFFF // inverted output!
12 
13 extern uint32_t TFTWING_BUTTON_UP, TFTWING_BUTTON_DOWN, TFTWING_BUTTON_LEFT,
14  TFTWING_BUTTON_RIGHT, TFTWING_BUTTON_A, TFTWING_BUTTON_B,
15  TFTWING_BUTTON_SELECT;
16 
17 /**************************************************************************/
22 /**************************************************************************/
24 public:
27 
28  bool begin(uint8_t addr = TFTWING_ADDR, TwoWire *Wi = NULL);
29 
30  void setBacklight(uint16_t value);
31  void setBacklightFreq(uint16_t freq);
32  void tftReset(bool rst = true);
33  uint32_t readButtons();
34 };
35 
36 #endif
void setBacklight(uint16_t value)
set the value of the backlight
Definition: Adafruit_miniTFTWing.cpp:92
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
bool begin(uint8_t addr=TFTWING_ADDR, TwoWire *Wi=NULL)
set up the miniTFTWing
Definition: Adafruit_miniTFTWing.cpp:41
Class that stores state and functions for interacting with mini tft wing variant of seesaw helper IC...
Definition: Adafruit_miniTFTWing.h:23
diff --git a/html/_adafruit__seesaw_8h.html b/html/_adafruit__seesaw_8h.html index f360c0b..942a5fb 100644 --- a/html/_adafruit__seesaw_8h.html +++ b/html/_adafruit__seesaw_8h.html @@ -175,8 +175,7 @@ SEESAW_KEYPAD_BASE = 0x10,
  SEESAW_ENCODER_BASE = 0x11, -SEESAW_SPECTRUM_BASE = 0x12, -SEESAW_SOIL_BASE = 0x13 +SEESAW_SPECTRUM_BASE = 0x12
}   @@ -284,17 +283,6 @@
}   -enum  {
-  SEESAW_SOIL_STATUS = 0x00, -SEESAW_SOIL_RATE = 0x01, -SEESAW_SOIL_VALUE = 0x10, -SEESAW_SOIL_SAMPLES = 0x20, -
-  SEESAW_SOIL_XDELAY = 0x30, -SEESAW_SOIL_TIMEOUT = 0x40 -
- } - 

Detailed Description

This is part of Adafruit's seesaw driver for the Arduino platform. It is designed specifically to work with the Adafruit products that use seesaw technology.

@@ -499,21 +487,6 @@

Audio spectrum module function address registers

-

-
- -

◆ anonymous enum

- -
-
- - - - -
anonymous enum
-
-

soil moisture module function address registers

-
diff --git a/html/_adafruit__seesaw_8h_source.html b/html/_adafruit__seesaw_8h_source.html index e1a6855..473bf40 100644 --- a/html/_adafruit__seesaw_8h_source.html +++ b/html/_adafruit__seesaw_8h_source.html @@ -62,27 +62,27 @@
Adafruit_seesaw.h
-Go to the documentation of this file.
1 
21 #ifndef LIB_SEESAW_H
22 #define LIB_SEESAW_H
23 
24 #include "Adafruit_I2CDevice.h"
25 #include <Arduino.h>
26 #include <Wire.h>
27 
28 /*=========================================================================
29  I2C ADDRESS/BITS
30  -----------------------------------------------------------------------*/
31 #define SEESAW_ADDRESS (0x49)
32 /*=========================================================================*/
33 
34 /*=========================================================================
35  REGISTERS
36  -----------------------------------------------------------------------*/
37 
41 enum {
42  SEESAW_STATUS_BASE = 0x00,
43  SEESAW_GPIO_BASE = 0x01,
44  SEESAW_SERCOM0_BASE = 0x02,
45 
46  SEESAW_TIMER_BASE = 0x08,
47  SEESAW_ADC_BASE = 0x09,
48  SEESAW_DAC_BASE = 0x0A,
49  SEESAW_INTERRUPT_BASE = 0x0B,
50  SEESAW_DAP_BASE = 0x0C,
51  SEESAW_EEPROM_BASE = 0x0D,
52  SEESAW_NEOPIXEL_BASE = 0x0E,
53  SEESAW_TOUCH_BASE = 0x0F,
54  SEESAW_KEYPAD_BASE = 0x10,
55  SEESAW_ENCODER_BASE = 0x11,
56  SEESAW_SPECTRUM_BASE = 0x12,
57  SEESAW_SOIL_BASE = 0x13,
58 };
59 
62 enum {
63  SEESAW_GPIO_DIRSET_BULK = 0x02,
64  SEESAW_GPIO_DIRCLR_BULK = 0x03,
65  SEESAW_GPIO_BULK = 0x04,
66  SEESAW_GPIO_BULK_SET = 0x05,
67  SEESAW_GPIO_BULK_CLR = 0x06,
68  SEESAW_GPIO_BULK_TOGGLE = 0x07,
69  SEESAW_GPIO_INTENSET = 0x08,
70  SEESAW_GPIO_INTENCLR = 0x09,
71  SEESAW_GPIO_INTFLAG = 0x0A,
72  SEESAW_GPIO_PULLENSET = 0x0B,
73  SEESAW_GPIO_PULLENCLR = 0x0C,
74 };
75 
78 enum {
79  SEESAW_STATUS_HW_ID = 0x01,
80  SEESAW_STATUS_VERSION = 0x02,
81  SEESAW_STATUS_OPTIONS = 0x03,
82  SEESAW_STATUS_TEMP = 0x04,
83  SEESAW_STATUS_SWRST = 0x7F,
84 };
85 
88 enum {
89  SEESAW_TIMER_STATUS = 0x00,
90  SEESAW_TIMER_PWM = 0x01,
91  SEESAW_TIMER_FREQ = 0x02,
92 };
93 
96 enum {
97  SEESAW_ADC_STATUS = 0x00,
98  SEESAW_ADC_INTEN = 0x02,
99  SEESAW_ADC_INTENCLR = 0x03,
100  SEESAW_ADC_WINMODE = 0x04,
101  SEESAW_ADC_WINTHRESH = 0x05,
102  SEESAW_ADC_CHANNEL_OFFSET = 0x07,
103 };
104 
107 enum {
108  SEESAW_SERCOM_STATUS = 0x00,
109  SEESAW_SERCOM_INTEN = 0x02,
110  SEESAW_SERCOM_INTENCLR = 0x03,
111  SEESAW_SERCOM_BAUD = 0x04,
112  SEESAW_SERCOM_DATA = 0x05,
113 };
114 
117 enum {
118  SEESAW_NEOPIXEL_STATUS = 0x00,
119  SEESAW_NEOPIXEL_PIN = 0x01,
120  SEESAW_NEOPIXEL_SPEED = 0x02,
121  SEESAW_NEOPIXEL_BUF_LENGTH = 0x03,
122  SEESAW_NEOPIXEL_BUF = 0x04,
123  SEESAW_NEOPIXEL_SHOW = 0x05,
124 };
125 
128 enum {
129  SEESAW_TOUCH_CHANNEL_OFFSET = 0x10,
130 };
131 
134 enum {
135  SEESAW_KEYPAD_STATUS = 0x00,
136  SEESAW_KEYPAD_EVENT = 0x01,
137  SEESAW_KEYPAD_INTENSET = 0x02,
138  SEESAW_KEYPAD_INTENCLR = 0x03,
139  SEESAW_KEYPAD_COUNT = 0x04,
140  SEESAW_KEYPAD_FIFO = 0x10,
141 };
142 
145 enum {
146  SEESAW_KEYPAD_EDGE_HIGH = 0,
147  SEESAW_KEYPAD_EDGE_LOW,
148  SEESAW_KEYPAD_EDGE_FALLING,
149  SEESAW_KEYPAD_EDGE_RISING,
150 };
151 
154 enum {
155  SEESAW_ENCODER_STATUS = 0x00,
156  SEESAW_ENCODER_INTENSET = 0x10,
157  SEESAW_ENCODER_INTENCLR = 0x20,
158  SEESAW_ENCODER_POSITION = 0x30,
159  SEESAW_ENCODER_DELTA = 0x40,
160 };
161 
164 enum {
165  SEESAW_SPECTRUM_RESULTS_LOWER = 0x00, // Audio spectrum bins 0-31
166  SEESAW_SPECTRUM_RESULTS_UPPER = 0x01, // Audio spectrum bins 32-63
167  // If some future device supports a larger spectrum, can add additional
168  // "bins" working upward from here. Configurable setting registers then
169  // work downward from the top to avoid collision between spectrum bins
170  // and configurables.
171  SEESAW_SPECTRUM_CHANNEL = 0xFD,
172  SEESAW_SPECTRUM_RATE = 0xFE,
173  SEESAW_SPECTRUM_STATUS = 0xFF,
174 };
175 
178 enum {
179  // 0x00..0x0F Global Settings
180  SEESAW_SOIL_STATUS = 0x00,
181  SEESAW_SOIL_RATE = 0x01,
182  // 0x10..0xF0 Sensor Settings
183  // lower four bits = sensor number
184  // upper four bits = setting type
185  SEESAW_SOIL_VALUE = 0x10,
186  SEESAW_SOIL_SAMPLES = 0x20,
187  SEESAW_SOIL_XDELAY = 0x30,
188  SEESAW_SOIL_TIMEOUT = 0x40,
189 };
190 
191 #define ADC_INPUT_0_PIN 2
192 #define ADC_INPUT_1_PIN 3
193 #define ADC_INPUT_2_PIN 4
194 #define ADC_INPUT_3_PIN 5
195 
196 #define PWM_0_PIN 4
197 #define PWM_1_PIN 5
198 #define PWM_2_PIN 6
199 #define PWM_3_PIN 7
200 
201 #ifndef INPUT_PULLDOWN
202 #define INPUT_PULLDOWN \
203  0x03
204 #endif
206 
207 /*=========================================================================*/
208 // clang-format off
209 #define SEESAW_HW_ID_CODE_SAMD09 0x55
210 #define SEESAW_HW_ID_CODE_TINY806 0x84
211 #define SEESAW_HW_ID_CODE_TINY807 0x85
212 #define SEESAW_HW_ID_CODE_TINY816 0x86
213 #define SEESAW_HW_ID_CODE_TINY817 0x87
214 #define SEESAW_HW_ID_CODE_TINY1616 0x88
215 #define SEESAW_HW_ID_CODE_TINY1617 0x89
216 // clang-format on
217 
219 union keyEventRaw {
220  struct {
221  uint8_t EDGE : 2;
222  uint8_t NUM : 6;
223  } bit;
224  uint8_t reg;
225 };
226 
228 union keyEvent {
229  struct {
230  uint8_t EDGE : 2;
231  uint16_t NUM : 14;
232  } bit;
233  uint16_t reg;
234 };
235 
237 union keyState {
238  struct {
239  uint8_t STATE : 1;
240  uint8_t ACTIVE : 4;
241  } bit;
242  uint8_t reg;
243 };
244 
245 /**************************************************************************/
250 /**************************************************************************/
251 class Adafruit_seesaw : public Print {
252 public:
253  // constructors
254  Adafruit_seesaw(TwoWire *Wi = NULL);
255  ~Adafruit_seesaw(void){};
256 
257  bool begin(uint8_t addr = SEESAW_ADDRESS, int8_t flow = -1,
258  bool reset = true);
259  uint32_t getOptions();
260  uint32_t getVersion();
261  bool getProdDatecode(uint16_t *pid, uint8_t *year, uint8_t *mon,
262  uint8_t *day);
263 
264  bool SWReset();
265 
266  void pinMode(uint8_t pin, uint8_t mode);
267  void pinModeBulk(uint32_t pins, uint8_t mode);
268  void pinModeBulk(uint32_t pinsa, uint32_t pinsb, uint8_t mode);
269  virtual void analogWrite(uint8_t pin, uint16_t value, uint8_t width = 8);
270  void digitalWrite(uint8_t pin, uint8_t value);
271  void digitalWriteBulk(uint32_t port_values);
272  void digitalWriteBulk(uint32_t pins, uint8_t value);
273  void digitalWriteBulk(uint32_t pinsa, uint32_t pinsb, uint8_t value);
274 
275  bool digitalRead(uint8_t pin);
276  uint32_t digitalReadBulk(uint32_t pins);
277  uint32_t digitalReadBulkB(uint32_t pins);
278 
279  void setGPIOInterrupts(uint32_t pins, bool enabled);
280 
281  virtual uint16_t analogRead(uint8_t pin);
282 
283  uint16_t touchRead(uint8_t pin);
284 
285  virtual void setPWMFreq(uint8_t pin, uint16_t freq);
286 
287  void enableSercomDataRdyInterrupt(uint8_t sercom = 0);
288  void disableSercomDataRdyInterrupt(uint8_t sercom = 0);
289 
290  char readSercomData(uint8_t sercom = 0);
291 
292  void EEPROMWrite8(uint8_t addr, uint8_t val);
293  void EEPROMWrite(uint8_t addr, uint8_t *buf, uint8_t size);
294  uint8_t EEPROMRead8(uint8_t addr);
295 
296  void setI2CAddr(uint8_t addr);
297  uint8_t getI2CAddr();
298 
299  void UARTSetBaud(uint32_t baud);
300 
301  void setKeypadEvent(uint8_t key, uint8_t edge, bool enable = true);
302  void enableKeypadInterrupt();
303  void disableKeypadInterrupt();
304  uint8_t getKeypadCount();
305  bool readKeypad(keyEventRaw *buf, uint8_t count);
306 
307  float getTemp();
308 
309  int32_t getEncoderPosition(uint8_t encoder = 0);
310  int32_t getEncoderDelta(uint8_t encoder = 0);
311  bool enableEncoderInterrupt(uint8_t encoder = 0);
312  bool disableEncoderInterrupt(uint8_t encoder = 0);
313  void setEncoderPosition(int32_t pos, uint8_t encoder = 0);
314 
315  virtual size_t write(uint8_t);
316  virtual size_t write(const char *str);
317 
318 protected:
319  TwoWire *_i2cbus;
320  Adafruit_I2CDevice *_i2c_dev = NULL;
321 
322  int8_t _flow;
324  uint8_t _hardwaretype = 0;
325  uint8_t getI2CaddrEEPROMloc();
326 
327  bool write8(byte regHigh, byte regLow, byte value);
328  uint8_t read8(byte regHigh, byte regLow, uint16_t delay = 250);
329 
330  bool read(uint8_t regHigh, uint8_t regLow, uint8_t *buf, uint8_t num,
331  uint16_t delay = 250);
332  bool write(uint8_t regHigh, uint8_t regLow, uint8_t *buf, uint8_t num);
333 
334  /*=========================================================================
335  REGISTER BITFIELDS
336  -----------------------------------------------------------------------*/
337 
340  union sercom_inten {
341  struct {
342  uint8_t DATA_RDY : 1;
343  } bit;
344  uint8_t reg;
345  };
347 
348  /*=========================================================================*/
349 };
350 
351 #endif
Definition: Adafruit_seesaw.h:237
-
struct keyEventRaw::@13 bit
bitfield format
-
uint8_t DATA_RDY
this bit is set when data becomes available
Definition: Adafruit_seesaw.h:342
-
int8_t _flow
Definition: Adafruit_seesaw.h:322
-
Definition: Adafruit_seesaw.h:340
-
uint8_t NUM
the event number
Definition: Adafruit_seesaw.h:222
-
uint8_t reg
register format
Definition: Adafruit_seesaw.h:224
-
uint8_t ACTIVE
the registered events for that key
Definition: Adafruit_seesaw.h:240
-
uint8_t STATE
the current state of the key
Definition: Adafruit_seesaw.h:239
-
uint16_t NUM
the event number
Definition: Adafruit_seesaw.h:231
-
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:251
-
uint16_t reg
register format
Definition: Adafruit_seesaw.h:233
-
uint8_t EDGE
the edge that was triggered
Definition: Adafruit_seesaw.h:221
-
uint8_t reg
full register
Definition: Adafruit_seesaw.h:344
+Go to the documentation of this file.
1 
21 #ifndef LIB_SEESAW_H
22 #define LIB_SEESAW_H
23 
24 #include "Adafruit_I2CDevice.h"
25 #include <Arduino.h>
26 #include <Wire.h>
27 
28 /*=========================================================================
29  I2C ADDRESS/BITS
30  -----------------------------------------------------------------------*/
31 #define SEESAW_ADDRESS (0x49)
32 /*=========================================================================*/
33 
34 /*=========================================================================
35  REGISTERS
36  -----------------------------------------------------------------------*/
37 
41 enum {
42  SEESAW_STATUS_BASE = 0x00,
43  SEESAW_GPIO_BASE = 0x01,
44  SEESAW_SERCOM0_BASE = 0x02,
45 
46  SEESAW_TIMER_BASE = 0x08,
47  SEESAW_ADC_BASE = 0x09,
48  SEESAW_DAC_BASE = 0x0A,
49  SEESAW_INTERRUPT_BASE = 0x0B,
50  SEESAW_DAP_BASE = 0x0C,
51  SEESAW_EEPROM_BASE = 0x0D,
52  SEESAW_NEOPIXEL_BASE = 0x0E,
53  SEESAW_TOUCH_BASE = 0x0F,
54  SEESAW_KEYPAD_BASE = 0x10,
55  SEESAW_ENCODER_BASE = 0x11,
56  SEESAW_SPECTRUM_BASE = 0x12,
57 };
58 
61 enum {
62  SEESAW_GPIO_DIRSET_BULK = 0x02,
63  SEESAW_GPIO_DIRCLR_BULK = 0x03,
64  SEESAW_GPIO_BULK = 0x04,
65  SEESAW_GPIO_BULK_SET = 0x05,
66  SEESAW_GPIO_BULK_CLR = 0x06,
67  SEESAW_GPIO_BULK_TOGGLE = 0x07,
68  SEESAW_GPIO_INTENSET = 0x08,
69  SEESAW_GPIO_INTENCLR = 0x09,
70  SEESAW_GPIO_INTFLAG = 0x0A,
71  SEESAW_GPIO_PULLENSET = 0x0B,
72  SEESAW_GPIO_PULLENCLR = 0x0C,
73 };
74 
77 enum {
78  SEESAW_STATUS_HW_ID = 0x01,
79  SEESAW_STATUS_VERSION = 0x02,
80  SEESAW_STATUS_OPTIONS = 0x03,
81  SEESAW_STATUS_TEMP = 0x04,
82  SEESAW_STATUS_SWRST = 0x7F,
83 };
84 
87 enum {
88  SEESAW_TIMER_STATUS = 0x00,
89  SEESAW_TIMER_PWM = 0x01,
90  SEESAW_TIMER_FREQ = 0x02,
91 };
92 
95 enum {
96  SEESAW_ADC_STATUS = 0x00,
97  SEESAW_ADC_INTEN = 0x02,
98  SEESAW_ADC_INTENCLR = 0x03,
99  SEESAW_ADC_WINMODE = 0x04,
100  SEESAW_ADC_WINTHRESH = 0x05,
101  SEESAW_ADC_CHANNEL_OFFSET = 0x07,
102 };
103 
106 enum {
107  SEESAW_SERCOM_STATUS = 0x00,
108  SEESAW_SERCOM_INTEN = 0x02,
109  SEESAW_SERCOM_INTENCLR = 0x03,
110  SEESAW_SERCOM_BAUD = 0x04,
111  SEESAW_SERCOM_DATA = 0x05,
112 };
113 
116 enum {
117  SEESAW_NEOPIXEL_STATUS = 0x00,
118  SEESAW_NEOPIXEL_PIN = 0x01,
119  SEESAW_NEOPIXEL_SPEED = 0x02,
120  SEESAW_NEOPIXEL_BUF_LENGTH = 0x03,
121  SEESAW_NEOPIXEL_BUF = 0x04,
122  SEESAW_NEOPIXEL_SHOW = 0x05,
123 };
124 
127 enum {
128  SEESAW_TOUCH_CHANNEL_OFFSET = 0x10,
129 };
130 
133 enum {
134  SEESAW_KEYPAD_STATUS = 0x00,
135  SEESAW_KEYPAD_EVENT = 0x01,
136  SEESAW_KEYPAD_INTENSET = 0x02,
137  SEESAW_KEYPAD_INTENCLR = 0x03,
138  SEESAW_KEYPAD_COUNT = 0x04,
139  SEESAW_KEYPAD_FIFO = 0x10,
140 };
141 
144 enum {
145  SEESAW_KEYPAD_EDGE_HIGH = 0,
146  SEESAW_KEYPAD_EDGE_LOW,
147  SEESAW_KEYPAD_EDGE_FALLING,
148  SEESAW_KEYPAD_EDGE_RISING,
149 };
150 
153 enum {
154  SEESAW_ENCODER_STATUS = 0x00,
155  SEESAW_ENCODER_INTENSET = 0x10,
156  SEESAW_ENCODER_INTENCLR = 0x20,
157  SEESAW_ENCODER_POSITION = 0x30,
158  SEESAW_ENCODER_DELTA = 0x40,
159 };
160 
163 enum {
164  SEESAW_SPECTRUM_RESULTS_LOWER = 0x00, // Audio spectrum bins 0-31
165  SEESAW_SPECTRUM_RESULTS_UPPER = 0x01, // Audio spectrum bins 32-63
166  // If some future device supports a larger spectrum, can add additional
167  // "bins" working upward from here. Configurable setting registers then
168  // work downward from the top to avoid collision between spectrum bins
169  // and configurables.
170  SEESAW_SPECTRUM_CHANNEL = 0xFD,
171  SEESAW_SPECTRUM_RATE = 0xFE,
172  SEESAW_SPECTRUM_STATUS = 0xFF,
173 };
174 
175 #define ADC_INPUT_0_PIN 2
176 #define ADC_INPUT_1_PIN 3
177 #define ADC_INPUT_2_PIN 4
178 #define ADC_INPUT_3_PIN 5
179 
180 #define PWM_0_PIN 4
181 #define PWM_1_PIN 5
182 #define PWM_2_PIN 6
183 #define PWM_3_PIN 7
184 
185 #ifndef INPUT_PULLDOWN
186 #define INPUT_PULLDOWN \
187  0x03
188 #endif
190 
191 /*=========================================================================*/
192 // clang-format off
193 #define SEESAW_HW_ID_CODE_SAMD09 0x55
194 #define SEESAW_HW_ID_CODE_TINY806 0x84
195 #define SEESAW_HW_ID_CODE_TINY807 0x85
196 #define SEESAW_HW_ID_CODE_TINY816 0x86
197 #define SEESAW_HW_ID_CODE_TINY817 0x87
198 #define SEESAW_HW_ID_CODE_TINY1616 0x88
199 #define SEESAW_HW_ID_CODE_TINY1617 0x89
200 // clang-format on
201 
203 union keyEventRaw {
204  struct {
205  uint8_t EDGE : 2;
206  uint8_t NUM : 6;
207  } bit;
208  uint8_t reg;
209 };
210 
212 union keyEvent {
213  struct {
214  uint8_t EDGE : 2;
215  uint16_t NUM : 14;
216  } bit;
217  uint16_t reg;
218 };
219 
221 union keyState {
222  struct {
223  uint8_t STATE : 1;
224  uint8_t ACTIVE : 4;
225  } bit;
226  uint8_t reg;
227 };
228 
229 /**************************************************************************/
234 /**************************************************************************/
235 class Adafruit_seesaw : public Print {
236 public:
237  // constructors
238  Adafruit_seesaw(TwoWire *Wi = NULL);
239  ~Adafruit_seesaw(void){};
240 
241  bool begin(uint8_t addr = SEESAW_ADDRESS, int8_t flow = -1,
242  bool reset = true);
243  uint32_t getOptions();
244  uint32_t getVersion();
245  bool getProdDatecode(uint16_t *pid, uint8_t *year, uint8_t *mon,
246  uint8_t *day);
247 
248  bool SWReset();
249 
250  void pinMode(uint8_t pin, uint8_t mode);
251  void pinModeBulk(uint32_t pins, uint8_t mode);
252  void pinModeBulk(uint32_t pinsa, uint32_t pinsb, uint8_t mode);
253  virtual void analogWrite(uint8_t pin, uint16_t value, uint8_t width = 8);
254  void digitalWrite(uint8_t pin, uint8_t value);
255  void digitalWriteBulk(uint32_t port_values);
256  void digitalWriteBulk(uint32_t pins, uint8_t value);
257  void digitalWriteBulk(uint32_t pinsa, uint32_t pinsb, uint8_t value);
258 
259  bool digitalRead(uint8_t pin);
260  uint32_t digitalReadBulk(uint32_t pins);
261  uint32_t digitalReadBulkB(uint32_t pins);
262 
263  void setGPIOInterrupts(uint32_t pins, bool enabled);
264 
265  virtual uint16_t analogRead(uint8_t pin);
266 
267  uint16_t touchRead(uint8_t pin);
268 
269  virtual void setPWMFreq(uint8_t pin, uint16_t freq);
270 
271  void enableSercomDataRdyInterrupt(uint8_t sercom = 0);
272  void disableSercomDataRdyInterrupt(uint8_t sercom = 0);
273 
274  char readSercomData(uint8_t sercom = 0);
275 
276  void EEPROMWrite8(uint8_t addr, uint8_t val);
277  void EEPROMWrite(uint8_t addr, uint8_t *buf, uint8_t size);
278  uint8_t EEPROMRead8(uint8_t addr);
279 
280  void setI2CAddr(uint8_t addr);
281  uint8_t getI2CAddr();
282 
283  void UARTSetBaud(uint32_t baud);
284 
285  void setKeypadEvent(uint8_t key, uint8_t edge, bool enable = true);
286  void enableKeypadInterrupt();
287  void disableKeypadInterrupt();
288  uint8_t getKeypadCount();
289  bool readKeypad(keyEventRaw *buf, uint8_t count);
290 
291  float getTemp();
292 
293  int32_t getEncoderPosition(uint8_t encoder = 0);
294  int32_t getEncoderDelta(uint8_t encoder = 0);
295  bool enableEncoderInterrupt(uint8_t encoder = 0);
296  bool disableEncoderInterrupt(uint8_t encoder = 0);
297  void setEncoderPosition(int32_t pos, uint8_t encoder = 0);
298 
299  virtual size_t write(uint8_t);
300  virtual size_t write(const char *str);
301 
302 protected:
303  TwoWire *_i2cbus;
304  Adafruit_I2CDevice *_i2c_dev = NULL;
305 
306  int8_t _flow;
308  uint8_t _hardwaretype = 0;
309  uint8_t getI2CaddrEEPROMloc();
310 
311  bool write8(byte regHigh, byte regLow, byte value);
312  uint8_t read8(byte regHigh, byte regLow, uint16_t delay = 250);
313 
314  bool read(uint8_t regHigh, uint8_t regLow, uint8_t *buf, uint8_t num,
315  uint16_t delay = 250);
316  bool write(uint8_t regHigh, uint8_t regLow, uint8_t *buf, uint8_t num);
317 
318  /*=========================================================================
319  REGISTER BITFIELDS
320  -----------------------------------------------------------------------*/
321 
324  union sercom_inten {
325  struct {
326  uint8_t DATA_RDY : 1;
327  } bit;
328  uint8_t reg;
329  };
331 
332  /*=========================================================================*/
333 };
334 
335 #endif
Definition: Adafruit_seesaw.h:221
+
uint8_t DATA_RDY
this bit is set when data becomes available
Definition: Adafruit_seesaw.h:326
+
int8_t _flow
Definition: Adafruit_seesaw.h:306
+
Definition: Adafruit_seesaw.h:324
+
struct keyEventRaw::@12 bit
bitfield format
+
uint8_t NUM
the event number
Definition: Adafruit_seesaw.h:206
+
uint8_t reg
register format
Definition: Adafruit_seesaw.h:208
+
uint8_t ACTIVE
the registered events for that key
Definition: Adafruit_seesaw.h:224
+
uint8_t STATE
the current state of the key
Definition: Adafruit_seesaw.h:223
+
uint16_t NUM
the event number
Definition: Adafruit_seesaw.h:215
+
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
+
uint16_t reg
register format
Definition: Adafruit_seesaw.h:217
+
uint8_t EDGE
the edge that was triggered
Definition: Adafruit_seesaw.h:205
+
uint8_t reg
full register
Definition: Adafruit_seesaw.h:328
#define SEESAW_ADDRESS
Default Seesaw I2C address.
Definition: Adafruit_seesaw.h:31
-
TwoWire * _i2cbus
Definition: Adafruit_seesaw.h:319
-
Definition: Adafruit_seesaw.h:228
-
uint8_t EDGE
the edge that was triggered
Definition: Adafruit_seesaw.h:230
-
Definition: Adafruit_seesaw.h:219
-
uint8_t reg
register format
Definition: Adafruit_seesaw.h:242
-
sercom_inten _sercom_inten
sercom interrupt enable register instance
Definition: Adafruit_seesaw.h:346
+
TwoWire * _i2cbus
Definition: Adafruit_seesaw.h:303
+
Definition: Adafruit_seesaw.h:212
+
uint8_t EDGE
the edge that was triggered
Definition: Adafruit_seesaw.h:214
+
Definition: Adafruit_seesaw.h:203
+
uint8_t reg
register format
Definition: Adafruit_seesaw.h:226
+
sercom_inten _sercom_inten
sercom interrupt enable register instance
Definition: Adafruit_seesaw.h:330