amiro-lld / drivers / PN532 / v1 / alld_PN532.h @ 15f74f80
History | View | Annotate | Download (3.277 KB)
1 | 27eae8ce | Julia Niermann | /*
|
---|---|---|---|
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.h
|
||
21 | * @brief NFC
|
||
22 | *
|
||
23 | 15f74f80 | Julia Niermann | * @addtogroup lld_power //TODO
|
24 | 27eae8ce | Julia Niermann | * @{
|
25 | */
|
||
26 | |||
27 | #ifndef AMIROLLD_PN532_H
|
||
28 | #define AMIROLLD_PN532_H
|
||
29 | |||
30 | #include <amiro-lld.h> |
||
31 | |||
32 | /******************************************************************************/
|
||
33 | /* CONSTANTS */
|
||
34 | /******************************************************************************/
|
||
35 | /**
|
||
36 | * @brief Maximum I2C frequency.
|
||
37 | */
|
||
38 | 15f74f80 | Julia Niermann | #define PN532_LLD_I2C_MAXFREQUENCY 400000 |
39 | 27eae8ce | Julia Niermann | |
40 | /******************************************************************************/
|
||
41 | /* SETTINGS */
|
||
42 | /******************************************************************************/
|
||
43 | |||
44 | /******************************************************************************/
|
||
45 | /* CHECKS */
|
||
46 | /******************************************************************************/
|
||
47 | |||
48 | /******************************************************************************/
|
||
49 | /* DATA STRUCTURES AND TYPES */
|
||
50 | /******************************************************************************/
|
||
51 | |||
52 | /**
|
||
53 | * @brief I2C address masks.
|
||
54 | */
|
||
55 | enum {
|
||
56 | 15f74f80 | Julia Niermann | PN532_LLD_I2C_ADDR_FIXED = 0x0061u, //TODO |
57 | 27eae8ce | Julia Niermann | }; |
58 | |||
59 | /**
|
||
60 | * @brief Registers.
|
||
61 | */
|
||
62 | typedef enum { |
||
63 | 15f74f80 | Julia Niermann | PN532_LLD_REGISTER = 0x0000, //TODO |
64 | }pn532_lld_register_t; |
||
65 | 27eae8ce | Julia Niermann | |
66 | |||
67 | typedef struct { |
||
68 | 15f74f80 | Julia Niermann | apalI2CDriver_t* i2cd; |
69 | apalI2Caddr_t addr; |
||
70 | uint16_t current_lsb_uA; |
||
71 | 27eae8ce | Julia Niermann | } PN532Driver; |
72 | |||
73 | |||
74 | /******************************************************************************/
|
||
75 | /* MACROS */
|
||
76 | /******************************************************************************/
|
||
77 | |||
78 | /******************************************************************************/
|
||
79 | /* EXTERN DECLARATIONS */
|
||
80 | /******************************************************************************/
|
||
81 | |||
82 | #ifdef __cplusplus
|
||
83 | extern "C" { |
||
84 | #endif
|
||
85 | 15f74f80 | Julia Niermann | 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); |
86 | |||
87 | 27eae8ce | Julia Niermann | #ifdef __cplusplus
|
88 | } |
||
89 | #endif
|
||
90 | |||
91 | /******************************************************************************/
|
||
92 | /* INLINE FUNCTIONS */
|
||
93 | /******************************************************************************/
|
||
94 | |||
95 | #endif /* AMIROLLD_PN532_H */ |
||
96 | |||
97 | /** @} */
|