有没有拿S3连接过7789V LCD的?
Posted: Tue Sep 13, 2022 9:09 am
网上找到了S2的代码,移植过来后发现不行,白屏
然后按照STM32的启动流程又写了一遍,还是驱不起来,不知道哪的问题
static const int SPI_Frequency = SPI_MASTER_FREQ_40M;
#define LCD_HOST SPI3_HOST
#define DMA_CHAN SPI_DMA_CH_AUTO
spi_bus_config_t buscfg = {
.sclk_io_num = GPIO_SCLK,
.mosi_io_num = GPIO_MOSI,
.miso_io_num = -1,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 4096, // 非DMA:64byte,,DMA:4096Byte
.flags = SPICOMMON_BUSFLAG_MASTER // 初始化检查SPI主机模式是否成功
};
spi_device_interface_config_t devcfg={
.clock_speed_hz = SPI_Frequency,
.queue_size = 7,
.mode = 0,
// .flags = SPI_DEVICE_NO_DUMMY,
.command_bits = 0,
.address_bits = 0,
.dummy_bits = 0,
.duty_cycle_pos = 0,
.cs_ena_posttrans =1,
.spics_io_num = GPIO_CS
.pre_cb = lcd_spi_pre_trans_cb,
};
先用
ret = spi_bus_initialize( LCD_HOST, &buscfg, DMA_CHAN);
初始化了SPI总线
然后
ret = spi_bus_add_device( LCD_HOST, &devcfg, &handle);
添加了设备
最后按照7789的启动时序初始化了LCD
但发现根本就不好使,一片白屏
手头没有示波器和逻辑分析仪
怎么找问题?
然后按照STM32的启动流程又写了一遍,还是驱不起来,不知道哪的问题
static const int SPI_Frequency = SPI_MASTER_FREQ_40M;
#define LCD_HOST SPI3_HOST
#define DMA_CHAN SPI_DMA_CH_AUTO
spi_bus_config_t buscfg = {
.sclk_io_num = GPIO_SCLK,
.mosi_io_num = GPIO_MOSI,
.miso_io_num = -1,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 4096, // 非DMA:64byte,,DMA:4096Byte
.flags = SPICOMMON_BUSFLAG_MASTER // 初始化检查SPI主机模式是否成功
};
spi_device_interface_config_t devcfg={
.clock_speed_hz = SPI_Frequency,
.queue_size = 7,
.mode = 0,
// .flags = SPI_DEVICE_NO_DUMMY,
.command_bits = 0,
.address_bits = 0,
.dummy_bits = 0,
.duty_cycle_pos = 0,
.cs_ena_posttrans =1,
.spics_io_num = GPIO_CS
.pre_cb = lcd_spi_pre_trans_cb,
};
先用
ret = spi_bus_initialize( LCD_HOST, &buscfg, DMA_CHAN);
初始化了SPI总线
然后
ret = spi_bus_add_device( LCD_HOST, &devcfg, &handle);
添加了设备
最后按照7789的启动时序初始化了LCD
但发现根本就不好使,一片白屏
手头没有示波器和逻辑分析仪
怎么找问题?