Skip to content

Add initial NFC support to Mbed OS #7822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
8d03c55
Adding initial API
Aug 3, 2018
04304e0
Added nfc_tag_type() and fixed some const qualifiers
Aug 3, 2018
18b2bb3
Move nfc_tag_type_t to NFCDefinitions.h
Aug 3, 2018
da4842d
Remove redundant boolean parameters in NDEF Capable
Aug 3, 2018
3321a59
NFCTarget should not inherit from NFCEndpoint
Aug 3, 2018
1d61ab6
Missing end of comment
Aug 3, 2018
0e9e2fd
Add has_started_session() in NFC EEPROM driver delegate
Aug 3, 2018
5ae65aa
Simplify NFCNDEFCapable.h
Aug 7, 2018
2ff14df
Finish renaming NFCRemoteEndpoint.h
Aug 7, 2018
2fb635a
Add get_supported_rf_protocols() method to driver
Aug 7, 2018
37263c3
Add doc to NFCController
Aug 7, 2018
39879b7
Amend NFCControllerDriver API and add documentation
Aug 7, 2018
b0f1f43
Add doc for NFCTarget
Aug 7, 2018
717b2f5
Add doc for NFCEEPROMDriver and amend API slightly
Aug 7, 2018
97f72ca
Add doc for NFCRemoteEndpoint
Aug 7, 2018
f6a0cb3
Add doc and amend API of NFCNDEFCapable
Aug 7, 2018
b14e18d
Add documemtation for ISO7816App
Aug 8, 2018
2db8f86
Add doc for NFCRemoteInitiator
Aug 8, 2018
3cd3efe
Fix NFCEEPROM's destructor
Aug 8, 2018
2246535
Update API/doc for NFCNDEFCapable
Aug 9, 2018
b2cbdb5
Add doc/update API for NFCTarget
Aug 9, 2018
5691a66
Update doc/API for Type4RemoteInitiator
Aug 9, 2018
cd7f518
Add NFC Stack
Aug 13, 2018
d5201f0
Add basis for NFC Controller implementation
Aug 14, 2018
db2cdf0
Use SharedPtr class for detected endpoints
Aug 14, 2018
fdd8d0b
Implement NFCNDEFCapable
Aug 14, 2018
d4c2920
Type 4 Target and dependencies implementation
Aug 15, 2018
5fa2774
Implement PN512 SPI transport driver
Aug 16, 2018
9056f29
Add PN512 Driver implementation
Aug 16, 2018
8c4e4d8
Add scheduler implementation to NFC Controller class
Aug 16, 2018
a4a8ee1
Update NFC EEPROM Driver and add implementation
Aug 16, 2018
28fad6b
Update NFC EEPROM Driver + Delegate API names
Aug 16, 2018
5a9cab2
Writing implementation in NFC EEPROM
Aug 16, 2018
9fcca78
Erase & Read implementations in NFCEEPROM
Aug 17, 2018
6a0cbff
Fix API signatures
Aug 17, 2018
3b8413a
Fix virtualness of NFCControllerDriver::Delegate method
Aug 17, 2018
928115b
Missing inheritance in NFCController
Aug 17, 2018
1dfeafd
Missing =0 in NFCEEPROMDriver
Aug 17, 2018
d63a36c
Some missing virtual qualifiers
Aug 17, 2018
ce39e77
Missing change in NFCRemoteInitiator
Aug 17, 2018
0e2484f
Astyle formatting
Aug 21, 2018
3970f5f
Expose Event Queue to NFCEEPROMDriver
Aug 21, 2018
483fcdf
Fix a bunch of compilation issues, thanks @pan-
Aug 21, 2018
f0b0762
Prefix acore lib files with ac_ to avoid include clashes
Aug 22, 2018
2568725
Fix compilation issues in NFC stack
Aug 22, 2018
3f31a95
Fix compilation issues in NFC framework
Aug 22, 2018
6eb99d6
NFC: Add a few missing method implementations and run astyle
Aug 22, 2018
1e01fed
nfc eeprom driver green tea test
paul-szczepanek-arm Aug 22, 2018
f548de1
check size was set
paul-szczepanek-arm Aug 22, 2018
8cfe61d
added check for running out of steps
paul-szczepanek-arm Aug 22, 2018
21c5132
added test for writing and reading outside set size
paul-szczepanek-arm Aug 22, 2018
5513d29
simplify command to function call translation
paul-szczepanek-arm Aug 22, 2018
17b5e2e
require EEPROM define to eclude from CI builds
paul-szczepanek-arm Aug 22, 2018
e7b2ec3
Enable NFC debug
Aug 22, 2018
1f1f5f1
NFC Stack: ISO7816 now uses the 'repolling' mechanism of ISODEP modul…
Aug 23, 2018
8305737
Fixes in NFC framework
Aug 23, 2018
7a473ed
Fix doxygen issues in acore
Aug 23, 2018
5c24c4d
NFC: Fix doxygen issues
Aug 23, 2018
9cf8eed
NFC: Fix IAR compilation issues
Aug 23, 2018
fb5a0a3
NFC: Fix more IAR compilation issues
Aug 23, 2018
79170d3
Use nfc_tech_iso7816_app_t directly to handle ISO7816 applications
Aug 24, 2018
61445cc
Amend doxygen options to ignore NFC stack
Aug 24, 2018
dcf38ee
NFC: Add NDEF message framework.
pan- Aug 24, 2018
b985b2c
NFC: Integrate nfc targets with Span
pan- Aug 24, 2018
3dda860
Ndef types: Add functions that convert a C-string into a span consuma…
pan- Aug 24, 2018
3770cfb
NDEF types: mention the function span_from_cstr in functions acceptin…
pan- Aug 24, 2018
684b3ca
NDEF: Move common types into the namespace ndef::common
pan- Aug 24, 2018
6c4fe20
NFC - NDEF: Improve header inclusion
pan- Aug 24, 2018
8e8ce97
Run astyle
Aug 24, 2018
d144d8b
NFC: Fix doxygen documentation.
pan- Aug 27, 2018
9e0c08b
Do not allocate initiator if not required in NFCController::polling_c…
Aug 28, 2018
66850be
Fix NFCEEPROM erasing flow
Aug 28, 2018
681811e
NFCController::Delegate's destructor does not need to be virtual
Aug 28, 2018
bfe4c74
Address @ithinuel's comments
Aug 28, 2018
b5bfcc3
Address @paul-szczepanek-arm's comments
Aug 28, 2018
b6e6043
NFC: Add payload builder into ndef::MessageBuilder
pan- Aug 28, 2018
cffc022
NFC: Add get_record_size in common types.
pan- Aug 28, 2018
9a3b64b
NFC: Add const qualifier to append_as_record function of ndef common …
pan- Aug 28, 2018
0fa481a
NFC: Fix invalid access to an empty text record.
pan- Aug 28, 2018
ab810b2
NFC: Fix astyle nonsense.
pan- Aug 28, 2018
97a4e02
NFC: Fix missing doc in ndef::MessageBuilder
pan- Aug 28, 2018
e75ca75
EEPROM driver signature fixed
paul-szczepanek-arm Aug 29, 2018
57b6cca
fixed define name for test
paul-szczepanek-arm Aug 29, 2018
64d65fd
interface methods made public
paul-szczepanek-arm Aug 29, 2018
bfd4339
Re-run astyle
Aug 29, 2018
895ef34
NFC: Use string instead of cstring header.
pan- Aug 29, 2018
913f219
Span: Fix type used in is_convertible traits.
pan- Aug 29, 2018
3fa0c5e
Fixed IAR warnings in NFC stack
Aug 29, 2018
1252590
Address ARMCC warnings and make sure targets have SPI and InterruptIn…
Aug 29, 2018
a239c5e
Fix some remainings ARMCC warnings
Aug 29, 2018
be5527b
fix gt test
paul-szczepanek-arm Aug 30, 2018
f3c3abd
removed unnecessary headers
paul-szczepanek-arm Aug 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
499 changes: 499 additions & 0 deletions TESTS/nfc/eeprom/main.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doxygen_options.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"EXPAND_AS_DEFINED": "",
"SKIP_FUNCTION_MACROS": "NO",
"STRIP_CODE_COMMENTS": "NO",
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/lwipstack/* */nanostack/sal-stack-nanostack/* */nanostack/coap-service/* */ble/generic/* */ble/pal/* */mbed-trace/* */mbed-coap/* */nanostack-libservice/* */mbed-client-randlib/* */nanostack/sal-stack-nanostack-eventloop/*"
"EXCLUDE_PATTERNS": "*/tools/* */targets/* */features/mbedtls/* */features/storage/* */features/unsupported/* */BUILD/* */rtos/TARGET_CORTEX/rtx*/* */cmsis/* */features/lwipstack/* */nanostack/sal-stack-nanostack/* */nanostack/coap-service/* */ble/generic/* */ble/pal/* */mbed-trace/* */mbed-coap/* */nanostack-libservice/* */mbed-client-randlib/* */nanostack/sal-stack-nanostack-eventloop/* */features/nfc/stack/*"
}
121 changes: 121 additions & 0 deletions features/nfc/acore/acore/ac_buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* Copyright (c) 2017, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* \file ac_buffer.h
* \copyright Copyright (c) ARM Ltd 2013
* \author Donatien Garnier
*/

