diff --git a/esphome/components/max6921/automation.h b/esphome/components/max6921/automation.h index d2eec7b9fe..ff50364fdb 100644 --- a/esphome/components/max6921/automation.h +++ b/esphome/components/max6921/automation.h @@ -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 class SetDemoModeAction : public Action { } // namespace max6921 } // namespace esphome -#endif // USE_ESP32_FRAMEWORK_ARDUINO +#endif // USE_ESP32 diff --git a/esphome/components/max6921/display.cpp b/esphome/components/max6921/display.cpp index d5245192af..a53825f903 100644 --- a/esphome/components/max6921/display.cpp +++ b/esphome/components/max6921/display.cpp @@ -1,4 +1,4 @@ -#ifdef USE_ESP32_FRAMEWORK_ARDUINO +#ifdef USE_ESP32 #include #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 diff --git a/esphome/components/max6921/display.h b/esphome/components/max6921/display.h index da771fe776..b9228c5e8f 100644 --- a/esphome/components/max6921/display.h +++ b/esphome/components/max6921/display.h @@ -1,6 +1,6 @@ #pragma once -#ifdef USE_ESP32_FRAMEWORK_ARDUINO +#ifdef USE_ESP32 #include #include @@ -124,4 +124,4 @@ class Max6921Display : public Max6921DisplayMode { } // namespace max6921 } // namespace esphome -#endif // USE_ESP32_FRAMEWORK_ARDUINO +#endif // USE_ESP32 diff --git a/esphome/components/max6921/max6921.cpp b/esphome/components/max6921/max6921.cpp index f54d5dc0a0..b29bc7a5c9 100644 --- a/esphome/components/max6921/max6921.cpp +++ b/esphome/components/max6921/max6921.cpp @@ -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 #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 diff --git a/esphome/components/max6921/max6921.h b/esphome/components/max6921/max6921.h index b9c3f02707..4131f202db 100644 --- a/esphome/components/max6921/max6921.h +++ b/esphome/components/max6921/max6921.h @@ -1,6 +1,6 @@ #pragma once -#ifdef USE_ESP32_FRAMEWORK_ARDUINO +#ifdef USE_ESP32 #include #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 diff --git a/tests/components/max6921/test.esp32-c3-idf.yaml b/tests/components/max6921/test.esp32-c3-idf.yaml new file mode 100644 index 0000000000..ed944401ba --- /dev/null +++ b/tests/components/max6921/test.esp32-c3-idf.yaml @@ -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"); diff --git a/tests/components/max6921/test.esp32-idf.yaml b/tests/components/max6921/test.esp32-idf.yaml new file mode 100644 index 0000000000..52da916762 --- /dev/null +++ b/tests/components/max6921/test.esp32-idf.yaml @@ -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");