[max6921] enable all ESP32 frameworks

This commit is contained in:
endym 2024-09-27 18:47:51 +02:00
parent 67dcc8b4bb
commit d9e5e75909
7 changed files with 70 additions and 10 deletions

View file

@ -1,6 +1,6 @@
#pragma once
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#ifdef USE_ESP32
#include "display.h"
#include "esphome/core/automation.h"
@ -62,4 +62,4 @@ template<typename... Ts> class SetDemoModeAction : public Action<Ts...> {
} // namespace max6921
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO
#endif // USE_ESP32

View file

@ -1,4 +1,4 @@
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#ifdef USE_ESP32
#include <cinttypes>
#include "esphome/core/hal.h"
@ -950,4 +950,4 @@ DisplayModeT Max6921DisplayMode::set_mode(DisplayModeT mode) {
} // namespace max6921
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO
#endif // USE_ESP32

View file

@ -1,6 +1,6 @@
#pragma once
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#ifdef USE_ESP32
#include <string>
#include <vector>
@ -124,4 +124,4 @@ class Max6921Display : public Max6921DisplayMode {
} // namespace max6921
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO
#endif // USE_ESP32

View file

@ -1,6 +1,6 @@
// Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/MAX6921-MAX6931.pdf
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#ifdef USE_ESP32
#include <cinttypes>
#include "display.h"
@ -95,4 +95,4 @@ void MAX6921Component::set_writer(max6921_writer_t &&writer) { this->writer_ = w
} // namespace max6921
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO
#endif // USE_ESP32

View file

@ -1,6 +1,6 @@
#pragma once
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#ifdef USE_ESP32
#include <string>
#include "esphome/core/automation.h"
@ -50,4 +50,4 @@ class MAX6921Component : public PollingComponent,
} // namespace max6921
} // namespace esphome
#endif // USE_ESP32_FRAMEWORK_ARDUINO
#endif // USE_ESP32

View file

@ -0,0 +1,30 @@
spi:
- id: spi_max6921
clk_pin: 6
mosi_pin: 7
display:
- platform: max6921
load_pin: 8
out_pin_mapping:
seg_to_out_map:
seg_a_pin: 0
seg_b_pin: 2
seg_c_pin: 5
seg_d_pin: 6
seg_e_pin: 4
seg_f_pin: 1
seg_g_pin: 3
seg_p_pin: 7
pos_to_out_map:
# IV18 positions starts at the right side!
pos_0_pin: 15
pos_1_pin: 14
pos_2_pin: 13
pos_3_pin: 16
pos_4_pin: 12
pos_5_pin: 17
pos_6_pin: 11
pos_7_pin: 18
lambda: |-
it.print("01234567");

View file

@ -0,0 +1,30 @@
spi:
- id: spi_max6921
clk_pin: 16
mosi_pin: 17
display:
- platform: max6921
load_pin: 12
out_pin_mapping:
seg_to_out_map:
seg_a_pin: 0
seg_b_pin: 2
seg_c_pin: 5
seg_d_pin: 6
seg_e_pin: 4
seg_f_pin: 1
seg_g_pin: 3
seg_p_pin: 7
pos_to_out_map:
# IV18 positions starts at the right side!
pos_0_pin: 15
pos_1_pin: 14
pos_2_pin: 13
pos_3_pin: 16
pos_4_pin: 12
pos_5_pin: 17
pos_6_pin: 11
pos_7_pin: 18
lambda: |-
it.print("01234567");