amiro-lld / drivers / PN532 / v1 / alld_PN532.c @ 15f74f80
History | View | Annotate | Download (3.234 KB)
1 |
/*
|
---|---|
2 |
AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
|
3 |
Copyright (C) 2016..2019 Thomas Schöpping et al.
|
4 |
|
5 |
This program is free software: you can redistribute it and/or modify
|
6 |
it under the terms of the GNU Lesser General Public License as published by
|
7 |
the Free Software Foundation, either version 3 of the License, or
|
8 |
(at your option) any later version.
|
9 |
|
10 |
This program is distributed in the hope that it will be useful,
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
GNU Lesser General Public License for more details.
|
14 |
|
15 |
You should have received a copy of the GNU Lesser General Public License
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
*/
|
18 |
|
19 |
/**
|
20 |
* @file alld_PN532.c
|
21 |
*
|
22 |
* @brief NFC
|
23 |
*
|
24 |
* @addtogroup lld_power //TODO
|
25 |
* @{
|
26 |
*/
|
27 |
|
28 |
#include <alld_PN532.h> |
29 |
|
30 |
/******************************************************************************/
|
31 |
/* LOCAL DEFINITIONS */
|
32 |
/******************************************************************************/
|
33 |
|
34 |
/******************************************************************************/
|
35 |
/* EXPORTED VARIABLES */
|
36 |
/******************************************************************************/
|
37 |
|
38 |
/******************************************************************************/
|
39 |
/* LOCAL TYPES */
|
40 |
/******************************************************************************/
|
41 |
|
42 |
/******************************************************************************/
|
43 |
/* LOCAL VARIABLES */
|
44 |
/******************************************************************************/
|
45 |
|
46 |
/******************************************************************************/
|
47 |
/* LOCAL FUNCTIONS */
|
48 |
/******************************************************************************/
|
49 |
|
50 |
/******************************************************************************/
|
51 |
/* EXPORTED FUNCTIONS */
|
52 |
/******************************************************************************/
|
53 |
|
54 |
/**
|
55 |
* @brief Read the value of one or more of the registers.
|
56 |
* @param[in] i2cd i2c driver
|
57 |
* @param[in] PRd pn532 driver
|
58 |
* @param[in] addr register address
|
59 |
* @param[out] data register content
|
60 |
* @param[in] num number of subsequent registers to read
|
61 |
* @param[in] timeout timeout
|
62 |
* @return An indicator whether the call was successfull
|
63 |
*/
|
64 |
apalExitStatus_t pn532_lld_read_register(const PN532Driver* const pn532, const pn532_lld_register_t addr, uint8_t* const data, const uint8_t num, const apalTime_t timeout) |
65 |
{ |
66 |
apalDbgAssert(pn532 != NULL);
|
67 |
apalDbgAssert(pn532->i2cd != NULL);
|
68 |
apalDbgAssert(data != NULL);
|
69 |
|
70 |
uint8_t tx[2] = {(addr & 0xFF00) >> 8, addr & 0x00FF}; |
71 |
|
72 |
apalExitStatus_t status = apalI2CMasterTransmit(pn532->i2cd, (PN532_LLD_I2C_ADDR_FIXED | pn532->addr), tx, 2, data, num, timeout);
|
73 |
|
74 |
return status;
|
75 |
} |
76 |
|
77 |
//TODO funktions
|
78 |
|
79 |
/** @} */
|
80 |
|
81 |
|