Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 423d715

Browse filesBrowse files
authored
Get the status of the display.
1 parent 9f0337f commit 423d715
Copy full SHA for 423d715

File tree

6 files changed

+31
-0
lines changed
Filter options

6 files changed

+31
-0
lines changed

‎libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ bool Arduino_H7_Video::isRotated() {
179179
return _rotated;
180180
}
181181

182+
int Arduino_H7_Video::getStatus()
183+
{
184+
return _shield->getStatus();
185+
}
186+
182187
void Arduino_H7_Video::end() {
183188
#ifdef HAS_ARDUINOGRAPHICS
184189
ArduinoGraphics::end();

‎libraries/Arduino_H7_Video/src/Arduino_H7_Video.h

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/Arduino_H7_Video.h
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ class Arduino_H7_Video
106106
*/
107107
bool isRotated();
108108

109+
/**
110+
* @brief Get the status of the display.
111+
*
112+
* @return int The Status of the display.
113+
*/
114+
int getStatus();
115+
109116
#ifdef HAS_ARDUINOGRAPHICS
110117
/**
111118
* @brief Clear the display.

‎libraries/Arduino_H7_Video/src/H7DisplayShield.cpp

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/H7DisplayShield.cpp
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ int GigaDisplayShieldClass::getEdidMode(int h, int v) {
1818
return EDID_MODE_480x800_60Hz;
1919
}
2020

21+
int GigaDisplayShieldClass::getStatus() {
22+
return 1;
23+
}
24+
2125
int USBCVideoClass::init(int edidmode) {
2226
struct edid recognized_edid;
2327
int err_code = 0;
@@ -57,5 +61,11 @@ int USBCVideoClass::getEdidMode(int h, int v) {
5761
return edidmode;
5862
}
5963

64+
int USBCVideoClass::getStatus() {
65+
int detected = anx7625_get_hpd_event(0);
66+
67+
return detected;
68+
}
69+
6070
GigaDisplayShieldClass GigaDisplayShield;
6171
USBCVideoClass USBCVideo;

‎libraries/Arduino_H7_Video/src/H7DisplayShield.h

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/H7DisplayShield.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ class H7DisplayShield {
55
public:
66
virtual int init(int edidmode) = 0;
77
virtual int getEdidMode(int h, int v);
8+
virtual int getStatus();
89
};
910

1011
class GigaDisplayShieldClass : public H7DisplayShield {
1112
public:
1213
int init(int edidmode);
1314
int getEdidMode(int h, int v);
15+
int getStatus();
1416
};
1517

1618
class USBCVideoClass : public H7DisplayShield {
1719
public:
1820
int init(int edidmode);
1921
int getEdidMode(int h, int v);
22+
int getStatus();
2023
};
2124

2225
extern GigaDisplayShieldClass GigaDisplayShield;

‎libraries/Arduino_H7_Video/src/anx7625.cpp

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/anx7625.cpp
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,11 @@ bool anx7625_is_power_provider(uint8_t bus) {
630630
}
631631
}
632632

633+
int anx7625_get_hpd_event(uint8_t bus) {
634+
int ret = anx7625_hpd_change_detect(bus);;
635+
return ret;
636+
}
637+
633638
int i2c_writeb(uint8_t bus, uint8_t saddr, uint8_t offset, uint8_t val) {
634639
char cmd[2];
635640
cmd[0] = offset;

‎libraries/Arduino_H7_Video/src/anx7625.h

Copy file name to clipboardExpand all lines: libraries/Arduino_H7_Video/src/anx7625.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ int anx7625_wait_hpd_event(uint8_t bus);
2424
int anx7625_get_cc_status(uint8_t bus, uint8_t *cc_status);
2525
int anx7625_read_system_status(uint8_t bus, uint8_t *sys_status);
2626
bool anx7625_is_power_provider(uint8_t bus);
27+
int anx7625_get_hpd_event(uint8_t bus);
2728

2829
#endif /* _ANX7625_H */

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.