ESPHome 2026.10.0-dev
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 bool has_hardware_rotation) {
10 ESP_LOGCONFIG(TAG,
11 "MIPI_SPI Display\n"
12 " Model: %s\n"
13 " Width: %d\n"
14 " Height: %d\n"
15 " Swap X/Y: %s\n"
16 " Mirror X: %s\n"
17 " Mirror Y: %s\n"
18 " Hardware rotation: %s\n"
19 " Invert colors: %s\n"
20 " Color order: %s\n"
21 " Display pixels: %d bits\n"
22 " Endianness: %s\n"
23 " SPI Mode: %d\n"
24 " SPI Data rate: %uMHz\n"
25 " SPI Bus width: %d",
26 model, width, height, YESNO(madctl & MADCTL_MV), YESNO(madctl & (MADCTL_MX | MADCTL_XFLIP)),
27 YESNO(madctl & (MADCTL_MY | MADCTL_YFLIP)), YESNO(has_hardware_rotation), YESNO(invert_colors),
28 (madctl & MADCTL_BGR) ? LOG_STR_LITERAL("BGR") : LOG_STR_LITERAL("RGB"), display_bits,
29 is_big_endian ? LOG_STR_LITERAL("Big") : LOG_STR_LITERAL("Little"), spi_mode,
30 static_cast<unsigned>(data_rate / 1000000), bus_width);
31 LOG_PIN(" CS Pin: ", cs);
32 LOG_PIN(" Reset Pin: ", reset);
33 LOG_PIN(" DC Pin: ", dc);
34 if (offset_width != 0) {
35 ESP_LOGCONFIG(TAG, " Offset width: %d", offset_width);
36 }
37 if (offset_height != 0) {
38 ESP_LOGCONFIG(TAG, " Offset height: %d", offset_height);
39 }
40 if (brightness.has_value()) {
41 ESP_LOGCONFIG(TAG, " Brightness: %u", brightness.value());
42 }
43}
44
45} // namespace esphome::mipi_spi
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, bool has_hardware_rotation)
Definition mipi_spi.cpp:6
static void uint32_t