Merge branch 'haext-ESP32IDFPortIndexing'
This commit is contained in:
@@ -42,7 +42,7 @@ dmx512:
|
||||
* `uart_id`: Set this to the ID of your UART component
|
||||
* `enable_pin`: Set this to the pin number the MAX585 enable pins are connected to. Optional
|
||||
* `tx_pin`: Set this to the same pin number as the UART component. This is required for the generation of the break signal. Defaults to GPIO5. If ESPHome >= 2023.12.0 is used, the option `allow_other_uses` has to be set to `true` (here and in the UART component).
|
||||
* `uart_num`: Set this to the internal ESP32 UART number. If only logging is configured, this should be set to 1 (default).
|
||||
* `uart_num`: Set this to the internal ESP32 UART number. If only logging is configured, this should be set to 1 (default). (Note some ESP32 boards don't have 3 UARTs, check the datasheet of your board if using a different one.)
|
||||
* `periodic_update`: If set to false, only state changes are transmitted and the bus is silent in between - violates the specification and may cause some dimmers to turn off
|
||||
* `force_full_frames`: If set to true, the full 513-byte frame is always sent. Otherwise, only the configured channels are transmitted.
|
||||
* `custom_mab_len`: Set a custom mark-after-break length (in uS, default 12)
|
||||
|
||||
@@ -19,8 +19,10 @@ class DMX512ESP32 : public DMX512 {
|
||||
this->uart_idx_ = U0TXD_OUT_IDX;
|
||||
} else if(num == 1) {
|
||||
this->uart_idx_ = U1TXD_OUT_IDX;
|
||||
#ifdef U2TXD_OUT_IDX
|
||||
} else if(num == 2) {
|
||||
this->uart_idx_ = U2TXD_OUT_IDX;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace dmx512 {
|
||||
static const char *TAG = "dmx512";
|
||||
|
||||
void DMX512ESP32IDF::send_break() {
|
||||
uart_set_line_inverse(this->uart_idx_, UART_SIGNAL_TXD_INV);
|
||||
uart_set_line_inverse((uart_port_t)this->uart_idx_, UART_SIGNAL_TXD_INV);
|
||||
delayMicroseconds(this->break_len_);
|
||||
uart_set_line_inverse(this->uart_idx_, UART_SIGNAL_INV_DISABLE);
|
||||
uart_set_line_inverse((uart_port_t)this->uart_idx_, UART_SIGNAL_INV_DISABLE);
|
||||
delayMicroseconds(this->mab_len_);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user