11 ESP_LOGW(TAG,
"read_nfcc_() timeout waiting for IRQ");
12 return nfc::STATUS_FAILED;
17 return nfc::STATUS_FAILED;
23 return nfc::STATUS_FAILED;
27 if (this->
wait_for_irq_(pn71xx::NFCC_IRQ_CLEAR_TIMEOUT,
false) != nfc::STATUS_OK) {
28 ESP_LOGVV(TAG,
"IRQ still active after read; another message is pending");
30 return nfc::STATUS_OK;
34 const auto encoded = tx.
encode();
36 return nfc::STATUS_OK;
38 return nfc::STATUS_FAILED;
42 PN7160::dump_config();
ErrorCode write(const uint8_t *data, size_t len) const
writes an array of bytes to a device using an I2CBus
optional< std::array< uint8_t, N > > read_bytes_raw()
One NCI packet, held in a fixed buffer so building and reading messages never allocates.
uint8_t get_payload_size(bool recompute=false)
std::span< const uint8_t > encode()
Stamps the payload length into the header and returns the packet ready to send.
void set_payload_size(uint8_t size)
Sets the packet size to the header plus size payload bytes, for a bus driver filling the buffer direc...
uint8_t write_nfcc(nfc::NciMessage &tx) override
uint8_t read_nfcc(nfc::NciMessage &rx, uint16_t timeout) override
void dump_config() override
uint8_t wait_for_irq_(uint16_t timeout=NFCC_DEFAULT_TIMEOUT, bool pin_state=true)
@ ERROR_OK
No error found during execution of method.
ESPHOME_LOG_TAG(TAG, "pn7160_i2c")