mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02:00
0059a6de46
* Move pn532 -> pn532_spi Add pn532_i2c * Update i2c address * Always wait for ready byte before reading * Generalise the pn532 a bit more so less code in i2c and spi implementations * clang * Add pn532_i2c to test1 * Try to get setup working * Fixes * More updates * Command consts * A few upgrades * Change text back to include 'new' * Fix data reading
21 lines
477 B
C++
21 lines
477 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/pn532/pn532.h"
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
namespace esphome {
|
|
namespace pn532_i2c {
|
|
|
|
class PN532I2C : public pn532::PN532, public i2c::I2CDevice {
|
|
public:
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
bool write_data(const std::vector<uint8_t> &data) override;
|
|
bool read_data(std::vector<uint8_t> &data, uint8_t len) override;
|
|
};
|
|
|
|
} // namespace pn532_i2c
|
|
} // namespace esphome
|