nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
st25r3911b_spi.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef ST25R3911B_SPI_H_
8#define ST25R3911B_SPI_H_
9
10#include <stddef.h>
11#include <zephyr/types.h>
12#include <zephyr/sys/util.h>
13
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27#define ST25R3911B_MAX_FIFO_LEN 96
28
38
54int st25r3911b_multiple_reg_write(uint8_t start_reg, uint8_t *val,
55 size_t len);
56
65static inline int st25r3911b_reg_write(uint8_t reg, uint8_t val)
66{
67 return st25r3911b_multiple_reg_write(reg, &val, 1);
68}
69
86int st25r3911b_multiple_reg_read(uint8_t start_reg, uint8_t *val, size_t len);
87
96static inline int st25r3911b_reg_read(uint8_t reg, uint8_t *val)
97{
98 return st25r3911b_multiple_reg_read(reg, val, 1);
99}
100
110int st25r3911b_cmd_execute(uint8_t cmd);
111
127int st25r3911b_reg_modify(uint8_t reg, uint8_t clr_mask, uint8_t set_mask);
128
140int st25r3911b_fifo_read(uint8_t *data, size_t length);
141
153int st25r3911b_fifo_write(uint8_t *data, size_t length);
154
155#ifdef __cplusplus
156}
157#endif
158
163#endif /* ST25R3911B_SPI_H_ */
int st25r3911b_spi_init(void)
Initialize ST25R3911B NFC Reader SPI hardware interface.
static int st25r3911b_reg_write(uint8_t reg, uint8_t val)
Write a single NFCA Reader register.
Definition: st25r3911b_spi.h:65
static int st25r3911b_reg_read(uint8_t reg, uint8_t *val)
Read a single NFC Reader register.
Definition: st25r3911b_spi.h:96
int st25r3911b_fifo_write(uint8_t *data, size_t length)
Write NFC Reader FIFO data.
int st25r3911b_multiple_reg_write(uint8_t start_reg, uint8_t *val, size_t len)
Write multiple NFC Reader registers.
int st25r3911b_cmd_execute(uint8_t cmd)
Execute an NFC Reader direct command.
int st25r3911b_multiple_reg_read(uint8_t start_reg, uint8_t *val, size_t len)
Read multiple NFC Reader registers.
int st25r3911b_reg_modify(uint8_t reg, uint8_t clr_mask, uint8_t set_mask)
Modify a single NFC Reader register.
int st25r3911b_fifo_read(uint8_t *data, size_t length)
Read NFC Reader FIFO data.