@@ -355,6 +355,15 @@ def codeOutDevicePin(device, pin, definition_name):
355
355
if "pin_vsense" in board .devices ["USB" ]: codeOutDevicePin ("USB" , "pin_vsense" , "USB_VSENSE_PIN" )
356
356
357
357
if "LCD" in board .devices :
358
+ codeOut ("#define LCD_CONTROLLER_" + board .devices ["LCD" ]["controller" ].upper ())
359
+ if "width" in board .devices ["LCD" ]:
360
+ codeOut ("#define LCD_WIDTH " + str (board .devices ["LCD" ]["width" ]))
361
+ if "height" in board .devices ["LCD" ]:
362
+ codeOut ("#define LCD_HEIGHT " + str (board .devices ["LCD" ]["height" ]))
363
+ if "bpp" in board .devices ["LCD" ]:
364
+ codeOut ("#define LCD_BPP " + str (board .devices ["LCD" ]["bpp" ]))
365
+ if "pin_bl" in board .devices ["LCD" ]:
366
+ codeOutDevicePin ("LCD" , "pin_bl" , "LCD_BL" )
358
367
if board .devices ["LCD" ]["controller" ]== "fsmc" :
359
368
for i in range (0 ,16 ):
360
369
codeOutDevicePin ("LCD" , "pin_d" + str (i ), "LCD_FSMC_D" + str (i ))
@@ -365,14 +374,14 @@ def codeOutDevicePin(device, pin, definition_name):
365
374
codeOutDevicePin ("LCD" , "pin_rs" , "LCD_FSMC_RS" )
366
375
if "pin_reset" in board .devices ["LCD" ]:
367
376
codeOutDevicePin ("LCD" , "pin_reset" , "LCD_RESET" )
368
- if "pin_bl" in board .devices ["LCD" ]:
369
- codeOutDevicePin ("LCD" , "pin_bl" , "LCD_BL" )
370
- if board .devices ["LCD" ]["controller" ]== "ssd1306" or board .devices ["LCD" ]["controller" ]== "st7567" :
377
+ if board .devices ["LCD" ]["controller" ]== "ssd1306" or board .devices ["LCD" ]["controller" ]== "st7567" or board .devices ["LCD" ]["controller" ]== "st7789v" :
371
378
codeOutDevicePin ("LCD" , "pin_mosi" , "LCD_SPI_MOSI" )
372
379
codeOutDevicePin ("LCD" , "pin_sck" , "LCD_SPI_SCK" )
373
380
codeOutDevicePin ("LCD" , "pin_cs" , "LCD_SPI_CS" )
374
381
codeOutDevicePin ("LCD" , "pin_dc" , "LCD_SPI_DC" )
375
382
codeOutDevicePin ("LCD" , "pin_rst" , "LCD_SPI_RST" )
383
+ if "pin_bl" in board .devices ["LCD" ]:
384
+ codeOutDevicePin ("LCD" , "pin_bl" , "LCD_BL" )
376
385
377
386
if "SD" in board .devices :
378
387
if not "pin_d3" in board .devices ["SD" ]: # NOT SDIO - normal SD
0 commit comments