Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv/bl602: Implement SPI Cmd/Data #44

Merged
merged 1 commit into from
Mar 25, 2022
Merged

riscv/bl602: Implement SPI Cmd/Data #44

merged 1 commit into from
Mar 25, 2022

Conversation

lupyuen
Copy link
Owner

@lupyuen lupyuen commented Mar 25, 2022

Summary

To control the Data/Command Pin on ST7789 SPI Display, the SPI Driver flips the MISO Pin as though it was a GPIO.

To implement this on BL602, we reconfigure MISO from SPI Pin to GPIO Pin on the fly inside bl602_spi_cmddata().

When the SPI Port is deselected (after the SPI operation), we revert MISO back from GPIO Pin to SPI Pin. We implement this inside bl602_spi_select().

More Details Here

Impact

This change impacts 3 LCD drivers that call SPI_CMDDATA(): ST7735, ST7789, GC9A01.

Previously the BL602 SPI Driver would fail with "SPI cmddata not supported" when the above drivers are used.

After the change, the above drivers will set the LCD Data/Command Pin correctly.

Testing

We tested this implementation of SPI Cmd/Data with NuttX ST7789 Driver and a Logic Analyser on PineCone BL602:

We also tested LVGL with ST7789 on PineCone BL602:

As for regular SPI Devices that don't require SPI Cmd/Data, we tested CONFIG_SPI_CMDDATA=y with Semtech SX1262 SPI Transceiver on PineCone BL602:

@lupyuen lupyuen merged commit 2eac3dc into st7789 Mar 25, 2022
@lupyuen lupyuen changed the title Implement SPI Cmd/Data riscv/bl602: Implement SPI Cmd/Data Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant