_LCD_RST=const(None)#LCD reset control pin, active low
_LCD_CS=const(None)#LCD chip select control pin, active low
_LCD_RS=const(4)#LCD register command / data selection control pin, comand active low, data active high
_LCD_WR=const(5)#LCD write control pin, active low
_LCD_RD=const(None)#LCD read control pin, active low
_LCD_D0=const(12)
_LCD_D1=const(_LCD_D0+1)
_LCD_D2=const(_LCD_D0+2)
_LCD_D3=const(_LCD_D0+3)
_LCD_D4=const(_LCD_D0+4)
_LCD_D5=const(_LCD_D0+5)
_LCD_D6=const(_LCD_D0+6)
_LCD_D7=const(_LCD_D0+7)
## ESP32 GPIO REGISTERS
_ESP32_GPIO_OUT_REG=const(0x3FF44004)# GPIO0-31 output value. (R/W), 32 bits from rigth to left ref pins numbers from 0 to 31
_ESP32_GPIO_OUT_W1TS_REG=const(0x3FF44008)# GPIO0-31 output set register. For every bit that is 1 in the value written here, the corresponding bit in GPIO_OUT_REG will be set. (WO)
_ESP32_GPIO_OUT_W1TC_REG=const(0x3FF4400C)# GPIO0-31 output clear register. For every bit that is 1 in the value written here, the corresponding bit in GPIO_OUT_REG will be cleared. (WO)
_ESP32_GPIO_OUT1_REG=const(0x3FF44010)# GPIO32-39 output value. (R/W), 32 bits from rigth to left ref pins numbers from 32 to 39
_ESP32_GPIO_OUT1_W1TS_REG=const(0x3FF44014)# GPIO32-39 output set register. For every bit that is 1 in the value written here, the corresponding bit in GPIO_OUT_REG will be set. (WO)
_ESP32_GPIO_OUT1_W1TC_REG=const(0x3FF44018)# GPIO32-39 output clear register. For every bit that is 1 in the value written here, the corresponding bit in GPIO_OUT_REG will be cleared. (WO)
rst_pin:(int,None)=_LCD_RST,# LCD reset control pin
cs_pin:(int,None)=_LCD_CS,# LCD chip select control pin
rs_pin:(int,None)=_LCD_RS,#**Required** LCD register command / data selection control pin,
wr_pin:(int,None)=_LCD_WR,#**Required** LCD write control pin, active low
rd_pin:(int,None)=_LCD_RD,# LCD read control pin, active low
d0_pin:(int,None)=_LCD_D0#**Required** LCD D0 pin, all otherpins will be pick seguentially after this.
):
ifheight!=240orwidthnotin[320,240,135]:
raiseValueError("Unsupported display. 320x240, 240x240 and 135x240 are supported.")
ifrs_pinisNone:
raiseValueError("rs pin (data/command) is required.")
ifd0_pinisNoneor(d0_pin+8)>31:
raiseValueError("d0_pin is required, need to be continuos and bellow 23, the rest of data pins will be assign seguentially, ex, d0_pin = 12, d1_pin=13, ... ")