21 ESP_LOGCONFIG(TAG,
"PN7160:");
22 PN71xx::dump_config();
35 delay(pn71xx::NFCC_RESET_DELAY);
41 if (this->
read_nfcc(rx, pn71xx::NFCC_INIT_TIMEOUT) != nfc::STATUS_OK) {
42 ESP_LOGE(TAG,
"Reset notification was not received");
43 return nfc::STATUS_FAILED;
46 (rx.
get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET] != 0x02) ||
47 (rx.
get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 1] != (uint8_t) reset_config)) {
48 char buf[nfc::FORMAT_BYTES_BUFFER_SIZE];
50 return nfc::STATUS_FAILED;
57 "Configuration %s, NCI version: 0x%02X, Manufacturer ID: 0x%02X\n"
58 " Hardware version: %u\n"
59 " ROM code version: %u\n"
60 " FLASH major version: %u\n"
61 " FLASH minor version: %u",
62 ntf[4] ? LOG_STR_LITERAL(
"reset") : LOG_STR_LITERAL(
"retained"), ntf[5], ntf[6], ntf[8], ntf[9], ntf[10],
65 return nfc::STATUS_OK;
71 char feat_buf[nfc::FORMAT_BYTES_BUFFER_SIZE];
virtual void digital_write(bool value)=0
One NCI packet, held in a fixed buffer so building and reading messages never allocates.
bool message_type_is(uint8_t message_type) const
bool message_length_is(uint8_t message_length, bool recompute=false)
std::span< const uint8_t > get_payload() const
The payload bytes that follow the header.
uint8_t get_simple_status_response() const
void dump_config() override
void prepare_reset() override
uint8_t verify_reset(nfc::NciMessage &rx, bool reset_config) override
uint8_t process_init_response(nfc::NciMessage &rx) override
virtual uint8_t read_nfcc(nfc::NciMessage &rx, uint16_t timeout)=0
char * format_bytes_to(char *buffer, std::span< const uint8_t > bytes)
Format bytes to buffer with ' ' separator (e.g., "04 11 22 33"). Returns buffer for inline use.
ESPHOME_LOG_TAG(TAG, "pn7160")
void HOT delay(uint32_t ms)