Boboter
Loading...
Searching...
No Matches
display.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <esp_lcd_panel_ssd1306.h>
11
12class Robot;
13
14namespace Device {
15 class Display {
16 private:
17 static constexpr const char* TAG = "Device::Display";
18
19 static constexpr uint8_t I2C_ADDRESS = 0x3C;
20 static constexpr uint8_t WIDTH = 128;
21 static constexpr uint8_t HEIGHT = 64;
22 static constexpr uint8_t CHAR_WIDTH = 8;
23 static constexpr uint8_t CHAR_HEIGHT = 8;
24
25 static constexpr uint8_t font8x8[128][8] = {
26 #include "display_font.inc"
27 };
28
29 Robot& robot;
30
31 uint8_t* display_buffer;
32 uint8_t cursor_x;
33 uint8_t cursor_y;
34
35 esp_lcd_panel_handle_t panel_handle;
36 esp_lcd_panel_io_handle_t io_handle;
37
38 public:
39 explicit Display(Robot& robot);
40 ~Display();
41
45 void initialize();
46
50 void shutdown();
51
55 void clear();
56
62 void write_text(const char* text);
63
70 void set_cursor_position(uint8_t x, uint8_t y);
71 };
72}
void clear()
Clears the display.
Definition display.cpp:78
~Display()
Definition display.cpp:28
void write_text(const char *text)
Writes text to the display at the current cursor position.
Definition display.cpp:91
Display(Robot &robot)
Definition display.cpp:17
void shutdown()
Shuts down the LCD panel and the according I2C device.
Definition display.cpp:61
void set_cursor_position(uint8_t x, uint8_t y)
Sets the position of the cursor on the screen.
Definition display.cpp:130
void initialize()
Configures the LCD panel and all I2C components related to the display.
Definition display.cpp:33
Class containing all the components of the robot.
Definition robot.h:24
Definition battery.cpp:14