Skip to content

Get the status of the display. #1036

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

Merged
merged 3 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ bool Arduino_H7_Video::isRotated() {
return _rotated;
}

int Arduino_H7_Video::getStatus()
{
return _shield->getStatus();
}

void Arduino_H7_Video::end() {
#ifdef HAS_ARDUINOGRAPHICS
ArduinoGraphics::end();
Expand Down
7 changes: 7 additions & 0 deletions libraries/Arduino_H7_Video/src/Arduino_H7_Video.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ class Arduino_H7_Video
*/
bool isRotated();

/**
* @brief Get the status of the display.
*
* @return int The Status of the display.
*/
int getStatus();

#ifdef HAS_ARDUINOGRAPHICS
/**
* @brief Clear the display.
Expand Down
10 changes: 10 additions & 0 deletions libraries/Arduino_H7_Video/src/H7DisplayShield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ int GigaDisplayShieldClass::getEdidMode(int h, int v) {
return EDID_MODE_480x800_60Hz;
}

int GigaDisplayShieldClass::getStatus() {
return 1;
}

int USBCVideoClass::init(int edidmode) {
struct edid recognized_edid;
int err_code = 0;
Expand Down Expand Up @@ -57,5 +61,11 @@ int USBCVideoClass::getEdidMode(int h, int v) {
return edidmode;
}

int USBCVideoClass::getStatus() {
int detected = anx7625_get_hpd_event(0);

return detected;
}

GigaDisplayShieldClass GigaDisplayShield;
USBCVideoClass USBCVideo;
3 changes: 3 additions & 0 deletions libraries/Arduino_H7_Video/src/H7DisplayShield.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ class H7DisplayShield {
public:
virtual int init(int edidmode) = 0;
virtual int getEdidMode(int h, int v);
virtual int getStatus();
};

class GigaDisplayShieldClass : public H7DisplayShield {
public:
int init(int edidmode);
int getEdidMode(int h, int v);
int getStatus();
};

class USBCVideoClass : public H7DisplayShield {
public:
int init(int edidmode);
int getEdidMode(int h, int v);
int getStatus();
};

extern GigaDisplayShieldClass GigaDisplayShield;
Expand Down
5 changes: 5 additions & 0 deletions libraries/Arduino_H7_Video/src/anx7625.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ bool anx7625_is_power_provider(uint8_t bus) {
}
}

int anx7625_get_hpd_event(uint8_t bus) {
int ret = anx7625_hpd_change_detect(bus);;
return ret;
}

int i2c_writeb(uint8_t bus, uint8_t saddr, uint8_t offset, uint8_t val) {
char cmd[2];
cmd[0] = offset;
Expand Down
1 change: 1 addition & 0 deletions libraries/Arduino_H7_Video/src/anx7625.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ int anx7625_wait_hpd_event(uint8_t bus);
int anx7625_get_cc_status(uint8_t bus, uint8_t *cc_status);
int anx7625_read_system_status(uint8_t bus, uint8_t *sys_status);
bool anx7625_is_power_provider(uint8_t bus);
int anx7625_get_hpd_event(uint8_t bus);

#endif /* _ANX7625_H */