13 class RC522BinarySensor;
17 void setup()
override;
258 void set_uid(
const std::vector<uint8_t> &uid) { uid_ = uid; }
260 bool process(std::vector<uint8_t> &data);
264 this->publish_state(
false);
266 this->found_ =
false;
276 void process(std::vector<uint8_t> &data);
void pcd_reset_()
Performs a soft reset on the MFRC522 chip and waits for it to be ready again.
void pcd_set_register_bit_mask_(PcdRegister reg, uint8_t mask)
Sets the bits given in mask in register reg.
uint8_t buffer_[9]
buffer for communication, the first bits [0..back_idx-1] are for tx , [back_idx..back_idx+back_len] f...
float get_setup_priority() const override
const float DATA
For components that import data from directly connected sensors like DHT.
std::vector< RC522Trigger * > triggers_ontag_
void pcd_transceive_data_(uint8_t send_len)
Transfers data to the MFRC522 FIFO, executes a command, waits for completion and transfers data back ...
virtual void pcd_write_register(PcdRegister reg, uint8_t value)=0
void set_reset_pin(GPIOPin *reset)
void dump_config() override
This class simplifies creating components that periodically check a state.
uint8_t back_length_
In: Max number of uint8_ts to write to *backData. Out: The number of uint8_ts returned.
void pcd_calculate_crc_(uint8_t *data, uint8_t length)
Use the CRC coprocessor in the MFRC522 to calculate a CRC_A.
std::vector< RC522Trigger * > triggers_ontagremoved_
uint32_t awaiting_comm_time_
std::vector< uint8_t > uid_
void register_ontag_trigger(RC522Trigger *trig)
enum esphome::rc522::RC522::RC522Error NONE
void pcd_antenna_off_()
Turns the antenna off by disabling pins TX1 and TX2.
enum esphome::rc522::RC522::State STATE_NONE
Implementation of SPI Controller mode.
std::vector< uint8_t > current_uid_
Base class for all binary_sensor-type classes.
StatusCode await_transceive_()
virtual uint8_t pcd_read_register(PcdRegister reg)=0
void register_tag(RC522BinarySensor *tag)
void pcd_antenna_on_()
Turns the antenna on by enabling pins TX1 and TX2.
void pcd_clear_register_bit_mask_(PcdRegister reg, uint8_t mask)
Clears the bits given in mask from register reg.
void set_uid(const std::vector< uint8_t > &uid)
void register_ontagremoved_trigger(RC522Trigger *trig)
std::vector< RC522BinarySensor * > binary_sensors_