/** \addtogroup ACore
* @{
* \name Buffer
* @{
*/

#ifndef ACORE_BUFFER_H_
#define ACORE_BUFFER_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "stdint.h"
#include "stddef.h"
#include "stdbool.h"

typedef struct __ac_buffer {
const uint8_t *data;
size_t size;
struct __ac_buffer *pNext;
} ac_buffer_t;

/** Initialize ac_buffer using underlying byte array, set ac_buffer's length to 0 (empty)
* \param pBuf pointer to ac_buffer_t structure to initialize
* \param data byte array to use
* \param size size of byte array
*/
void ac_buffer_init(ac_buffer_t *pBuf, const uint8_t *data, size_t size);

/** Copy pBufIn to pBuf
* \param pBuf pointer to ac_buffer_t structure to initialize
* \param pBufIn the source buffer
*/
void ac_buffer_dup(ac_buffer_t *pBuf, const ac_buffer_t *pBufIn);

/** Get buffer's underlying byte array
* \param pBuf pointer to ac_buffer_t structure
* \return underlying array
*/
static inline const uint8_t *ac_buffer_data(const ac_buffer_t *pBuf)
{
return pBuf->data;
}

/** Get buffer's size
* \param pBuf pointer to ac_buffer_t structure
* \return buffer's size
*/
static inline size_t ac_buffer_size(const ac_buffer_t *pBuf)
{
return pBuf->size;
}

