ESPHome  2024.11.0
rc522_spi.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
16 namespace rc522_spi {
17 
18 class RC522Spi : public rc522::RC522,
19  public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
20  spi::DATA_RATE_4MHZ> {
21  public:
22  void setup() override;
23 
24  void dump_config() override;
25 
26  protected:
27  uint8_t pcd_read_register(PcdRegister reg
28  ) override;
29 
35  uint8_t count,
36  uint8_t *values,
37  uint8_t rx_align
38  ) override;
40  uint8_t value
41  ) override;
42 
48  uint8_t count,
49  uint8_t *values
50  ) override;
51 };
52 
53 } // namespace rc522_spi
54 } // namespace esphome
void pcd_write_register(PcdRegister reg, uint8_t value) override
Definition: rc522_spi.cpp:100
uint8_t pcd_read_register(PcdRegister reg) override
Reads a uint8_t from the specified register in the MFRC522 chip.
Definition: rc522_spi.cpp:28
The SPIDevice is what components using the SPI will create.
Definition: spi.h:391
void dump_config() override
Definition: rc522_spi.cpp:19
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7