The serial interface timing should be filled in thetiming_settings parameter in the function LCD_Init_Interface_YOUR_LCM_NAME.
Here's the brief introduce to the parameters intiming_settings structure.
port_number:The port number of serial interface.
csh:The width of chip select setup time.
css:The width of chip select hold time.
wr_low:The low width of the output clock while sending data.
wr_high:The highwidth of the output clock while sending data.
rd_low:The low width of the output clock while receiving data
rd_high:The high width of the output clock while receiving data.
clock_freq:The frequency of input clock to the LCD engine to set.
The clock widths are count f r o m 1, that mean if the parameter is set to 0, the actual width is 1.
Here is an example for ST7789H2:
The timing characteristics are show in below.
If theclock_freq is set toHAL_DISPLAY_LCD_INTERFACE_CLOCK_124MHZ, it means the tick width is 1/124MHz = 8ns.
The minimum chip select setup time is 15ns less than 16ns so the css should be set to1.
The minimum chip select holdtime is 15ns less than 16ns so the csh should be set to 1.
The minimum SCL "H" pluse width(Write)is 7ns less than 8ns so the wr_highshould be set to 0.
The minimum SCL "L" pluse width(Write)is 7ns less than 8ns so the wr_lowshould be set to 0.
The minimum SCL "H" pluse width(Read)is 60ns less than 64ns so the wr_highshould be set to 7.
The minimum SCL "L" pluse width(Read)is 60ns less than 64ns so the wr_lowshould be set to 7.
Here's the brief introduce to the parameters intiming_settings structure.
port_number:The port number of serial interface.
csh:The width of chip select setup time.
css:The width of chip select hold time.
wr_low:The low width of the output clock while sending data.
wr_high:The highwidth of the output clock while sending data.
rd_low:The low width of the output clock while receiving data
rd_high:The high width of the output clock while receiving data.
clock_freq:The frequency of input clock to the LCD engine to set.
The clock widths are count f r o m 1, that mean if the parameter is set to 0, the actual width is 1.
Here is an example for ST7789H2:
The timing characteristics are show in below.
If theclock_freq is set toHAL_DISPLAY_LCD_INTERFACE_CLOCK_124MHZ, it means the tick width is 1/124MHz = 8ns.
The minimum chip select setup time is 15ns less than 16ns so the css should be set to1.
The minimum chip select holdtime is 15ns less than 16ns so the csh should be set to 1.
The minimum SCL "H" pluse width(Write)is 7ns less than 8ns so the wr_highshould be set to 0.
The minimum SCL "L" pluse width(Write)is 7ns less than 8ns so the wr_lowshould be set to 0.
The minimum SCL "H" pluse width(Read)is 60ns less than 64ns so the wr_highshould be set to 7.
The minimum SCL "L" pluse width(Read)is 60ns less than 64ns so the wr_lowshould be set to 7.