8 namespace remote_transmitter {
10 static const char *
const TAG =
"remote_transmitter";
18 ESP_LOGCONFIG(TAG,
"Remote Transmitter...");
20 LOG_PIN(
" Pin: ", this->
pin_);
24 uint32_t *off_time_period) {
25 if (carrier_frequency == 0) {
30 uint32_t period = (1000000UL + carrier_frequency / 2) / carrier_frequency;
31 period = std::max(uint32_t(1), period);
33 *off_time_period = period - *on_time_period;
37 const uint32_t current_time =
micros();
75 ESP_LOGD(TAG,
"Sending remote code...");
76 uint32_t on_time, off_time;
80 for (uint32_t i = 0; i < send_times; i++) {
83 const auto length = uint32_t(item);
86 const auto length = uint32_t(-item);
94 if (i + 1 < send_times)
95 this->target_time_ += send_wait;
virtual void digital_write(bool value)=0
void await_target_time_()
RemoteTransmitData temp_
Use same vector for all transmits, avoids many allocations.
Trigger * transmit_trigger_
uint32_t get_carrier_frequency() const
void space_(uint32_t usec)
void calculate_on_off_time_(uint32_t carrier_frequency, uint32_t *on_time_period, uint32_t *off_time_period)
uint32_t IRAM_ATTR HOT micros()
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
void dump_config() override
void send_internal(uint32_t send_times, uint32_t send_wait) override
Application App
Global storage of Application pointer - only one Application can exist.
Trigger * complete_trigger_
uint8_t carrier_duty_percent_
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
const RawTimings & get_data() const
void mark_(uint32_t on_time, uint32_t off_time, uint32_t usec)