ESPHome 2026.1.5
Loading...
Searching...
No Matches
mipi_spi.cpp
Go to the documentation of this file.
1#include "mipi_spi.h"
2#include "esphome/core/log.h"
3
5
6void internal_dump_config(const char *model, int width, int height, int offset_width, int offset_height, uint8_t madctl,
7 bool invert_colors, int display_bits, bool is_big_endian, const optional<uint8_t> &brightness,
8 GPIOPin *cs, GPIOPin *reset, GPIOPin *dc, int spi_mode, uint32_t data_rate, int bus_width) {
9 ESP_LOGCONFIG(TAG,
10 "MIPI_SPI Display\n"
11 " Model: %s\n"
12 " Width: %d\n"
13 " Height: %d\n"
14 " Swap X/Y: %s\n"
15 " Mirror X: %s\n"
16 " Mirror Y: %s\n"
17 " Invert colors: %s\n"
18 " Color order: %s\n"
19 " Display pixels: %d bits\n"
20 " Endianness: %s\n"
21 " SPI Mode: %d\n"
22 " SPI Data rate: %uMHz\n"
23 " SPI Bus width: %d",
24 model, width, height, YESNO(madctl & MADCTL_MV), YESNO(madctl & (MADCTL_MX | MADCTL_XFLIP)),
25 YESNO(madctl & (MADCTL_MY | MADCTL_YFLIP)), YESNO(invert_colors), (madctl & MADCTL_BGR) ? "BGR" : "RGB",
26 display_bits, is_big_endian ? "Big" : "Little", spi_mode, static_cast<unsigned>(data_rate / 1000000),
27 bus_width);
28 LOG_PIN(" CS Pin: ", cs);
29 LOG_PIN(" Reset Pin: ", reset);
30 LOG_PIN(" DC Pin: ", dc);
31 if (offset_width != 0)
32 ESP_LOGCONFIG(TAG, " Offset width: %d", offset_width);
33 if (offset_height != 0)
34 ESP_LOGCONFIG(TAG, " Offset height: %d", offset_height);
35 if (brightness.has_value())
36 ESP_LOGCONFIG(TAG, " Brightness: %u", brightness.value());
37}
38
39} // namespace esphome::mipi_spi
bool has_value() const
Definition optional.h:92
value_type const & value() const
Definition optional.h:94
uint16_t reset
Definition ina226.h:5
void internal_dump_config(const char *model, int width, int height, int offset_width, int offset_height, uint8_t madctl, bool invert_colors, int display_bits, bool is_big_endian, const optional< uint8_t > &brightness, GPIOPin *cs, GPIOPin *reset, GPIOPin *dc, int spi_mode, uint32_t data_rate, int bus_width)
Definition mipi_spi.cpp:6