ESPHome  2022.1.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::ili9341::ILI9341Display Class Referenceabstract

#include <ili9341_display.h>

Inheritance diagram for esphome::ili9341::ILI9341Display:
esphome::PollingComponent esphome::display::DisplayBuffer esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_40MHZ > esphome::Component esphome::ili9341::ILI9341M5Stack esphome::ili9341::ILI9341TFT24

Public Member Functions

void set_dc_pin (GPIOPin *dc_pin)
 
float get_setup_priority () const override
 
void set_reset_pin (GPIOPin *reset)
 
void set_led_pin (GPIOPin *led)
 
void set_model (ILI9341Model model)
 
void command (uint8_t value)
 
void data (uint8_t value)
 
void send_command (uint8_t command_byte, const uint8_t *data_bytes, uint8_t num_data_bytes)
 
uint8_t read_command (uint8_t command_byte, uint8_t index)
 
virtual void initialize ()=0
 
void update () override
 
void fill (Color color) override
 
void dump_config () override
 
void setup () 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
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 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)
 
- Public Member Functions inherited from esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_40MHZ >
 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 draw_absolute_pixel_internal (int x, int y, Color color) override
 
void setup_pins_ ()
 
void init_lcd_ (const uint8_t *init_cmd)
 
void set_addr_window_ (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 
void invert_display_ (bool invert)
 
void reset_ ()
 
void fill_internal_ (Color color)
 
void display_ ()
 
uint16_t convert_to_16bit_color_ (uint8_t color_8bit)
 
uint8_t convert_to_8bit_color_ (uint16_t color_16bit)
 
uint32_t get_buffer_length_ ()
 
int get_width_internal () override
 
int get_height_internal () override
 
void start_command_ ()
 
void end_command_ ()
 
void start_data_ ()
 
void end_data_ ()
 
uint32_t buffer_to_transfer_ (uint32_t pos, uint32_t sz)
 
- 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

ILI9341Model model_
 
int16_t width_ {320}
 Display width as modified by current rotation. More...
 
int16_t height_ {240}
 Display height as modified by current rotation. More...
 
uint16_t x_low_ {0}
 
uint16_t y_low_ {0}
 
uint16_t x_high_ {0}
 
uint16_t y_high_ {0}
 
uint8_t transfer_buffer_ [64]
 
GPIOPinreset_pin_ {nullptr}
 
GPIOPinled_pin_ {nullptr}
 
GPIOPindc_pin_
 
GPIOPinbusy_pin_ {nullptr}
 
- 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_LOW, spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_40MHZ >
SPIComponentparent_
 
GPIOPincs_
 

Detailed Description

Definition at line 17 of file ili9341_display.h.

Member Function Documentation

◆ buffer_to_transfer_()

uint32_t esphome::ili9341::ILI9341Display::buffer_to_transfer_ ( uint32_t  pos,
uint32_t  sz 
)
protected

Definition at line 241 of file ili9341_display.cpp.

◆ command()

void esphome::ili9341::ILI9341Display::command ( uint8_t  value)

Definition at line 40 of file ili9341_display.cpp.

◆ convert_to_16bit_color_()

uint16_t esphome::ili9341::ILI9341Display::convert_to_16bit_color_ ( uint8_t  color_8bit)
protected

Definition at line 115 of file ili9341_display.cpp.

◆ convert_to_8bit_color_()

uint8_t esphome::ili9341::ILI9341Display::convert_to_8bit_color_ ( uint16_t  color_16bit)
protected

Definition at line 126 of file ili9341_display.cpp.

◆ data()

void esphome::ili9341::ILI9341Display::data ( uint8_t  value)

Definition at line 55 of file ili9341_display.cpp.

◆ display_()

void esphome::ili9341::ILI9341Display::display_ ( )
protected

Definition at line 87 of file ili9341_display.cpp.

◆ draw_absolute_pixel_internal()

void HOT esphome::ili9341::ILI9341Display::draw_absolute_pixel_internal ( int  x,
int  y,
Color  color 
)
overrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 173 of file ili9341_display.cpp.

◆ dump_config()

void esphome::ili9341::ILI9341Display::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 29 of file ili9341_display.cpp.

◆ end_command_()

void esphome::ili9341::ILI9341Display::end_command_ ( )
protected

Definition at line 197 of file ili9341_display.cpp.

◆ end_data_()

void esphome::ili9341::ILI9341Display::end_data_ ( )
protected

Definition at line 202 of file ili9341_display.cpp.

◆ fill()

void esphome::ili9341::ILI9341Display::fill ( Color  color)
overridevirtual

Reimplemented from esphome::display::DisplayBuffer.

Definition at line 135 of file ili9341_display.cpp.

◆ fill_internal_()

void esphome::ili9341::ILI9341Display::fill_internal_ ( Color  color)
protected

Definition at line 144 of file ili9341_display.cpp.

◆ get_buffer_length_()

uint32_t esphome::ili9341::ILI9341Display::get_buffer_length_ ( )
protected

Definition at line 190 of file ili9341_display.cpp.

◆ get_height_internal()

int esphome::ili9341::ILI9341Display::get_height_internal ( )
overrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 239 of file ili9341_display.cpp.

◆ get_setup_priority()

float esphome::ili9341::ILI9341Display::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 39 of file ili9341_display.cpp.

◆ get_width_internal()

int esphome::ili9341::ILI9341Display::get_width_internal ( )
overrideprotectedvirtual

Implements esphome::display::DisplayBuffer.

Definition at line 238 of file ili9341_display.cpp.

◆ init_lcd_()

void esphome::ili9341::ILI9341Display::init_lcd_ ( const uint8_t *  init_cmd)
protected

Definition at line 204 of file ili9341_display.cpp.

◆ initialize()

virtual void esphome::ili9341::ILI9341Display::initialize ( )
pure virtual

◆ invert_display_()

void esphome::ili9341::ILI9341Display::invert_display_ ( bool  invert)
protected

Definition at line 236 of file ili9341_display.cpp.

◆ read_command()

uint8_t esphome::ili9341::ILI9341Display::read_command ( uint8_t  command_byte,
uint8_t  index 
)

Definition at line 68 of file ili9341_display.cpp.

◆ reset_()

void esphome::ili9341::ILI9341Display::reset_ ( )
protected

Definition at line 46 of file ili9341_display.cpp.

◆ send_command()

void esphome::ili9341::ILI9341Display::send_command ( uint8_t  command_byte,
const uint8_t *  data_bytes,
uint8_t  num_data_bytes 
)

Definition at line 61 of file ili9341_display.cpp.

◆ set_addr_window_()

void esphome::ili9341::ILI9341Display::set_addr_window_ ( uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)
protected

Definition at line 217 of file ili9341_display.cpp.

◆ set_dc_pin()

void esphome::ili9341::ILI9341Display::set_dc_pin ( GPIOPin dc_pin)
inline

Definition at line 22 of file ili9341_display.h.

◆ set_led_pin()

void esphome::ili9341::ILI9341Display::set_led_pin ( GPIOPin led)
inline

Definition at line 25 of file ili9341_display.h.

◆ set_model()

void esphome::ili9341::ILI9341Display::set_model ( ILI9341Model  model)
inline

Definition at line 26 of file ili9341_display.h.

◆ set_reset_pin()

void esphome::ili9341::ILI9341Display::set_reset_pin ( GPIOPin reset)
inline

Definition at line 24 of file ili9341_display.h.

◆ setup()

void esphome::ili9341::ILI9341Display::setup ( )
inlineoverridevirtual

Reimplemented from esphome::Component.

Definition at line 39 of file ili9341_display.h.

◆ setup_pins_()

void esphome::ili9341::ILI9341Display::setup_pins_ ( )
protected

Definition at line 12 of file ili9341_display.cpp.

◆ start_command_()

void esphome::ili9341::ILI9341Display::start_command_ ( )
protected

Definition at line 192 of file ili9341_display.cpp.

◆ start_data_()

void esphome::ili9341::ILI9341Display::start_data_ ( )
protected

Definition at line 198 of file ili9341_display.cpp.

◆ update()

void esphome::ili9341::ILI9341Display::update ( )
overridevirtual

Implements esphome::PollingComponent.

Definition at line 82 of file ili9341_display.cpp.

Field Documentation

◆ busy_pin_

GPIOPin* esphome::ili9341::ILI9341Display::busy_pin_ {nullptr}
protected

Definition at line 81 of file ili9341_display.h.

◆ dc_pin_

GPIOPin* esphome::ili9341::ILI9341Display::dc_pin_
protected

Definition at line 80 of file ili9341_display.h.

◆ height_

int16_t esphome::ili9341::ILI9341Display::height_ {240}
protected

Display height as modified by current rotation.

Definition at line 59 of file ili9341_display.h.

◆ led_pin_

GPIOPin* esphome::ili9341::ILI9341Display::led_pin_ {nullptr}
protected

Definition at line 79 of file ili9341_display.h.

◆ model_

ILI9341Model esphome::ili9341::ILI9341Display::model_
protected

Definition at line 57 of file ili9341_display.h.

◆ reset_pin_

GPIOPin* esphome::ili9341::ILI9341Display::reset_pin_ {nullptr}
protected

Definition at line 78 of file ili9341_display.h.

◆ transfer_buffer_

uint8_t esphome::ili9341::ILI9341Display::transfer_buffer_[64]
protected

Definition at line 74 of file ili9341_display.h.

◆ width_

int16_t esphome::ili9341::ILI9341Display::width_ {320}
protected

Display width as modified by current rotation.

Definition at line 58 of file ili9341_display.h.

◆ x_high_

uint16_t esphome::ili9341::ILI9341Display::x_high_ {0}
protected

Definition at line 62 of file ili9341_display.h.

◆ x_low_

uint16_t esphome::ili9341::ILI9341Display::x_low_ {0}
protected

Definition at line 60 of file ili9341_display.h.

◆ y_high_

uint16_t esphome::ili9341::ILI9341Display::y_high_ {0}
protected

Definition at line 63 of file ili9341_display.h.

◆ y_low_

uint16_t esphome::ili9341::ILI9341Display::y_low_ {0}
protected

Definition at line 61 of file ili9341_display.h.


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