You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library lcdgfx has a long list of supported platforms, but it still lacks support for the Raspberry Pi Pico micro controller using the pico C/C++ SDK.
I have implemented some of the lcd_hal functions using the pico-sdk, especially for the SPI implementation and also verified this implementation using hardware.
Implementation
The hardware implementation is placed in the directory lcdgfx/src/lcd_hal/pico/
To enable this implementation, the define PICO_BOARD is used, which is defined when compiling for the Raspberry Pi Pico and can be used to distinguish between the two boards pico and pico_w (no difference between these boards is made here)
The i2c hal is not implemented, as I do not have hardware to verify this. Instead I added empty dummy functions (to be able to compile this project) and added a compiler warning #warning "I2C is not implemented for Pico board - this is a dummy"
The lcdgfx library uses the LCD_PROGMEM macro for data stored in flash. (e.g. const PROGMEM uint8_t heartImage[8]). The pico-sdk uses the __in_flash() macro after type definition like: const uint8_t __in_flash() heartImage[8].
It is therefore unfortunately not possible to use the LCD_PROGMEM macro only using precompiler directives. I have defined the LCD_PROGMEM "blank" to be able to compile this library.
Using this library
As the Raspberry Pi Pico suite also uses CMake (and ninja) for the projects, it is fairly straight forward to "include" the source of this library (at least once I figured it out correctly).
I have provided an example with 4 additional statements in the CMakeList.txt of the Raspberry Pi Pico project to include the lcdgfx CMake folder, as well as to compile and link it correctly. Using the lcdgfx library does work the same as on the Arduino platform.
With this approach none additional compile or link process is required, as it is seemingly implemented into the CMake build process of the Raspberry Pi Pico prject.
Best regards
Simon
The text was updated successfully, but these errors were encountered:
One workaround I forgot to mention regarding the SPI hardware:
The Rapsberry Pi Pico has 2 SPI hardware peripherals (spi0 and spi1) which can each be routed to multiple different pins.
The pin routing is implemented in the pico-hal and can be achieved by providing the correct pin numbers to the constructor of lcdgfx. As there are no additional parameters in the constructor, I used a define to distinguish between these 2 SPI peripherals
I have therefore introduced the following snippet of the pico_spi.h file:
The library lcdgfx has a long list of supported platforms, but it still lacks support for the Raspberry Pi Pico micro controller using the pico C/C++ SDK.
I have implemented some of the
lcd_hal
functions using the pico-sdk, especially for the SPI implementation and also verified this implementation using hardware.Implementation
lcdgfx/src/lcd_hal/pico/
PICO_BOARD
is used, which is defined when compiling for the Raspberry Pi Pico and can be used to distinguish between the two boardspico
andpico_w
(no difference between these boards is made here)#warning "I2C is not implemented for Pico board - this is a dummy"
LCD_PROGMEM
macro for data stored in flash. (e.g.const PROGMEM uint8_t heartImage[8]
). The pico-sdk uses the__in_flash()
macro after type definition like:const uint8_t __in_flash() heartImage[8]
.It is therefore unfortunately not possible to use the
LCD_PROGMEM
macro only using precompiler directives. I have defined theLCD_PROGMEM
"blank" to be able to compile this library.Using this library
As the Raspberry Pi Pico suite also uses CMake (and ninja) for the projects, it is fairly straight forward to "include" the source of this library (at least once I figured it out correctly).
I have provided an example with 4 additional statements in the CMakeList.txt of the Raspberry Pi Pico project to include the lcdgfx CMake folder, as well as to compile and link it correctly. Using the lcdgfx library does work the same as on the Arduino platform.
With this approach none additional compile or link process is required, as it is seemingly implemented into the CMake build process of the Raspberry Pi Pico prject.
Best regards
Simon
The text was updated successfully, but these errors were encountered: