# Coolix IR RMT Component for ESP-IDF
This is a lightweight, high-performance ESP-IDF component for transmitting **Coolix IR protocol** signals using the ESP32's **RMT (Remote Control)** peripheral.
It is designed for modern ESP-IDF versions (v5.0+) and specifically tested on the **ESP32-C6**, making it ideal for low-power Matter-over-Thread or Wi-Fi AC controllers.
## 🌡️ Compatibility
The **Coolix** protocol is a 24-bit infrared signaling system widely used by **Midea** and its numerous rebadged brands. If your Air Conditioner remote looks like a standard Midea remote, there is a high probability this library will work.
### Supported Brands (Commonly Midea-based):
* **Midea** (Primary manufacturer)
* **Comfee**
* **Carrier** (most residential split units)
* **Beko**
* **Bosch** (certain split models)
* **Airwell**
* **Qlima**
* **GAir**
* **Frigidaire**
* **Danby**
* **Delonghi**
* **Electrolux** (various regional models)
* **Philco**
* **Lennox** (mini-splits)
* **Toshiba** (older residential units)
## 🚀 Features
* **Native RMT Driver:** Uses the ESP-IDF `driver/rmt_tx.h` for hardware-accurate timings.
* **Non-Blocking:** Transmission is handled by hardware, allowing your main application (like Matter or HomeKit) to stay responsive.
* **Automatic Bit Inversion:** Implements the mandatory Coolix logic where each data byte is followed by its bitwise inverse for error checking.
* **38kHz Carrier:** Pre-configured carrier frequency for maximum compatibility with standard IR receivers.
## 🛠️ Technical Details
* **Protocol Type:** 24-bit (transmitted as 3 bytes + 3 inverted bytes).
* **Carrier Frequency:** 38kHz.
* **Duty Cycle:** 33%.
* **Header:** 4900µs Mark, 4400µs Space.
* **Bit Mark:** 540µs.
* **Bit Space:** 1620µs (Logic 1), 540µs (Logic 0).
## 📥 Installation
1. Copy the `coolix_rmt` folder into your project's `components` directory.
2. In your `main/CMakeLists.txt`, ensure you require the component:
```cmake
idf_component_register(SRCS "main.c" PRIV_REQUIRES coolix_rmt)
```
## 💻 Usage Example
```c
#include "ir_coolix_rmt.h"
rmt_channel_handle_t ir_chan = NULL;
void app_main() {
// 1. Initialize the IR component on GPIO 14
ir_coolix_rmt_init(14, &ir_chan);
// 2. Send a Coolix command (e.g., Power ON / 25°C / Auto)
// Example code: 0xB27BE0
uint32_t coolix_code = 0xB27BE0;
ir_coolix_rmt_send(ir_chan, coolix_code);
ESP_LOGI("APP", "IR Command Sent: 0x%06lX", coolix_code);
}
```
## ⚖️ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
idf.py add-dependency "aaronsix1/coolix_rmt^1.0.0"