34#define PN512_SPI_ADDR_R(x) ((1<<7) | ((x) << 1))
35#define PN512_SPI_ADDR_W(x) ((0<<7) | ((x) << 1))
37void pn512_hw_init(
pn512_t *pPN512);
45static inline void pn512_hw_write(
pn512_t *pPN512, uint8_t addr, uint8_t *buf,
size_t len)
56static inline void pn512_hw_read(
pn512_t *pPN512, uint8_t addr, uint8_t *buf,
size_t len)
61static inline void pn512_hw_write_buffer(
pn512_t *pPN512, uint8_t addr,
ac_buffer_t *pData,
size_t len)
77 if (ac_buffer_builder_writable(pData) == 0) {
81 size_t cpyLen = MIN(len, ac_buffer_builder_space(pData));
82 nfc_transport_read(((
nfc_transceiver_t *)pPN512)->pTransport, addr, ac_buffer_builder_write_position(pData), cpyLen);
const uint8_t * ac_buffer_reader_current_buffer_pointer(ac_buffer_t *pBuf)
Get a pointer to the current position within this buffer's current backing array.
size_t ac_buffer_reader_readable(const ac_buffer_t *pBuf)
Get number of bytes readable from buffer.
void ac_buffer_builder_write_n_skip(ac_buffer_builder_t *pBuilder, size_t size)
Skip n-bytes in ac_buffer builder.
void ac_buffer_read_n_skip(ac_buffer_t *pBuf, size_t size)
Skip n bytes from buffer reader and advance read posiion.
size_t ac_buffer_reader_current_buffer_length(ac_buffer_t *pBuf)
Get the number of bytes readable within the current backing array.