Skip to content

Fix video for USB-C displays. #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions libraries/Arduino_H7_Video/examples/ArduinoLogo/ArduinoLogo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,23 @@ Arduino_H7_Video Display(800, 480, GigaDisplayShield);

Image img_arduinologo(ENCODING_RGB16, (uint8_t *) texture_raw, 300, 300);

void error() {
while (true) {
digitalWrite(LEDR, LOW);
delay(500);
digitalWrite(LEDR, HIGH);
delay(500);
}
}

void setup() {
Display.begin();
if (Display.begin()) {
error();
}

Display.beginDraw();
Display.image(img_arduinologo, (Display.width() - img_arduinologo.width())/2, (Display.height() - img_arduinologo.height())/2);
Display.endDraw();
}

void loop() { }
void loop() { }
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
//Arduino_H7_Video Display(1024, 768, USBCVideo);

void error() {
while (true) {
digitalWrite(LEDR, LOW);
delay(500);
digitalWrite(LEDR, HIGH);
delay(500);
}
}

void setup() {
Display.begin();

if (Display.begin()) {
error();
}

Display.beginDraw();
Display.background(255, 255, 255);
Display.clear();
Expand All @@ -34,4 +45,4 @@ void setup() {
Display.endDraw();
}

void loop() { }
void loop() { }
16 changes: 14 additions & 2 deletions libraries/Arduino_H7_Video/examples/LVGLDemo/LVGLDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ static void set_slider_val(void * bar, int32_t val) {
lv_bar_set_value((lv_obj_t *)bar, val, LV_ANIM_ON);
}

void error() {
while (true) {
digitalWrite(LEDR, LOW);
delay(500);
digitalWrite(LEDR, HIGH);
delay(500);
}
}

void setup() {
Serial.begin(115200);

Display.begin();
if (Display.begin()) {
error();
}

TouchDetector.begin();

/* Create a container with grid 2x2 */
Expand Down Expand Up @@ -140,4 +152,4 @@ void setup() {
void loop() {
/* Feed LVGL engine */
lv_timer_handler();
}
}
7 changes: 2 additions & 5 deletions libraries/Arduino_H7_Video/src/H7DisplayShield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ int USBCVideoClass::init(int edidmode) {
}

//Read EDID
err_code = anx7625_dp_get_edid(0, &recognized_edid);
if(err_code < 0) {
return err_code;
}
anx7625_dp_get_edid(0, &recognized_edid);

//DSI Configuration
err_code = anx7625_dp_start(0, &recognized_edid, (enum edid_modes) edidmode);
Expand All @@ -68,4 +65,4 @@ int USBCVideoClass::getStatus() {
}

GigaDisplayShieldClass GigaDisplayShield;
USBCVideoClass USBCVideo;
USBCVideoClass USBCVideo;