9 #ifdef USE_BINARY_SENSOR 16 static const uint8_t DIRECT_COMMAND = 0x96;
17 static const uint8_t ANTFREQ = 3;
70 #ifdef USE_BINARY_SENSOR 71 SUB_BINARY_SENSOR(thunder_alert)
75 void setup()
override;
76 void dump_config()
override;
77 float get_setup_priority()
const override;
82 void set_indoor(
bool indoor) {
indoor_ = indoor; }
83 void write_indoor(
bool indoor);
84 void set_noise_level(uint8_t noise_level) {
noise_level_ = noise_level; }
85 void write_noise_level(uint8_t noise_level);
86 void set_watchdog_threshold(uint8_t watchdog_threshold) {
watchdog_threshold_ = watchdog_threshold; }
87 void write_watchdog_threshold(uint8_t watchdog_threshold);
88 void set_spike_rejection(uint8_t spike_rejection) {
spike_rejection_ = spike_rejection; }
89 void write_spike_rejection(uint8_t write_spike_rejection);
90 void set_lightning_threshold(uint8_t lightning_threshold) {
lightning_threshold_ = lightning_threshold; }
91 void write_lightning_threshold(uint8_t lightning_threshold);
92 void set_mask_disturber(
bool mask_disturber) {
mask_disturber_ = mask_disturber; }
93 void write_mask_disturber(
bool enabled);
94 void set_div_ratio(uint8_t div_ratio) {
div_ratio_ = div_ratio; }
95 void write_div_ratio(uint8_t div_ratio);
96 void set_capacitance(uint8_t capacitance) {
capacitance_ = capacitance; }
97 void write_capacitance(uint8_t capacitance);
98 uint8_t read_div_ratio();
99 uint8_t read_capacitance();
100 bool calibrate_oscillator();
101 void display_oscillator(
bool state, uint8_t osc);
103 void set_tune_antenna(
bool tune_antenna) {
tune_antenna_ = tune_antenna; }
104 void set_calibration(
bool calibration) {
calibration_ = calibration; }
115 virtual void write_register(uint8_t reg, uint8_t mask, uint8_t bits, uint8_t start_position) = 0;
virtual void write_register(uint8_t reg, uint8_t mask, uint8_t bits, uint8_t start_position)=0
uint8_t get_distance_to_storm_()
uint8_t watchdog_threshold_
uint32_t get_lightning_energy_()
virtual uint8_t read_register(uint8_t reg)=0
uint8_t read_register_(uint8_t reg, uint8_t mask)
virtual void setup()
Where the component's initialization should happen.
uint8_t read_interrupt_register_()
uint8_t lightning_threshold_
Implementation of SPI Controller mode.