34 void setup()
override;
35 void dump_config()
override;
39 bool digital_read(uint8_t pin);
40 uint16_t read_key_data();
41 void set_pin_value(uint8_t pin, uint8_t i_on) { this->write_byte(REG_I_ON[pin], i_on); };
43 void digital_write(uint8_t pin,
bool bit_value);
48 this->has_keypad_ =
true;
50 void set_sleep_time(uint16_t sleep_time) { this->sleep_time_ = sleep_time; };
51 void set_scan_time(uint8_t scan_time) { this->scan_time_ = scan_time; };
52 void set_debounce_time(uint8_t debounce_time = 1) { this->debounce_time_ = debounce_time; };
54 this->keypad_binary_sensors_.push_back(binary_sensor);
56 void setup_led_driver(uint8_t pin);
59 uint32_t clk_x_ = 2000000;
60 uint8_t frequency_ = 0;
61 uint16_t ddr_mask_ = 0x00;
62 uint16_t input_mask_ = 0x00;
63 uint16_t port_mask_ = 0x00;
64 uint16_t output_state_ = 0x00;
65 bool has_keypad_ =
false;
68 uint16_t sleep_time_ = 128;
69 uint8_t scan_time_ = 1;
70 uint8_t debounce_time_ = 1;
73 uint32_t last_loop_timestamp_ = 0;
74 const uint32_t min_loop_period_ = 15;
77 void set_debounce_config_(uint8_t config_value);
78 void set_debounce_time_(uint8_t time);
79 void set_debounce_pin_(uint8_t pin);
80 void set_debounce_enable_(uint8_t pin);
81 void set_debounce_keypad_(uint8_t time, uint8_t num_rows, uint8_t num_cols);
82 void clock_(uint8_t osc_source = 2, uint8_t osc_pin_function = 1, uint8_t osc_freq_out = 0, uint8_t osc_divider = 0);
void register_keypad_binary_sensor(SX1509Processor *binary_sensor)
const uint8_t REG_I_ON[16]
const uint8_t REG_I_ON_10
float get_setup_priority() const override
void set_debounce_time(uint8_t debounce_time=1)
const uint8_t EXTERNAL_CLOCK
virtual void process(uint16_t data)
const uint8_t REG_I_ON_15
const uint8_t INTERNAL_CLOCK_2MHZ
void set_pin_value(uint8_t pin, uint8_t i_on)
void set_sleep_time(uint16_t sleep_time)
std::vector< SX1509Processor * > keypad_binary_sensors_
const uint8_t REG_I_ON_14
const uint8_t REG_I_ON_13
const uint8_t REG_I_ON_12
const uint8_t REG_I_ON_11
esphome::binary_sensor::BinarySensor * binary_sensor
const uint8_t SOFTWARE_RESET
void set_scan_time(uint8_t scan_time)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Implementation of SPI Controller mode.
This Class provides the methods to read/write bytes from/to an i2c device.
void set_rows_cols(uint8_t rows, uint8_t cols)
const uint8_t HARDWARE_RESET