Skip to content

Commit ce239d2

Browse files
committedMay 24, 2023
doc: add api
1 parent 94e71fb commit ce239d2

File tree

3 files changed

+109
-11
lines changed

3 files changed

+109
-11
lines changed
 

‎libraries/Arduino_H7_Video/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License](https://img.shields.io/badge/License-LGPLv3-blue.svg)]()
44

5-
The Arduino H7 Video library is a C++ library designed to handle the video output of Arduino boards based on the STM32H7 microcontroller with DSI (Display Serial Interface) video interface. DSI stands for Display Serial Interface, which is a serial interface used to connect a display to the microcontroller.
5+
The Arduino H7 Video library is a C++ library designed to handle the video output of Arduino boards based on the STM32H7 microcontroller with DSI video interface. DSI stands for Display Serial Interface, which is a serial interface used to connect a display to the microcontroller.
66

77
This library is based on the graphics primitives of the [ArduinoGraphics](https://github.com/arduino-libraries/ArduinoGraphics) library and currently supports the Arduino Portenta H7 and Arduino Giga R1 WiFi boards. The library offers two modes of operation for the Portenta H7 board: you can connect the display to the video output via a USB Type-C connection or use the Giga Display Shield. For the Giga R1 board, only the Giga Display Shield is supported.
88

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Summary
2+
3+
Members | Descriptions
4+
--------------------------------|---------------------------------------------
5+
`class` [`Arduino_H7_Video`](#class-arduino_h7_video) | The main class for managing the video controller and the display.
6+
7+
# class [`Arduino_H7_Video`](#class-arduino_h7_video)
8+
The main class for managing the video controller and the display.
9+
10+
## Summary
11+
12+
| Members | Descriptions |
13+
|-------------------------------------------------------------|---------------------------------------------|
14+
| `public ` [`Arduino_H7_Video`](#public-arduino_h7_videoint-width-int-height-h7displayshield-shield) | Construct a new Arduino_H7_Video object with the specified width, height, and display shield. |
15+
| `public int` [`begin`](#public-int-begin) | Initialize the video controller and display. |
16+
| `public void` [`end`](#public-void-end) | De-initialize the video controller and display. |
17+
| `public int` [`width`](#public-int-width) | Get the width of the display. |
18+
| `public int` [`height`](#public-int-height) | Get the height of the display. |
19+
| `public void` [`clear`](#public-void-clear) | Clear the display. |
20+
| `public void` [`beginDraw`](#public-void-begindraw) | Begin drawing operations on the display. |
21+
| `public void` [`endDraw`](#public-void-enddraw) | End drawing operations on the display. |
22+
| `public void` [`set`](#public-void-setint-x-int-y-uint8_t-r-uint8_t-g-uint8_t-b) | Set the color of the pixel at the specified coordinates. |
23+
24+
25+
> *Note: For all drawing functions, refer to the documentation of the [`ArduinoGraphics`](https://reference.arduino.cc/reference/en/libraries/arduinographics/) library.*
26+
27+
## Members
28+
29+
### `public ` [`Arduino_H7_Video`](#)`(int width, int height, H7DisplayShield &shield)`
30+
31+
Construct a new Arduino_H7_Video object with the specified width, height, and display shield.
32+
33+
#### Parameters
34+
- `width`: The width of the display.
35+
- `height`: The height of the display.
36+
- `shield`: The display shield used.
37+
- *GigaDisplayShield*: Giga Display Shield
38+
- *USBCVideo*: Display attach to the USB-C port
39+
40+
---
41+
42+
### `public int` [`begin`](#)`()`
43+
44+
Initialize the video controller and display.
45+
46+
#### Returns
47+
`int`: 0 if initialization is successful, otherwise an error code.
48+
49+
---
50+
51+
### `public void` [`end`](#)`()`
52+
53+
De-initialize the video controller and display.
54+
55+
---
56+
57+
### `public int` [`width`](#)`()`
58+
59+
Get the width of the display.
60+
61+
#### Returns
62+
`int`: The width of the display.
63+
64+
---
65+
66+
### `public int` [`height`](#)`()`
67+
68+
Get the height of the display.
69+
70+
#### Returns
71+
`int`: The height of the display.
72+
73+
---
74+
75+
### `public void` [`clear`](#)`()`
76+
77+
Clear the display.
78+
79+
---
80+
81+
### `public void` [`beginDraw`](#)`()`
82+
83+
Begin drawing operations on the display.
84+
85+
---
86+
87+
### `public void` [`endDraw`](#)`()`
88+
89+
End drawing operations on the display.
90+
91+
---
92+
93+
### `public void` [`set`](#)`(int x, int y, uint8_t r, uint8_t g, uint8_t b)`
94+
95+
Set the color of the pixel at the specified coordinates.
96+
97+
#### Parameters
98+
- `x`: The x-coordinate of the pixel.
99+
- `y`: The y-coordinate of the pixel.
100+
- `r`: The red component of the color.
101+
- `g`: The green component of the color.
102+
- `b`: The blue component of the color.
103+
104+
---
105+
106+
> *Note: For detailed information on drawing functions, please refer to the documentation of the [`ArduinoGraphics`](https://reference.arduino.cc/reference/en/libraries/arduinographics/) library.*
107+
108+

‎libraries/Arduino_H7_Video/examples/LVGLDemo/LVGLDemo.ino

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
Arduino_H7_Video Display(800, 480, GigaDisplayShield); /* Arduino_H7_Video Display(1024, 768, USBCVideo); */
1515
Arduino_GigaDisplayTouch TouchDetector;
1616

17-
void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) {
18-
if (contacts > 0) {
19-
Serial.print("Touch detected: ");
20-
Serial.print(points[0].x);
21-
Serial.print(",");
22-
Serial.println(points[0].y);
23-
}
24-
}
25-
2617
/* Button click event callback */
2718
static void btn_event_cb(lv_event_t * e) {
2819
static uint32_t cnt = 1;
@@ -42,7 +33,6 @@ void setup() {
4233

4334
Display.begin();
4435
TouchDetector.begin();
45-
TouchDetector.onDetect(gigaTouchHandler);
4636

4737
/* Create a container with grid 2x2 */
4838
static lv_coord_t col_dsc[] = {370, 370, LV_GRID_TEMPLATE_LAST};

0 commit comments

Comments
 (0)
Please sign in to comment.