/** Get next buffer in chain
* \param pBuf pointer to ac_buffer_t structure
* \return pointer to next buffer
*/
static inline ac_buffer_t *ac_buffer_next(const ac_buffer_t *pBuf)
{
return pBuf->pNext;
}

/** Set next buffer in chain
* \param pBuf pointer to ac_buffer_t structure
* \param pNextBuf pointer to next buffer (or NULL to break chain)
*/
static inline void ac_buffer_set_next(ac_buffer_t *pBuf, ac_buffer_t *pNextBuf)
{
pBuf->pNext = (ac_buffer_t *) pNextBuf;
}

/** Append buffer to end of chain
* \param pBuf pointer to ac_buffer_t structure
* \param pAppBuf pointer to buffer to append to chain
*/
void ac_buffer_append(ac_buffer_t *pBuf, ac_buffer_t *pAppBuf);

/** Truncate pBuf to length bytes and save the remaining bytes in pEndBuf
* \param pBuf The buffer to split (will be set to invalid state)
* \param pStartBuf A new buffer at the head of the split
* \param pEndBuf A new buffer at the tail of the split
* \param length How long pStartBuf should be (if longer than pBuf, then pStartBuf will be pBuf)
*/
void ac_buffer_split(ac_buffer_t *pStartBuf, ac_buffer_t *pEndBuf, ac_buffer_t *pBuf, size_t length);

//Debug
void ac_buffer_dump(ac_buffer_t *pBuf);

#ifdef __cplusplus
}
#endif

#endif /* ACORE_BUFFER_H_ */

/**
* @}
* @}
* */
Loading