#pragma once #include "esphome/components/cc1101/cc1101.h" #include "esphome/components/cc1101/cc1101defs.h" namespace esphome { namespace cc1101 { static const char *const TAG = "mycc1101"; class MyCC1101Component : public CC1101Component { public: void idle() { ESP_LOGD(TAG, "idle"); this->send_(Command::IDLE); } void power_down() { ESP_LOGD(TAG, "power_down"); this->send_(Command::IDLE); this->send_(Command::PWD); } void wakeup() { ESP_LOGD(TAG, "wakeup"); this->cs_->digital_write(false); delayMicroseconds(10); this->cs_->digital_write(true); delayMicroseconds(200); this->send_(Command::IDLE); // set patable after after wakeup this->set_output_power(this->output_power_requested_); } }; } // namespace cc1101 } // namespace esphome