ESPHome  2024.10.2
pn7160_spi.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #include <vector>
9 
10 namespace esphome {
11 namespace pn7160_spi {
12 
13 static const uint8_t TDD_SPI_READ = 0xFF;
14 static const uint8_t TDD_SPI_WRITE = 0x0A;
15 
16 class PN7160Spi : public pn7160::PN7160,
17  public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
18  spi::DATA_RATE_4MHZ> {
19  public:
20  void setup() override;
21 
22  void dump_config() override;
23 
24  protected:
25  uint8_t read_nfcc(nfc::NciMessage &rx, uint16_t timeout) override;
26  uint8_t write_nfcc(nfc::NciMessage &tx) override;
27 };
28 
29 } // namespace pn7160_spi
30 } // namespace esphome
uint8_t write_nfcc(nfc::NciMessage &tx) override
Definition: pn7160_spi.cpp:40
The SPIDevice is what components using the SPI will create.
Definition: spi.h:391
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t read_nfcc(nfc::NciMessage &rx, uint16_t timeout) override
Definition: pn7160_spi.cpp:15