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();
77 ESP_LOGD(TAG,
"Sending remote code...");
78 uint32_t on_time, off_time;
81 for (uint32_t i = 0; i < send_times; i++) {
85 const auto length = uint32_t(item);
88 const auto length = uint32_t(-item);
96 if (i + 1 < send_times)
97 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.
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 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.
uint8_t carrier_duty_percent_
Implementation of SPI Controller mode.
const RawTimings & get_data() const
void mark_(uint32_t on_time, uint32_t off_time, uint32_t usec)