Skip to content

Commit c35258a

Browse files
authored
Merge branch 'arduino:main' into aliphys/selectGreyScaleStatus
2 parents f78af12 + aef18a1 commit c35258a

File tree

107 files changed

+43543
-71584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+43543
-71584
lines changed

Diff for: .github/workflows/compile-examples.yml

+35-10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- fqbn: arduino:mbed:nicla_sense
4040
- fqbn: arduino:mbed:nicla_vision
4141
- fqbn: arduino:mbed:opta
42+
- fqbn: arduino:mbed:giga
4243
- fqbn: arduino:mbed:nicla_voice
4344

4445
# compile only the examples compatible with each board
@@ -55,33 +56,31 @@ jobs:
5556
- ~/Arduino/libraries/ArduinoBLE
5657
- board:
5758
fqbn: arduino:mbed:envie_m7:target_core=cm4
58-
additional-libraries: |
59-
- name: lvgl
6059
additional-sketch-paths: |
61-
- libraries/doom
6260
- libraries/KernelDebug
6361
- libraries/Portenta_SDCARD
6462
- libraries/Portenta_SDRAM
65-
- libraries/Portenta_Video
6663
- libraries/RPC
6764
- board:
6865
fqbn: arduino:mbed:envie_m7
6966
additional-libraries: |
7067
- name: lvgl
71-
version: 7.11.0
68+
version: 8.3.5
7269
- name: MicroNMEA
7370
- name: ArduinoBLE
71+
- name: ArduinoGraphics
72+
- name: Arduino_GigaDisplayTouch
7473
additional-sketch-paths: |
7574
- libraries/PDM
7675
- libraries/doom
7776
- libraries/KernelDebug
7877
- libraries/MCUboot
79-
- libraries/Camera/examples
80-
- libraries/Portenta_lvgl/examples/Portenta_lvgl
78+
- libraries/Camera/examples/CameraCaptureRawBytes
79+
- libraries/Camera/examples/CameraMotionDetect
8180
- libraries/Portenta_SDCARD
8281
- libraries/Portenta_SDRAM
8382
- libraries/STM32H747_System
84-
- libraries/Portenta_Video
83+
- libraries/Arduino_H7_Video
8584
- libraries/RPC
8685
- libraries/ThreadDebug
8786
- libraries/USBHID
@@ -115,6 +114,7 @@ jobs:
115114
additional-sketch-paths: |
116115
- libraries/PDM
117116
- libraries/Camera/examples/CameraCaptureRawBytes
117+
- libraries/Camera/examples/CameraCaptureZoomPan
118118
- libraries/SE05X
119119
- libraries/STM32H747_System
120120
- libraries/ThreadDebug
@@ -131,6 +131,31 @@ jobs:
131131
- libraries/USBHID
132132
- libraries/USBMSD/examples/AccessFlashAsUSBDisk
133133
- libraries/WiFi
134+
- board:
135+
fqbn: arduino:mbed:giga
136+
additional-libraries: |
137+
- name: lvgl
138+
version: 8.3.5
139+
- name: MicroNMEA
140+
- name: ArduinoBLE
141+
- name: ArduinoGraphics
142+
- name: Arduino_GigaDisplayTouch
143+
additional-sketch-paths: |
144+
- libraries/PDM
145+
- libraries/MCUboot
146+
- libraries/Camera/examples/CameraCaptureRawBytes
147+
- libraries/Camera/examples/CameraMotionDetect
148+
- libraries/Portenta_SDCARD
149+
- libraries/Portenta_SDRAM
150+
- libraries/Arduino_H7_Video
151+
- libraries/RPC
152+
- libraries/ThreadDebug
153+
- libraries/USBHID
154+
- libraries/USBHOST
155+
- libraries/USBMSD/examples/AccessFlashAsUSBDisk
156+
- libraries/WiFi
157+
- libraries/GSM
158+
- ~/Arduino/libraries/ArduinoBLE
134159
- board:
135160
fqbn: arduino:mbed:nicla_voice
136161
additional-sketch-paths: |
@@ -141,10 +166,10 @@ jobs:
141166
- name: ArduinoBLE
142167
- name: arduino-audio-tools
143168
source-url: https://github.com/pschatzmann/arduino-audio-tools.git
144-
version: v0.9.4
169+
version: v0.9.6
145170
- name: arduino-libg722
146171
source-url: https://github.com/pschatzmann/arduino-libg722.git
147-
172+
148173
steps:
149174
- name: Checkout repository
150175
uses: actions/checkout@v2

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The repository contains the Arduino APIs and IDE integration files targeting a g
1010

