在使用LCD例程时设置SPI MODE但是没法设置成模式3问题

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

在使用LCD例程时设置SPI MODE但是没法设置成模式3问题

Postby fan183579 » Wed Feb 16, 2022 8:24 am

ee3f624663fea982ac54c4217ddfd3c.png
ee3f624663fea982ac54c4217ddfd3c.png (48.35 KiB) Viewed 1314 times
点一块ST7789V3的屏幕,需要用的SPI MODE3,以达到CPOL=1, CPHA=1,但是实际上用逻辑分析仪测试后发现,实际上是CPOL=0, CPHA=1。包括我用MODE2和MODE1,也不能达成效果。请问有什么方式能达到预想效果。

void app_main(void)
{
esp_err_t ret;
spi_device_handle_t spi;
spi_bus_config_t buscfg={
.miso_io_num=-1,
.mosi_io_num=PIN_NUM_MOSI,
.sclk_io_num=PIN_NUM_CLK,
.quadwp_io_num=-1,
.quadhd_io_num=-1,
.max_transfer_sz=PARALLEL_LINES*320*2+8
};
spi_device_interface_config_t devcfg={
#ifdef CONFIG_LCD_OVERCLOCK
.clock_speed_hz=26*1000*1000, //Clock out at 26 MHz
#else
.clock_speed_hz=10*1000*1000, //Clock out at 10 MHz
#endif
.mode=3, //SPI mode 0
.spics_io_num=PIN_NUM_CS, //CS pin
.queue_size=7, //We want to be able to queue 7 transactions at a time
.pre_cb=lcd_spi_pre_transfer_callback, //Specify pre-transfer callback to handle D/C line
};
Attachments
d4c2898513bf17186e7ad778a92e8d7.png
d4c2898513bf17186e7ad778a92e8d7.png (55.71 KiB) Viewed 1314 times

Who is online

Users browsing this forum: No registered users and 106 guests