ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
pn7150.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome::pn7150 {
6
7static constexpr uint8_t PMU_CFG[] = {
8 0x01, // Number of parameters
9 0xA0, 0x0E, // ext. tag
10 3, // length
11 0x06, // VBAT1 connected to 5V (CFG2)
12 0x64, // TVDD monitoring threshold = 5.0V; TxLDO voltage = 4.7V (in reader & card modes)
13 0x01, // RFU; must be 0x00 for CFG1 and 0x01 for CFG2
14};
15
16static constexpr uint8_t RF_LISTEN_MODE_ROUTING_CONFIG[] = {0x00, // "more" (another message is coming)
17 1, // number of table entries
18 0x01, // type = protocol-based
19 3, // length
20 0, // DH NFCEE ID, a static ID representing the DH-NFCEE
21 0x01, // power state
22 nfc::PROT_ISODEP}; // protocol
23
24class PN7150 : public pn71xx::PN71xx {
25 public:
26 void dump_config() override;
27
28 protected:
29 uint8_t verify_reset(nfc::NciMessage &rx, bool reset_config) override;
30 uint8_t process_init_response(nfc::NciMessage &rx) override;
31 std::span<const uint8_t> pmu_config() const override { return PMU_CFG; }
32 std::span<const uint8_t> listen_mode_routing_config() const override { return RF_LISTEN_MODE_ROUTING_CONFIG; }
33};
34
35} // namespace esphome::pn7150
One NCI packet, held in a fixed buffer so building and reading messages never allocates.
Definition nci_message.h:16
std::span< const uint8_t > pmu_config() const override
Definition pn7150.h:31
uint8_t process_init_response(nfc::NciMessage &rx) override
Definition pn7150.cpp:31
uint8_t verify_reset(nfc::NciMessage &rx, bool reset_config) override
Definition pn7150.cpp:14
std::span< const uint8_t > listen_mode_routing_config() const override
Definition pn7150.h:32
void dump_config() override
Definition pn7150.cpp:9
Common driver for the NXP PN71xx family of NCI NFC controllers.
Definition pn71xx.h:156