Closed vanvught closed 3 years ago
Some work on HDMI_PHY
uint32_t hbl = default_timing.hback_porch.typ + default_timing.hfront_porch.typ + default_timing.hsync_len.typ;
uint32_t vbl = default_timing.vback_porch.typ + default_timing.vfront_porch.typ + default_timing.vsync_len.typ;
HDMI_FC_INVIDCONF = (1U<<6) | (1U<<5) | (1U<<4) | (1U<<3); // Polarity etc
HDMI_FC_INHACTIV0 = (default_timing.hactive.typ & 0xff); // Horizontal pixels
HDMI_FC_INHACTIV1 = (default_timing.hactive.typ >> 8); // Horizontal pixels
HDMI_FC_INHBLANK0 = (hbl & 0xff); // Horizontal blanking
HDMI_FC_INHBLANK1 = (hbl >> 8); // Horizontal blanking
HDMI_FC_INVACTIV0 = (default_timing.vactive.typ & 0xff); // Vertical pixels
HDMI_FC_INVACTIV1 = (default_timing.vactive.typ >> 8); // Vertical pixels
HDMI_FC_INVBLANK = vbl; // Vertical blanking
HDMI_FC_HSYNCINDELAY0 = (default_timing.hfront_porch.typ & 0xff); // Horizontal Front porch
HDMI_FC_HSYNCINDELAY1 = (default_timing.hfront_porch.typ >> 8); // Horizontal Front porch
HDMI_FC_VSYNCINDELAY = default_timing.vfront_porch.typ; // Vertical front porch
HDMI_FC_HSYNCINWIDTH0 = (default_timing.hsync_len.typ & 0xff); // Horizontal sync pulse
HDMI_FC_HSYNCINWIDTH1 = (default_timing.hsync_len.typ >> 8); // Horizontal sync pulse
HDMI_FC_VSYNCINWIDTH = default_timing.vsync_len.typ; // Vertical sync pulse
Hi,
I have tried to make the display.c code more generic. However, not successful as I do not have a monitor with the currently hard-coded configuration.
Therefore, I am asking a favor if you can make the display.c more generic by using the struct below.
Many thanks, Arjan