26
26
#include " SDRAM.h"
27
27
#include " ArduinoGraphics.h"
28
28
#define HAS_ARDUINOGRAPHICS
29
+ #endif
29
30
30
31
static uint32_t lcd_x_size = 480 ;
31
32
static uint32_t lcd_y_size = 800 ;
32
- #endif
33
-
34
33
35
34
/* *
36
35
* @enum DisplayPixelFormat
@@ -77,46 +76,54 @@ class Display
77
76
#endif
78
77
{
79
78
public:
80
- /* *
81
- * @brief Construct a new Camera object.
82
- */
83
- Display (int width = 800 , int height = 480 );
84
-
85
- /* *
86
- * @brief Initialize the display
87
- */
88
- bool begin (DisplayPixelFormat pixformat = DISPLAY_RGB565);
89
-
90
- /* *
91
- * @brief a frame.
92
- *
93
- * @param fb Reference to a FrameBuffer object to store the frame data.
94
- * @param timeout Time in milliseconds to wait for a frame (default: 5000).
95
- * @return true if the frame is successfully captured, otherwise false.
96
- */
97
- // bool grabFrame(FrameBuffer &fb, uint32_t timeout = 5000);
98
-
99
-
100
- /* *
101
- *
102
- *
103
- *
104
- *
105
- */
106
- int write8 (const uint16_t x,
107
- const uint16_t y,
108
- const void *buf);
109
-
110
- void setFrameDesc (uint16_t w, uint16_t h, uint16_t pitch, uint32_t buf_size);
111
- void startFrameBuffering ();
112
- void endFrameBuffering ();
113
-
114
- int setBlanking (bool on);
79
+ /* *
80
+ * @brief Construct a new Camera object.
81
+ */
82
+ Display (int width = 800 , int height = 480 );
115
83
116
- void * getFrameBuffer ();
84
+ /* *
85
+ * @brief Initialize the display
86
+ */
87
+ bool begin (DisplayPixelFormat pixformat = DISPLAY_RGB565);
88
+
89
+ /* *
90
+ * @brief a frame.
91
+ *
92
+ * @param fb Reference to a FrameBuffer object to store the frame data.
93
+ * @param timeout Time in milliseconds to wait for a frame (default: 5000).
94
+ * @return true if the frame is successfully captured, otherwise false.
95
+ */
96
+ // bool grabFrame(FrameBuffer &fb, uint32_t timeout = 5000);
97
+
98
+
99
+ /* *
100
+ *
101
+ *
102
+ *
103
+ *
104
+ */
105
+ int write8 (const uint16_t x,
106
+ const uint16_t y,
107
+ const void *buf);
108
+
109
+ void setFrameDesc (uint16_t w, uint16_t h, uint16_t pitch, uint32_t buf_size);
110
+ void startFrameBuffering ();
111
+ void endFrameBuffering ();
112
+
113
+ int setBlanking (bool on);
114
+
115
+ void * getFrameBuffer ();
116
+
117
+ int16_t width (void ) { return _width; }
118
+ int16_t height (void ) { return _height; }
119
+
120
+ uint32_t getDisplayXSize (){
121
+ return lcd_x_size;
122
+ }
117
123
118
- int16_t width (void ) { return _width; }
119
- int16_t height (void ) { return _height; }
124
+ uint32_t getDisplayYSize (){
125
+ return lcd_y_size;
126
+ }
120
127
121
128
122
129
#ifdef HAS_ARDUINOGRAPHICS
@@ -146,14 +153,6 @@ class Display
146
153
*/
147
154
virtual void set (int x, int y, uint8_t r, uint8_t g, uint8_t b);
148
155
149
- uint32_t getDisplayXSize (){
150
- return lcd_x_size;
151
- }
152
-
153
- uint32_t getDisplayYSize (){
154
- return lcd_y_size;
155
- }
156
-
157
156
void lcdClear (uint16_t Color);
158
157
159
158
#endif
@@ -162,16 +161,13 @@ class Display
162
161
private:
163
162
const struct device *gdev;
164
163
struct display_buffer_descriptor *buf_desc;
165
- #if defined(HAS_ARDUINOGRAPHICS) || __has_include ("lvgl.h")
166
164
uint16_t *buffer = nullptr ;
167
165
uint32_t sizeof_framebuffer;
168
- #endif
169
166
protected:
170
167
int16_t _height, _width;
171
168
bool _rotated = false ;
172
169
173
170
};
174
171
172
+ #endif // __ZEPHYR__
175
173
#endif // __GIGA_DISPLAY_H__
176
-
177
- #endif // __ZEPHYR__
0 commit comments