5#if defined(USE_LIBRETINY) || defined(USE_ESP8266) || defined(USE_RP2040) || (defined(USE_ESP32) && !SOC_RMT_SUPPORTED)
9static const char *
const TAG =
"remote_transmitter";
18 "Remote Transmitter:\n"
19 " Carrier Duty: %u%%",
21 LOG_PIN(
" Pin: ", this->
pin_);
25 uint32_t *off_time_period) {
26 if (carrier_frequency == 0) {
31 uint32_t period = (1000000UL + carrier_frequency / 2) / carrier_frequency;
32 period = std::max(uint32_t(1), period);
34 *off_time_period = period - *on_time_period;
38 const uint32_t current_time =
micros();
41 }
else if ((int32_t) (this->
target_time_ - current_time) > 0) {
81 ESP_LOGD(TAG,
"Sending remote code");
82 uint32_t on_time, off_time;
86 for (uint32_t i = 0; i < send_times; i++) {
90 const auto length = uint32_t(item);
93 const auto length = uint32_t(-item);
101 if (i + 1 < send_times)
void feed_wdt(uint32_t time=0)
virtual void digital_write(bool value)=0
Helper class to disable interrupts.
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
uint32_t get_carrier_frequency() const
const RawTimings & get_data() const
RemoteTransmitData temp_
Use same vector for all transmits, avoids many allocations.
void send_internal(uint32_t send_times, uint32_t send_wait) override
void calculate_on_off_time_(uint32_t carrier_frequency, uint32_t *on_time_period, uint32_t *off_time_period)
Trigger complete_trigger_
void mark_(uint32_t on_time, uint32_t off_time, uint32_t usec)
Trigger transmit_trigger_
void space_(uint32_t usec)
void await_target_time_()
void digital_write(bool value)
uint8_t carrier_duty_percent_
void dump_config() override
uint32_t IRAM_ATTR HOT micros()
Application App
Global storage of Application pointer - only one Application can exist.