ESPHome  2022.9.3
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::st7789v::ST7789V Class Reference

#include <st7789v.h>

Inheritance diagram for esphome::st7789v::ST7789V:
esphome::PollingComponent esphome::display::DisplayBuffer esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_10MHZ > esphome::Component

Public Member Functions

void set_model (ST7789VModel model)
 
void set_dc_pin (GPIOPin *dc_pin)
 
void set_reset_pin (GPIOPin *reset_pin)
 
void set_backlight_pin (GPIOPin *backlight_pin)
 
void set_eightbitcolor (bool eightbitcolor)
 
void set_height (uint32_t height)
 
void set_width (uint16_t width)
 
void set_offset_height (uint32_t offset_height)
 
void set_offset_width (uint16_t offset_width)
 
void setup () override
 
void dump_config () override
 
float get_setup_priority () const override
 
void update () override
 
void write_display_data ()
 
display::DisplayType get_display_type () override
 
- Public Member Functions inherited from esphome::PollingComponent
 PollingComponent ()
 
 PollingComponent (uint32_t update_interval)
 Initialize this polling component with the given update interval in ms. More...
 
virtual void set_update_interval (uint32_t update_interval)
 Manually set the update interval in ms for this polling object. More...
 
void call_setup () override
 
virtual uint32_t get_update_interval () const
 Get the update interval in ms of this sensor. More...
 
- Public Member Functions inherited from esphome::Component
virtual void loop ()
 This method will be called repeatedly. More...
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop(). More...
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed. More...
 
bool is_failed ()
 
virtual bool can_proceed ()
 
bool status_has_warning ()
 
bool status_has_error ()
 
void status_set_warning ()
 
void status_set_error ()
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages. More...
 
const char * get_component_source () const
 Get the integration where this component was declared as a string. More...
 
- Public Member Functions inherited from esphome::display::DisplayBuffer
virtual void fill (Color color)
 Fill the entire screen with the given color. More...
 
void clear ()
 Clear the entire screen by filling it with OFF pixels. More...
 
int get_width ()
 Get the width of the image in pixels with rotation applied. More...
 
int get_height ()
 Get the height of the image in pixels with rotation applied. More...
 
void draw_pixel_at (int x, int y, Color color=COLOR_ON)
 Set a single pixel at the specified coordinates to the given color. More...
 
void line (int x1, int y1, int x2, int y2, Color color=COLOR_ON)
 Draw a straight line from the point [x1,y1] to [x2,y2] with the given color. More...
 
void horizontal_line (int x, int y, int width, Color color=COLOR_ON)
 Draw a horizontal line from the point [x,y] to [x+width,y] with the given color. More...
 
void vertical_line (int x, int y, int height, Color color=COLOR_ON)
 Draw a vertical line from the point [x,y] to [x,y+width] with the given color. More...
 
void rectangle (int x1, int y1, int width, int height, Color color=COLOR_ON)
 Draw the outline of a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height]. More...
 
void filled_rectangle (int x1, int y1, int width, int height, Color color=COLOR_ON)
 Fill a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height]. More...
 
void circle (int center_x, int center_xy, int radius, Color color=COLOR_ON)
 Draw the outline of a circle centered around [center_x,center_y] with the radius radius with the given color. More...
 
void filled_circle (int center_x, int center_y, int radius, Color color=COLOR_ON)
 Fill a circle centered around [center_x,center_y] with the radius radius with the given color. More...
 
void print (int x, int y, Font *font, Color color, TextAlign align, const char *text)
 Print text with the anchor point at [x,y] with font. More...
 
void print (int x, int y, Font *font, Color color, const char *text)
 Print text with the top left at [x,y] with font. More...
 
void print (int x, int y, Font *font, TextAlign align, const char *text)
 Print text with the anchor point at [x,y] with font. More...
 
void print (int x, int y, Font *font, const char *text)
 Print text with the top left at [x,y] with font. More...
 
