13#include "pico/stdlib.h"
23#define ST7735_144_128x128_column_offset 2
25#define ST7735_144_128x128_row_offset_0_90 1
27#define ST7735_144_128x128_row_offset_180_270 3
29#define ST7735_177_160x128_column_offset 0
31#define ST7735_177_160x128_row_offset 0
134 void send_buffer(uint8_t *buffer,
size_t buffer_len);
175 virtual void show(
Canvas *canvas,
const uint8_t anchor_x,
const uint8_t anchor_y);
193 void show(
Canvas *canvas,
const uint8_t anchor_x,
const uint8_t anchor_y);
CanvasFormat
the format of the canvas
Definition canvas.h:61
ColorIndex
define the code value for color
Definition canvas.h:27
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:129
GraphicDisplayDevice(size_t screen_width, size_t screen_height)
Construct a new Display Device object.
Definition display_device.cpp:4
this is a C++ wrapper for the original pico SDK spi master API
Definition hw_spi.h:50
uint8_t TFT_panel_start_y
the y starting position of the TFT panel within the ST7735 memory
Definition st7735.h:98
uint hw_reset_pin
the GPIO connected to the hardware reset input
Definition st7735.h:90
void send_cmd_list(uint8_t *cmd, size_t len)
send a list of command to the ST7735 device
Definition st7735.cpp:333
void hardware_reset()
hardware reset of the ST7735 device
Definition st7735.cpp:20
void config_gamma()
column row address set CASET , [0x00,0x01,0x00, width-1] RASET , [0x00,0x01,0x00, height-1] we start ...
Definition st7735.cpp:289
void check_display_device_compatibility(struct_ConfigGraphicWidget framebuffer_cfg, CanvasFormat canvas_format)
A pure virtual member function. Each device must implement this method and check the compatibility of...
Definition st7735.cpp:467
void set_backlight(bool on)
set the backlight of the display
Definition st7735.cpp:441
void set_display_OFF()
Set the display OFF object.
Definition st7735.cpp:429
uint8_t TFT_panel_start_x
the x starting position of the TFT panel within the ST7735 memory
Definition st7735.h:96
void send_cmd(uint8_t cmd)
send a command to the ST7735 device
Definition st7735.cpp:326
HW_SPI_Master * spi
SPI driver associated with the display.
Definition st7735.h:84
void set_RAM_write_addresses(uint8_t start_x, uint8_t start_y, size_t width, size_t height)
set the RAM write addresses for the display
Definition st7735.cpp:452
void set_normal_mode()
_set display normal ON NORON , sleep 10ms
Definition st7735.cpp:301
uint8_t ST7735_device_column_offset
the column offset for the ST7735 device
Definition st7735.h:92
void send_buffer(uint8_t *buffer, size_t buffer_len)
send a buffer of data to the ST7735 device
Definition st7735.cpp:342
virtual void clear_device_screen_buffer(ColorIndex color_index=ColorIndex::BLACK)
fill the internal ST7735 screen buffer with the given color. Default to BLACK, clear the internal buf...
Definition st7735.cpp:476
virtual void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)
A pure virtual member function. It transfers the pixel buffer to the a part of display screen buffer ...
Definition st7735.cpp:499
void init_pins()
initialize pins for the ST7735 device
Definition st7735.cpp:28
void set_rotation_and_color(struct_ConfigST7735 device_config)
set the actual position of the display
Definition st7735.cpp:139
bool rgb_order
a flag that indicates if the color order is RGB (true) or BGR (false)
Definition st7735.h:100
uint8_t ST7735_device_row_offset
the row offset for the ST7735 device
Definition st7735.h:94
void set_display_ON()
Set the display ON object.
Definition st7735.cpp:423
void soft_reset()
perform a software reset of the display
Definition st7735.cpp:446
void config_power_control()
config power control
Definition st7735.cpp:103
void config_device_specific_size_and_offsets(struct_ConfigST7735 device_config)
config specific device size and offsets
Definition st7735.cpp:375
void enable_command_pin(bool enable)
enable or disable the command mode (DC pin low or high)
Definition st7735.cpp:15
void enable_sleep(bool enable)
turn the display in sleep mode on/off
Definition st7735.cpp:435
ST7735(HW_SPI_Master *spi, struct_ConfigST7735 device_config)
Construct a new ST7735 object.
Definition st7735.cpp:348
uint backlight_pin
the GPIO connected to the backlight input
Definition st7735.h:88
void device_wakeup()
wake up the device from sleep mode
Definition st7735.cpp:50
void config_inversion_control()
config display inversion control
Definition st7735.cpp:88
uint dc_pin
the GPIO connected to the Data/Command_ input
Definition st7735.h:86
void config_frame_rate_control()
config framerate control
Definition st7735.cpp:66
This is a C++ wrapper for the original pico SDK spi master API, adapted to FreeRTOS environment.
Definition rtos_hw_spi.h:38
void send_clear_device_command(QueueHandle_t display_queue, SemaphoreHandle_t sending_done)
Send a clear screen command to the display gate keeper task.
Definition st7735.cpp:650
void clear_device_screen_buffer(ColorIndex color_index=ColorIndex::BLACK)
fill the internal ST7735 screen buffer with the given color. Default to BLACK, clear the internal buf...
Definition st7735.cpp:628
void show_from_display_queue(struct_DataToShow data_t_show)
Show data from the display queue.
Definition st7735.cpp:582
rtos_ST7735(rtos_HW_SPI_Master *spi, struct_ConfigST7735 device_config)
Construct a new rtos_ST7735 object.
Definition st7735.cpp:573
void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)
A pure virtual member function. It transfers the pixel buffer to the a part of display screen buffer ...
Definition st7735.cpp:587
These commands are those for either the ST7735 TFT 1.44" 128x128 pixels or the ST7735 TFT 1....
ST7735Rotation
code indicates rotation of the display (Portrait, paysage, upside-down)
Definition st7735.h:44
@ _180
rotate 180° clockwise
Definition st7735.h:51
@ _90
rotate 90° clockwise
Definition st7735.h:49
@ _0
no rotation applied
Definition st7735.h:47
@ _270
rotate 270° clockwise
Definition st7735.h:53
ST7735DisplayType
tag used to ru the correct init code
Definition st7735.h:35
@ ST7735_177_160_RGB_128_GREENTAB
LCD TFT 1"77 160(RGB)x128 green_tab configuration.
Definition st7735.h:39
@ ST7735_144_128_RGB_128_GREENTAB
LCD TFT 1"44 128(RGB)x128 green_tab configuration.
Definition st7735.h:37
data used to configure the display device
Definition st7735.h:58
ST7735Rotation rotation
indicates which rotation will be applied
Definition st7735.h:69
uint dc_pin
indicates the GPIO connected to the Data/Command_ input
Definition st7735.h:67
uint hw_reset_pin
indicates the GPIO connected to the hardware reset input
Definition st7735.h:65
ST7735DisplayType display_type
indicates which type of TFT panel must be configured
Definition st7735.h:61
uint backlight_pin
indicates the GPIO connected to the backlight input
Definition st7735.h:63
data structure used to queue data to send to the display task
Definition display_device.h:77