- Name: SSD1331
- Description:
C++ Raspberry pi PICO library for a TFT SPI LCD, SSD1331 Driver. 2Contrast , dim mode, Invert colour, scroll, rotate, sleep modes supported. SSD1331 96x 64 RGB Dot Matrix OLED/PLED Segment/Common Driver with Controller.
- Author: Gavin Lyons
In the example files, there are 3 sections in "Setup()" function where user can make adjustments. The constructor also takes a number of arguments.
- User Option constructor() Color and contrast settings
- User Option Setup() SPI Settings
- User Option Setup() Setup the GPIO
- User Option Setup() Screen Setup
User Option Color and contrast settings
Here the user can select RGB or BGR mode depending on type of display, They can also set the color contrast levels for the 3 channels (A B and C) for normal and Dim mode. The range is 0-255.
*User Option SPI Settings *
Here the user can pass the SPI Bus freq in kiloHertz. Max SPI speed on the PICO is 62.5Mhz. 2nd parameter is the SPI interface(spi0 spi1 etc). If users wants software SPI just call this method with just one argument for the optional GPIO software uS delay, which by default is zero. Setting this higher can be used to slow down Software SPI which may be beneficial in some setups.
*User Option Setup the GPIO pins
Set the five GPIO pins if using Hardware SPI clock and data pins will be tied to the chosen interface eg Spi0 CLK=18 DIN=19)
*User Option Screen size *
User can adjust screen pixel height, screen pixel width.
There are example files included. User picks the one they want by editing the CMakeLists.txt :: add_executable(${PROJECT_NAME} section. Comment in one path and one path only.
| # | example file name | Desc |
|---|---|---|
| 1 | hello | hello world Basic use case |
| 2 | bitmap_functions | bitmap tests & function testing |
| 3 | demo | radar demo |
Connections as setup in main.cpp test file.
| TFT PinNum | Pindesc | RPI HW SPI | RPI SW SPI |
|---|---|---|---|
| 1 | GND | GND | GND |
| 2 | VCC | VCC 3.3V | VCC 3.3V |
| 3 | SCLK | SPI_CLK | GPIO6 |
| 4 | SDA | SPI_MOSI | GPIO5 |
| 5 | RESET | GPI025 | GPIO25 |
| 6 | DC | GPIO24 | GPIO24 |
| 7 | CS | SPI_CE0 | GPIO21 |
- Pick any GPIO you want for SW SPI, for HW SPI: reset and DC lines are flexible.
- User can select SPI_CE0 or SPI_CE1 for HW SPI
- To operate without CS pin: pass -1 as argument for CS pin number in SetupGPIO()function and ground the CS pin on device side.