1111
## Installation
1212

13+
Note:
14+
1315
### Clone the repository in `$sketchbook/hardware/arduino-git`
1416

1517
```bash
@@ -45,7 +47,7 @@ To install ARM build tools, use the `Boards Manager` option in the Arduino IDE t
4547

4648
## mbed-os-to-arduino script
4749

48-
The backbone of the packaging process is the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino script. It basically compiles a blank Mbed OS project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location.
50+
The backbone of the packaging process is the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino script. It basically compiles a blank Mbed OS project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location. This script is not compatible with MacOS, it must be run on Linux.
4951

5052
It can be used for a variety of tasks including:
5153

Diff for: libraries/Arduino_H7_Video/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 📺 Arduino H7 Video Library
2+
3+
The Arduino H7 Video Library manages the video output on Arduino boards based on the STM32H7 microcontroller (Portenta H7, GIGA R1 WiFi), providing functions to draw on the screen and integrate third-party video libraries such as [LVGL](https://lvgl.io/) and [emWin](https://www.segger.com/products/user-interface/emwin/).
4+
5+
📖 For more information about this library, please refer to the documentation [here](./docs/).

Diff for: libraries/Arduino_H7_Video/docs/README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Arduino H7 Video Library
2+
3+
[![License](https://img.shields.io/badge/License-LGPLv3-blue.svg)]()
4+
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.
6+
7+
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.
8+
9+
The library allows you to draw graphics elements on the screen using simple graphics primitives such as lines, circles, images, etc. Additionally, you can integrate third-party graphic libraries like [LVGL](https://lvgl.io/) and [emWin](https://www.segger.com/products/user-interface/emwin/) to achieve more complex GUI.
10+
11+
The library provides methods for initializing the video controller, clearing the screen, and drawing basic graphics elements.
12+
13+
## Features
14+
15+
- Handles video output of Arduino boards based on the STM32H7 microcontroller with DSI video interface
16+
- Allows drawing graphics elements using simple primitives like lines, circles, images, etc.
17+
- Integration of third-party graphic libraries like LVGL and emWin for more complex GUI
18+
19+
## Usage
20+
21+
To use this library, you must have a supported Arduino board and a display. Once you have connected the display to the board, you can include the display library in your Arduino sketch and use its functions to draw graphic elements on the screen.
22+
Here is a minimal example for the Arduino GIGA R1 WiFi with Giga Display Shield:
23+
24+
```cpp
25+
#include "Arduino_H7_Video.h"
26+
#include "ArduinoGraphics.h"
27+
28+
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
29+
30+
void setup() {
31+
Display.begin();
32+
33+
// Draw a green rectangle that covers the entire display
34+
Display.beginDraw();
35+
Display.clear();
36+
Display.noStroke();
37+
Display.fill(0, 255, 0);
38+
Display.rect(0, 0, Display.width(), Display.height());
39+
Display.endDraw();
40+
}
41+
42+
void loop() { }
43+
```
44+
## Examples
45+
46+
- **[ArduinoLogo](../examples/ArduinoLogo):** This example demonstrates how to display an Arduino logo image on the screen.
47+
- **[ArduinoLogoDrawing](../examples/ArduinoLogoDrawing):** This example demonstrates how to draw an Arduino logo image using graphics primitives (line, circle, rect, etc.).
48+
- **[LVGLDemo](../examples/LVGLDemo):** This example demonstrates how to create a graphical user interface (GUI) using the LVGL library. It includes the [Arduino_GigaDisplayTouch](https://github.com/arduino-libraries/Arduino_GigaDisplayTouch/) library to handle touch events.
49+
50+
## API
51+
52+
The API documentation can be found [here](./api.md).
53+
54+
## License
55+
56+
This library is released under the [LGPLv3 license]().

Diff for: libraries/Arduino_H7_Video/docs/api.md

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 bool` [`isRotated`](#public-bool-isrotated) | Check if the display is rotated. |
20+
| `public void` [`clear`](#public-void-clear) | Clear the display. |
21+
| `public void` [`beginDraw`](#public-void-begindraw) | Begin drawing operations on the display. |
22+
| `public void` [`endDraw`](#public-void-enddraw) | End drawing operations on the display. |
23+
| `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. |
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 bool` [`isRotated`](#)`()`
76+
77+
Check if the display is rotated.
78+
79+
#### Returns
80+
`bool`: True if the display is rotated, false otherwise.
81+
82+
---
83+
84+
### `public void` [`clear`](#)`()`
85+
86+
Clear the display.
87+
88+
---
89+
90+
### `public void` [`beginDraw`](#)`()`
91+
92+
Begin drawing operations on the display.
93+
94+
---
95+
96+
### `public void` [`endDraw`](#)`()`
97+
98+
End drawing operations on the display.
99+
100+
---
101+
102+
### `public void` [`set`](#)`(int x, int y, uint8_t r, uint8_t g, uint8_t b)`
103+
104+
Set the color of the pixel at the specified coordinates.
105+
106+
#### Parameters
107+
- `x`: The x-coordinate of the pixel.
108+
- `y`: The y-coordinate of the pixel.
109+
- `r`: The red component of the color.
110+
- `g`: The green component of the color.
111+
- `b`: The blue component of the color.
112+
113+
---
114+
115+
> *Note: For detailed information on drawing functions, please refer to the documentation of the [`ArduinoGraphics`](https://reference.arduino.cc/reference/en/libraries/arduinographics/) library.*
116+
117+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
ArduinoLogo
3+
4+
created 17 Apr 2023
5+
by Leonardo Cavagnis
6+
*/
7+
8+
#include "Arduino_H7_Video.h"
9+
#include "ArduinoGraphics.h"
10+
11+
#include "img_arduinologo.h"
12+
// Alternatively, any raw RGB565 image can be included on demand using this macro
13+
// Online image converter: https://lvgl.io/tools/imageconverter (Output format: Binary RGB565)
14+
/*
15+
#define INCBIN_PREFIX
16+
#include "incbin.h"
17+
INCBIN(test, "/home/user/Downloads/test.bin");
18+
*/
19+
20+
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
21+
//Arduino_H7_Video Display(1024, 768, USBCVideo);
22+
23+
Image img_arduinologo(ENCODING_RGB16, (uint8_t *) texture_raw, 300, 300);
24+
25+
void setup() {
26+
Display.begin();
27+
28+
Display.beginDraw();
29+
Display.image(img_arduinologo, (Display.width() - img_arduinologo.width())/2, (Display.height() - img_arduinologo.height())/2);
30+
Display.endDraw();
31+
}
32+
33+
void loop() { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
ArduinoLogoDrawing
3+
4+
created 17 Apr 2023
5+
by Leonardo Cavagnis
6+
*/
7+
8+
#include "Arduino_H7_Video.h"
9+
#include "ArduinoGraphics.h"
10+
11+
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
12+
//Arduino_H7_Video Display(1024, 768, USBCVideo);
13+
14+
void setup() {
15+
Display.begin();
16+
17+
Display.beginDraw();
18+
Display.background(255, 255, 255);
19+
Display.clear();
20+
Display.fill(0x008184);
21+
Display.circle(Display.width()/2, Display.height()/2, 300);
22+
Display.stroke(255, 255, 255);
23+
Display.noFill();
24+
for (int i=0; i<30; i++) {
25+
Display.circle((Display.width()/2)-55+5, Display.height()/2, 110-i);
26+
Display.circle((Display.width()/2)+55-5, Display.height()/2, 110-i);
27+
}
28+
Display.fill(255, 255, 255);
29+
Display.rect((Display.width()/2)-55-16+5, (Display.height()/2)-5, 32, 10);
30+
Display.fill(255, 255, 255);
31+
Display.rect((Display.width()/2)+55-16-5, (Display.height()/2)-5, 32, 10);
32+
Display.fill(255, 255, 255);
33+
Display.rect((Display.width()/2)+55-5-5, (Display.height()/2)-16, 10, 32);
34+
Display.endDraw();
35+
}
36+
37+
void loop() { }

0 commit comments

Comments
 (0)