void printf (int x, int y, Font *font, Color color, TextAlign align, const char *format,...) __attribute__((format(printf
 Evaluate the printf-format format and print the result with the anchor point at [x,y] with font. More...
 
void void printf (int x, int y, Font *font, Color color, const char *format,...) __attribute__((format(printf
 Evaluate the printf-format format and print the result with the top left at [x,y] with font. More...
 
void void void printf (int x, int y, Font *font, TextAlign align, const char *format,...) __attribute__((format(printf
 Evaluate the printf-format format and print the result with the anchor point at [x,y] with font. More...
 
void void void void printf (int x, int y, Font *font, const char *format,...) __attribute__((format(printf
 Evaluate the printf-format format and print the result with the top left at [x,y] with font. More...
 
void void void void void strftime (int x, int y, Font *font, Color color, TextAlign align, const char *format, time::ESPTime time) __attribute__((format(strftime
 Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font. More...
 
void void void void void void strftime (int x, int y, Font *font, Color color, const char *format, time::ESPTime time) __attribute__((format(strftime
 Evaluate the strftime-format format and print the result with the top left at [x,y] with font. More...
 
void void void void void void void strftime (int x, int y, Font *font, TextAlign align, const char *format, time::ESPTime time) __attribute__((format(strftime
 Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font. More...
 
void void void void void void void void strftime (int x, int y, Font *font, const char *format, time::ESPTime time) __attribute__((format(strftime
 Evaluate the strftime-format format and print the result with the top left at [x,y] with font. More...
 
void void void void void void void void void image (int x, int y, Image *image, Color color_on=COLOR_ON, Color color_off=COLOR_OFF)
 Draw the image with the top-left corner at [x,y] to the screen. More...
 
void graph (int x, int y, graph::Graph *graph, Color color_on=COLOR_ON)
 Draw the graph with the top-left corner at [x,y] to the screen. More...
 
void legend (int x, int y, graph::Graph *graph, Color color_on=COLOR_ON)
 Draw the legend for graph with the top-left corner at [x,y] to the screen. More...
 
void qr_code (int x, int y, qr_code::QrCode *qr_code, Color color_on=COLOR_ON, int scale=1)
 Draw the qr_code with the top-left corner at [x,y] to the screen. More...
 
void get_text_bounds (int x, int y, const char *text, Font *font, TextAlign align, int *x1, int *y1, int *width, int *height)
 Get the text bounds of the given string. More...
 
void set_writer (display_writer_t &&writer)
 Internal method to set the display writer lambda. More...
 
void show_page (DisplayPage *page)
 
void show_next_page ()
 
void show_prev_page ()
 
void set_pages (std::vector< DisplayPage *> pages)
 
const DisplayPageget_active_page () const
 
void add_on_page_change_trigger (DisplayOnPageChangeTrigger *t)
 
void set_rotation (DisplayRotation rotation)
 Internal method to set the display rotation with. More...
 
void set_auto_clear (bool auto_clear_enabled)
 
DisplayRotation get_rotation () const
 
- Public Member Functions inherited from esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_10MHZ >
 SPIDevice ()=default
 
 SPIDevice (SPIComponent *parent, GPIOPin *cs)
 
void set_spi_parent (SPIComponent *parent)
 
void set_cs_pin (GPIOPin *cs)
 
void spi_setup ()
 
void enable ()
 
void disable ()
 
uint8_t read_byte ()
 
void read_array (uint8_t *data, size_t length)
 
std::array< uint8_t, N > read_array ()
 
void write_byte (uint8_t data)
 
void write_byte16 (uint16_t data)
 
void write_array16 (const uint16_t *data, size_t length)
 
void write_array (const uint8_t *data, size_t length)
 
void write_array (const std::array< uint8_t, N > &data)
 
void write_array (const std::vector< uint8_t > &data)
 
uint8_t transfer_byte (uint8_t data)
 
void transfer_array (uint8_t *data, size_t length)
 
void transfer_array (std::array< uint8_t, N > &data)
 

Protected Member Functions

void init_reset_ ()
 
void backlight_ (bool onoff)
 
void write_command_ (uint8_t value)
 
void write_data_ (uint8_t value)
 
void write_addr_ (uint16_t addr1, uint16_t addr2)
 
void write_color_ (uint16_t color, uint16_t size)
 
int get_height_internal () override
 
int get_width_internal () override
 
size_t get_buffer_length_ ()
 
void draw_filled_rect_ (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
 
void draw_absolute_pixel_internal (int x, int y, Color color) override
 
const char * model_str_ ()
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name. More...
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult()> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function. More...
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...
 
- Protected Member Functions inherited from esphome::display::DisplayBuffer
void vprintf_ (int x, int y, Font *font, Color color, TextAlign align, const char *format, va_list arg)
 
void init_internal_ (uint32_t buffer_length)
 
void do_update_ ()
 

Protected Attributes

ST7789VModel model_ {ST7789V_MODEL_TTGO_TDISPLAY_135_240}
 
GPIOPindc_pin_ {nullptr}
 
GPIOPinreset_pin_ {nullptr}
 
GPIOPinbacklight_pin_ {nullptr}
 
bool eightbitcolor_ {false}
 
uint16_t height_ {0}
 
uint16_t width_ {0}
 
uint16_t offset_height_ {0}
 
uint16_t offset_width_ {0}
 
- Protected Attributes inherited from esphome::PollingComponent
uint32_t update_interval_
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 
- Protected Attributes inherited from esphome::display::DisplayBuffer
uint8_t * buffer_ {nullptr}
 
DisplayRotation rotation_ {DISPLAY_ROTATION_0_DEGREES}
 
optional< display_writer_twriter_ {}
 
DisplayPagepage_ {nullptr}
 
DisplayPageprevious_page_ {nullptr}
 
std::vector< DisplayOnPageChangeTrigger * > on_page_change_triggers_
 
bool auto_clear_enabled_ {true}
 
- Protected Attributes inherited from esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_10MHZ >
SPIComponentparent_
 
GPIOPincs_
 

Detailed Description

Definition at line 114 of file st7789v.h.

Member Function Documentation

◆ backlight_()

void esphome::st7789v::ST7789V::backlight_ ( bool  onoff)
protected

Definition at line 223 of file st7789v.cpp.

◆ draw_absolute_pixel_internal()

void HOT esphome::st7789v::ST7789V::draw_absolute_pixel_internal ( int  x,
int  y,
Color  color 
)
overrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 302 of file st7789v.cpp.

◆ draw_filled_rect_()

void esphome::st7789v::ST7789V::draw_filled_rect_ ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
uint16_t  color 
)
protected

Definition at line 281 of file st7789v.cpp.

◆ dump_config()

void esphome::st7789v::ST7789V::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 118 of file st7789v.cpp.

◆ get_buffer_length_()

size_t esphome::st7789v::ST7789V::get_buffer_length_ ( )
protected

Definition at line 268 of file st7789v.cpp.

◆ get_display_type()

display::DisplayType esphome::st7789v::ST7789V::get_display_type ( )
inlineoverridevirtual

Implements esphome::display::DisplayBuffer.

Definition at line 139 of file st7789v.h.

◆ get_height_internal()

int esphome::st7789v::ST7789V::get_height_internal ( )
inlineoverrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 160 of file st7789v.h.

◆ get_setup_priority()

float esphome::st7789v::ST7789V::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 133 of file st7789v.cpp.

◆ get_width_internal()

int esphome::st7789v::ST7789V::get_width_internal ( )
inlineoverrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 161 of file st7789v.h.

◆ init_reset_()

void esphome::st7789v::ST7789V::init_reset_ ( )
protected

Definition at line 210 of file st7789v.cpp.

◆ model_str_()

const char * esphome::st7789v::ST7789V::model_str_ ( )
protected

Definition at line 318 of file st7789v.cpp.

◆ set_backlight_pin()

void esphome::st7789v::ST7789V::set_backlight_pin ( GPIOPin backlight_pin)
inline

Definition at line 122 of file st7789v.h.

◆ set_dc_pin()

void esphome::st7789v::ST7789V::set_dc_pin ( GPIOPin dc_pin)
inline

Definition at line 120 of file st7789v.h.

◆ set_eightbitcolor()

void esphome::st7789v::ST7789V::set_eightbitcolor ( bool  eightbitcolor)
inline

Definition at line 124 of file st7789v.h.

◆ set_height()

void esphome::st7789v::ST7789V::set_height ( uint32_t  height)
inline

Definition at line 125 of file st7789v.h.

◆ set_model()

void esphome::st7789v::ST7789V::set_model ( ST7789VModel  model)

Definition at line 140 of file st7789v.cpp.

◆ set_offset_height()

void esphome::st7789v::ST7789V::set_offset_height ( uint32_t  offset_height)
inline

Definition at line 127 of file st7789v.h.

◆ set_offset_width()

void esphome::st7789v::ST7789V::set_offset_width ( uint16_t  offset_width)
inline

Definition at line 128 of file st7789v.h.

◆ set_reset_pin()

void esphome::st7789v::ST7789V::set_reset_pin ( GPIOPin reset_pin)
inline

Definition at line 121 of file st7789v.h.

◆ set_width()

void esphome::st7789v::ST7789V::set_width ( uint16_t  width)
inline

Definition at line 126 of file st7789v.h.

◆ setup()

void esphome::st7789v::ST7789V::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 9 of file st7789v.cpp.

◆ update()

void esphome::st7789v::ST7789V::update ( )
overridevirtual

Implements esphome::PollingComponent.

Definition at line 135 of file st7789v.cpp.

◆ write_addr_()

void esphome::st7789v::ST7789V::write_addr_ ( uint16_t  addr1,
uint16_t  addr2 
)
protected

Definition at line 245 of file st7789v.cpp.

◆ write_color_()

void esphome::st7789v::ST7789V::write_color_ ( uint16_t  color,
uint16_t  size 
)
protected

Definition at line 256 of file st7789v.cpp.

◆ write_command_()

void esphome::st7789v::ST7789V::write_command_ ( uint8_t  value)
protected

Definition at line 230 of file st7789v.cpp.

◆ write_data_()

void esphome::st7789v::ST7789V::write_data_ ( uint8_t  value)
protected

Definition at line 238 of file st7789v.cpp.

◆ write_display_data()

void esphome::st7789v::ST7789V::write_display_data ( )

Definition at line 170 of file st7789v.cpp.

Field Documentation

◆ backlight_pin_

GPIOPin* esphome::st7789v::ST7789V::backlight_pin_ {nullptr}
protected

Definition at line 145 of file st7789v.h.

◆ dc_pin_

GPIOPin* esphome::st7789v::ST7789V::dc_pin_ {nullptr}
protected

Definition at line 143 of file st7789v.h.

◆ eightbitcolor_

bool esphome::st7789v::ST7789V::eightbitcolor_ {false}
protected

Definition at line 147 of file st7789v.h.

◆ height_

uint16_t esphome::st7789v::ST7789V::height_ {0}
protected

Definition at line 148 of file st7789v.h.

◆ model_

ST7789VModel esphome::st7789v::ST7789V::model_ {ST7789V_MODEL_TTGO_TDISPLAY_135_240}
protected

Definition at line 142 of file st7789v.h.

◆ offset_height_

uint16_t esphome::st7789v::ST7789V::offset_height_ {0}
protected

Definition at line 150 of file st7789v.h.

◆ offset_width_

uint16_t esphome::st7789v::ST7789V::offset_width_ {0}
protected

Definition at line 151 of file st7789v.h.

◆ reset_pin_

GPIOPin* esphome::st7789v::ST7789V::reset_pin_ {nullptr}
protected

Definition at line 144 of file st7789v.h.

◆ width_

uint16_t esphome::st7789v::ST7789V::width_ {0}
protected

Definition at line 149 of file st7789v.h.


The documentation for this class was generated from the following files: