ESPHome  2022.6.3
remote_transmitter.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace esphome {
7 namespace remote_transmitter {
8 
10  public Component
11 #ifdef USE_ESP32
12  ,
14 #endif
15 {
16  public:
18 
19  void setup() override;
20 
21  void dump_config() override;
22 
23  float get_setup_priority() const override { return setup_priority::DATA; }
24 
25  void set_carrier_duty_percent(uint8_t carrier_duty_percent) { this->carrier_duty_percent_ = carrier_duty_percent; }
26 
27  protected:
28  void send_internal(uint32_t send_times, uint32_t send_wait) override;
29 #ifdef USE_ESP8266
30  void calculate_on_off_time_(uint32_t carrier_frequency, uint32_t *on_time_period, uint32_t *off_time_period);
31 
32  void mark_(uint32_t on_time, uint32_t off_time, uint32_t usec);
33 
34  void space_(uint32_t usec);
35 
36  void await_target_time_();
37  uint32_t target_time_;
38 #endif
39 
40 #ifdef USE_ESP32
41  void configure_rmt_();
42 
43  uint32_t current_carrier_frequency_{UINT32_MAX};
44  bool initialized_{false};
45  std::vector<rmt_item32_t> rmt_temp_;
46  esp_err_t error_code_{ESP_OK};
47  bool inverted_{false};
48 #endif
49  uint8_t carrier_duty_percent_{50};
50 };
51 
52 } // namespace remote_transmitter
53 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:18
void calculate_on_off_time_(uint32_t carrier_frequency, uint32_t *on_time_period, uint32_t *off_time_period)
void set_carrier_duty_percent(uint8_t carrier_duty_percent)
void send_internal(uint32_t send_times, uint32_t send_wait) override
Definition: a4988.cpp:4
void mark_(uint32_t on_time, uint32_t off_time, uint32_t usec)