libPocuter 1.0 Support library for programming the Pocuter

Pocuter.h
Go to the documentation of this file.
1 #ifndef POCUTER_H
2 #define POCUTER_H
3
4 /*
5 * Pocuter Lib
6 *
7 * Copyright (C) 2022 Pocuter GmbH All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy of
10 * this software and associated documentation files (the "Software"), to deal in
11 * the Software without restriction, including without limitation the rights to
12 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13 * the Software, and to permit persons to whom the Software is furnished to do so,
14 * subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in all
17 * copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
28
29 #include "include/PocuterLibConfig.h"
30
31 #include <stdint.h>
32 #include "include/hal/RGBled.h"
33 #include "include/hal/PocuterDisplay.h"
34 #include "include/ugui/UGUI.h"
35 #include "include/hal/PocuterButtons.h"
36 #include "include/hal/PocuterHMAC.h"
37 #include "include/hal/PocuterSDCard.h"
38 #include "include/hal/PocuterConfig.h"
39 #include "include/hal/PocuterOTA.h"
40
41 #ifndef POCUTER_DISABLE_WIFI
42 #include "include/hal/PocuterWIFI.h"
43 #endif
44 #include "include/hal/PocuterI2C.h"
45 #include "include/hal/PocuterAccelerometer.h"
46 #include "include/hal/PocuterLightSensor.h"
47 #include "include/hal/PocuterMicrophone.h"
48 #include "include/hal/PocuterHTTP.h"
49 #include "include/hal/PocuterTime.h"
50 #include "include/hal/PocuterServer.h"
51 #include "include/hal/PocuterPorts.h"
52 #include "include/hal/PocuterSleep.h"
53
54 #define DEEP_SLEEP_MEMORY _SECTION_ATTR_IMPL(".rtc.data", __COUNTER__)
55
56 class Pocuter {
57 public:
58 enum POCUTER_RESULT {
59 POCUTER_RESULT_OK = 0,
60 POCUTER_RESULT_FAILED
61 };
62
71 Pocuter();
72
78 virtual ~Pocuter();
79
88 void begin(PocuterDisplay::BUFFER_MODE bm = PocuterDisplay::BUFFER_MODE_NO_BUFFER);
89
90 #ifndef POCUTER_DISABLE_RGBled
91
102 int setStatusLED(uint8_t r, uint8_t g, uint8_t b);
103
104
105 static RGBled* RGBLed;
107 #endif
108 static PocuterI2C* I2C;
110 #ifndef POCUTER_DISABLE_DISPLAY
111 static PocuterDisplay* Display;
112 static UGUI* ugui;
113 #endif
114 #ifndef POCUTER_DISABLE_LIGHTSENSOR
115 static PocuterLightSensor* LightSensor;
116 #endif
117 #ifndef POCUTER_DISABLE_BUTTONS
118 static PocuterButtons* Buttons;
119 #endif
120 #ifndef POCUTER_DISABLE_PORTS
121 static PocuterPorts* Ports ;
122 #endif
123 #ifndef POCUTER_DISABLE_PORTS
124 static PocuterSleep* Sleep ;
125 #endif
126 static PocuterHMAC* HMAC;
128 #ifndef POCUTER_DISABLE_SD_CARD
129 static PocuterSDCard* SDCard;
130 static PocuterOTA* OTA;
131 #endif
132
133 #ifndef POCUTER_DISABLE_WIFI
134 static PocuterWIFI* WIFI;
135 #endif
136
137 #ifndef POCUTER_DISABLE_HTTP
138 static PocuterHTTP* HTTP;
139 #endif
140
141 #ifndef POCUTER_DISABLE_MICROPHONE
142 static PocuterMicrophone* Microphone;
143 #endif
144
145 #ifndef POCUTER_DISABLE_TIME
146 static PocuterTime* PocTime;
147 #endif
148
149 #ifndef POCUTER_DISABLE_SERVER
150 static PocuterServer* Server;
151 #endif
152
153 #ifndef POCUTER_DISABLE_ACC
154 static PocuterAccelerometer* Accelerometer;
155 #endif
156
157 private:
158
159
160 static UG_GUI uGUI;
161
162
163 static void driver_pixelSet(UG_S16,UG_S16,UG_COLOR);
164 static int8_t driver_drawLine(UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_COLOR c);
165 static int8_t driver_fillFrame(UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_COLOR c);
166 static int8_t driver_drawScanLine(UG_S16 x, UG_S16 y, UG_S16 width, UG_COLOR* c);
167
168 };
169
170 #endif /* POCUTER_H */
171
Pocuter::OTA
static PocuterOTA * OTA
Definition: Pocuter.h:130
Pocuter::I2C
static PocuterI2C * I2C
Definition: Pocuter.h:108
PocuterHTTP.h
PocuterPorts
options to access the Pocuter user ports (Port0 - Port5)
Definition: PocuterPorts.h:8
PocuterAccelerometer.h
PocuterHTTP
HTTP(S) download.
Definition: PocuterHTTP.h:9
PocuterTime
access the Pocuter real time clock
Definition: PocuterTime.h:10
PocuterLibConfig.h
PocuterServer.h
Pocuter::POCUTER_RESULT_OK
@ POCUTER_RESULT_OK
Definition: Pocuter.h:59
Pocuter::Accelerometer
static PocuterAccelerometer * Accelerometer
Definition: Pocuter.h:154
PocuterSleep
Pocuter Sleep settings.
Definition: PocuterSleep.h:9
Pocuter::Sleep
static PocuterSleep * Sleep
Definition: Pocuter.h:124
RGBled.h
Pocuter::WIFI
static PocuterWIFI * WIFI
Definition: Pocuter.h:134
PocuterOTA.h
Pocuter::POCUTER_RESULT_FAILED
@ POCUTER_RESULT_FAILED
Definition: Pocuter.h:60
Pocuter::POCUTER_RESULT
POCUTER_RESULT
Definition: Pocuter.h:58
Pocuter::LightSensor
static PocuterLightSensor * LightSensor
Definition: Pocuter.h:115
PocuterOTA
Definition: PocuterOTA.h:7
PocuterServer
Definition: PocuterServer.h:8
PocuterI2C.h
PocuterWIFI.h
Pocuter::SDCard
static PocuterSDCard * SDCard
Definition: Pocuter.h:129
PocuterLightSensor.h
Pocuter::Ports
static PocuterPorts * Ports
Definition: Pocuter.h:121
PocuterWIFI
Pocuter WIFI configurations.
Definition: PocuterWIFI.h:10
PocuterTime.h
Pocuter::begin
void begin(PocuterDisplay::BUFFER_MODE bm=PocuterDisplay::BUFFER_MODE_NO_BUFFER)
initializes your Pocuter
PocuterHMAC.h
Pocuter
Definition: Pocuter.h:56
Pocuter::RGBLed
static RGBled * RGBLed
Definition: Pocuter.h:105
PocuterPorts.h
Pocuter::Microphone
static PocuterMicrophone * Microphone
Definition: Pocuter.h:142
RGBled
Pocuter status LED.
Definition: RGBled.h:13
PocuterDisplay
this class has basic display operations only. If you want to write a GUI, consider to use ugui instea...
Definition: PocuterDisplay.h:8
PocuterMicrophone
options to access the Pocuter microphone
Definition: PocuterMicrophone.h:10
PocuterAccelerometer
options to access the Pocuter accelerometer
Definition: PocuterAccelerometer.h:9
Pocuter::Server
static PocuterServer * Server
Definition: Pocuter.h:150
PocuterButtons
options to access the Pocuter buttons
Definition: PocuterButtons.h:10
PocuterDisplay.h
PocuterDisplay::BUFFER_MODE
BUFFER_MODE
Definition: PocuterDisplay.h:10
Pocuter::setStatusLED
int setStatusLED(uint8_t r, uint8_t g, uint8_t b)
Setting Status LED.
PocuterSDCard
informations about the sd card
Definition: PocuterSDCard.h:8
PocuterMicrophone.h
Pocuter::Pocuter
Pocuter()
Pocuter constructor.
PocuterLightSensor
options to access the Pocuter light sensor
Definition: PocuterLightSensor.h:9
PocuterI2C
I2C Interface.
Definition: PocuterI2C.h:9
PocuterHMAC
HMAC encryption operations.
Definition: PocuterHMAC.h:9
Pocuter::HMAC
static PocuterHMAC * HMAC
Definition: Pocuter.h:126
PocuterConfig.h
PocuterButtons.h
Pocuter::Display
static PocuterDisplay * Display
Definition: Pocuter.h:111
Pocuter::~Pocuter
virtual ~Pocuter()
Pocuter destructor.
Pocuter::PocTime
static PocuterTime * PocTime
Definition: Pocuter.h:146
Pocuter::ugui
static UGUI * ugui
Definition: Pocuter.h:112
Pocuter::HTTP
static PocuterHTTP * HTTP
Definition: Pocuter.h:138
PocuterSleep.h
PocuterSDCard.h
Pocuter::Buttons
static PocuterButtons * Buttons
Definition: Pocuter.h:118
PocuterDisplay::BUFFER_MODE_NO_BUFFER
@ BUFFER_MODE_NO_BUFFER
Definition: PocuterDisplay.h:11