|
| 1 | +/* |
| 2 | + * Copyright 2023 Arduino SA |
| 3 | + * |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU Lesser General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU Lesser General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU Lesser General Public License |
| 15 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | + * |
| 17 | + */ |
| 18 | + |
1 | 19 | /**
|
2 |
| - ****************************************************************************** |
3 |
| - * @file Arduino_H7_Video.h |
4 |
| - * @author |
5 |
| - * @version |
6 |
| - * @date |
7 |
| - * @brief |
8 |
| - ****************************************************************************** |
9 |
| - */ |
| 20 | + * @file Arduino_H7_Video.h |
| 21 | + * @author Leonardo Cavagnis |
| 22 | + * @brief Header file for the Arduino H7 Video library. |
| 23 | + * |
| 24 | + * This library allows to manage the video output on Arduino boards based on the STM32H7 microcontroller |
| 25 | + * providing functions to draw graphics on the screen. |
| 26 | + */ |
10 | 27 |
|
11 | 28 | #ifndef _ARDUINO_H7_VIDEO_H
|
12 | 29 | #define _ARDUINO_H7_VIDEO_H
|
|
23 | 40 | /* Exported enumeration ------------------------------------------------------*/
|
24 | 41 |
|
25 | 42 | /* Class ----------------------------------------------------------------------*/
|
| 43 | + |
| 44 | +/** |
| 45 | + * @class Arduino_H7_Video |
| 46 | + * @brief The main class for managing the video controller and the display. |
| 47 | + */ |
26 | 48 | class Arduino_H7_Video
|
27 | 49 | #ifdef HAS_ARDUINOGRAPHICS
|
28 | 50 | : public ArduinoGraphics
|
29 | 51 | #endif
|
30 | 52 | {
|
31 | 53 | public:
|
| 54 | +/** |
| 55 | + * @brief Constructs a new Arduino_H7_Video object with the specified width, height, and display shield. |
| 56 | + * |
| 57 | + * @param width The width of the display. |
| 58 | + * @param height The height of the display. |
| 59 | + * @param shield The display shield used. |
| 60 | + * - GigaDisplayShield: Giga Display Shield |
| 61 | + * - USBCVideo: Display attach to the USB-C port |
| 62 | + */ |
32 | 63 | #if defined(ARDUINO_PORTENTA_H7_M7)
|
33 | 64 | Arduino_H7_Video(int width = 1024, int height = 768, H7DisplayShield &shield = USBCVideo);
|
34 | 65 | #elif defined(ARDUINO_GIGA)
|
35 | 66 | Arduino_H7_Video(int width = 800, int height = 480, H7DisplayShield &shield = GigaDisplayShield);
|
36 | 67 | #endif
|
| 68 | + |
| 69 | + /** |
| 70 | + * @brief Destructor for the Arduino_H7_Video object. |
| 71 | + */ |
37 | 72 | ~Arduino_H7_Video();
|
38 | 73 |
|
| 74 | + /** |
| 75 | + * @brief Initialize the video controller and display. |
| 76 | + * |
| 77 | + * @return int 0 if initialization is successful, otherwise an error code. |
| 78 | + */ |
39 | 79 | int begin();
|
| 80 | + |
| 81 | + /** |
| 82 | + * @brief De-initialize the video controller and display. |
| 83 | + */ |
40 | 84 | void end();
|
41 | 85 |
|
| 86 | + /** |
| 87 | + * @brief Get the width of the display. |
| 88 | + * |
| 89 | + * @return int The width of the display. |
| 90 | + */ |
42 | 91 | int width();
|
| 92 | + |
| 93 | + /** |
| 94 | + * @brief Get the height of the display. |
| 95 | + * |
| 96 | + * @return int The height of the display. |
| 97 | + */ |
43 | 98 | int height();
|
44 | 99 |
|
45 | 100 | #ifdef HAS_ARDUINOGRAPHICS
|
| 101 | + /** |
| 102 | + * @brief Clear the display. |
| 103 | + */ |
46 | 104 | void clear();
|
47 | 105 |
|
| 106 | + /** |
| 107 | + * @brief Begin drawing operations on the display. |
| 108 | + */ |
48 | 109 | virtual void beginDraw();
|
| 110 | + |
| 111 | + /** |
| 112 | + * @brief End drawing operations on the display. |
| 113 | + */ |
49 | 114 | virtual void endDraw();
|
50 | 115 |
|
| 116 | + /** |
| 117 | + * @brief Set the color of the pixel at the specified coordinates. |
| 118 | + * |
| 119 | + * @param x The x-coordinate of the pixel. |
| 120 | + * @param y The y-coordinate of the pixel. |
| 121 | + * @param r The red component of the color. |
| 122 | + * @param g The green component of the color. |
| 123 | + * @param b The blue component of the color. |
| 124 | + */ |
51 | 125 | virtual void set(int x, int y, uint8_t r, uint8_t g, uint8_t b);
|
52 | 126 | #endif
|
53 | 127 | private:
|
|
0 commit comments