2018-11-16 12:52 PM
I am trying to use arduino IDE to program the STM32F1 discovery with waveshare 4inch LCD using the demo code provided https://www.waveshare.com/wiki/4inch_TFT_Touch_Shield
am I using the correct package?
https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
How about the GPIO config?
//GPIO config
//LCD
#define LCD_CS PA2
#define LCD_CS_0 digitalWrite(LCD_CS, LOW)
#define LCD_CS_1 digitalWrite(LCD_CS, HIGH)
#define LCD_BL PA4
#define LCD_RST PA3
#define LCD_RST_0 digitalWrite(LCD_RST, LOW)
#define LCD_RST_1 digitalWrite(LCD_RST, HIGH)
#define LCD_DC PA1
#define LCD_DC_0 digitalWrite(LCD_DC, LOW)
#define LCD_DC_1 digitalWrite(LCD_DC, HIGH)
//Touch
#define TP_CS PA0
#define TP_CS_0 digitalWrite(TP_CS, LOW)
#define TP_CS_1 digitalWrite(TP_CS, HIGH)
#define TP_IRQ PC3
#define GET_TP_IRQ digitalRead(TP_IRQ)
#define TP_BUSY PC4
#define GET_TP_BUSY digitalRead(TP_BUSY)
#define SPI4W_Write_Byte(__DATA) SPI.transfer(__DATA)
#define SPI4W_Read_Byte(__DATA) SPI.transfer(__DATA)
2018-11-16 01:30 PM
You might find a better audience over at http://www.stm32duino.com/