Skip to content

Commit

Permalink
NFC and factory testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hnzlmnn committed Jun 14, 2024
1 parent 4a9243b commit c222da6
Show file tree
Hide file tree
Showing 65 changed files with 19,960 additions and 282 deletions.
2 changes: 1 addition & 1 deletion components/keyboard
Submodule keyboard updated 1 files
+2 −4 keyboard.c
6 changes: 5 additions & 1 deletion components/spi-st25r3911b/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ idf_component_register(
"en.STSW-ST25RFAL001/source/st25r3911/st25r3911.c"
"en.STSW-ST25RFAL001/source/st25r3911/st25r3911_com.c"
"en.STSW-ST25RFAL001/source/st25r3911/st25r3911_interrupt.c"
"NDEF/source"
INCLUDE_DIRS
"include"
"en.STSW-ST25RFAL001"
"en.STSW-ST25RFAL001/include"
"en.STSW-ST25RFAL001/source/st25r3911"
"en.STSW-ST25RFAL001"
"NDEF/include"
"NDEF/include/message"
"NDEF/include/poller"
)
6 changes: 6 additions & 0 deletions components/spi-st25r3911b/NDEF/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.uvprojx text eol=lf
*.uvoptx text eol=lf
54 changes: 54 additions & 0 deletions components/spi-st25r3911b/NDEF/LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
SLA0051
SOFTWARE LICENSE AGREEMENT (“Agreement”)
BY CLICKING ON THE "I ACCEPT" BUTTON OR BY UNZIPPING, INSTALLING, COPYING, DOWNLOADING, ACCESSING
OR OTHERWISE USING THIS SOFTWARE (HEREINAFTER “SOFTWARE” MEANS THE RELATED SOFTWARE,
DOCUMENTATION, OTHER MATERIALS, AND ANY PARTS, PERMITTED MODIFICATIONS, AND PERMITTED
DERIVATIVES THEREOF) FROM STMICROELECTRONICS INTERNATIONAL N.V, SWISS BRANCH AND/OR ITS
AFFILIATED COMPANIES (“STMICROELECTRONICS”), THE RECIPIENT, ON BEHALF OF HIMSELF OR HERSELF, OR ON
BEHALF OF ANY ENTITY BY WHICH SUCH RECIPIENT IS EMPLOYED AND/OR ENGAGED (“YOU”) AGREES TO BE
BOUND BY THIS AGREEMENT.
You represent that you have the authority to enter into this Agreement. You will comply with all laws, including export laws.
STMicroelectronics’s failure or delay to enforce this Agreement does not waive STMicroelectronics’s rights. Swiss law, except
conflict of laws, governs this Agreement, and the parties consent to exclusive jurisdiction of courts in Switzerland for litigation of
this Agreement.
Subject to the below disclaimer, the redistribution, reproduction and use in source and binary forms of the software or any part
thereof, with or without modification, are permitted provided that the following conditions are met:
1. Redistribution of source code (modified or not) must retain any copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form, except as embedded into a microcontroller or microprocessor device or a software update
for such device, must reproduce any copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or
promote products using or derived from this software or part thereof without specific written permission.
4. This software or any part thereof, including modifications and/or derivative works of this software, must be used and
execute solely and exclusively in combination with an integrated circuit that is manufactured by or for STMicroelectronics
and is an NFC tag, NFC dynamic tag, NFC reader, or UHF reader.
5. No use, reproduction or redistribution of this software may be done in any manner that would subject this software to any
Open Source Terms. “Open Source Terms” shall mean any open source license which requires as part of distribution of
software that the source code of such software is distributed therewith or otherwise made available, or open source license
that substantially complies with the Open Source definition specified at www.opensource.org and any other comparable
open source license such as for example GNU General Public License (GPL), Eclipse Public License (EPL), Apache
Software License, BSD license and MIT license.
6. STMicroelectronics has no obligation to provide any maintenance, support or updates for the software.
7. The software is and will remain the exclusive property of STMicroelectronics and its licensors. The recipient will not take
any action that jeopardizes STMicroelectronics and its licensors' proprietary rights or acquire any rights in the software,
except the limited rights specified hereunder.
8. Redistribution and use of this software partially or any part thereof other than as permitted under this license is void and
will automatically terminate your rights under this license.
DISCLAIMER
THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS,
IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY
INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS, WHETHER EXPRESS OR
IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF
STMICROELECTRONICS OR ANY THIRD PARTY.


Binary file added components/spi-st25r3911b/NDEF/doc/ndef.chm
Binary file not shown.
89 changes: 89 additions & 0 deletions components/spi-st25r3911b/NDEF/include/message/ndef_buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/******************************************************************************
* @attention
*
* COPYRIGHT 2019 STMicroelectronics, all rights reserved
*
* 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,
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/

/*
* PROJECT: NDEF firmware
* Revision:
* LANGUAGE: ISO C99
*/

/*! \file
*
* \author
*
* \brief NDEF buffer type structures
*
*/

#ifndef NDEF_BUFFER_H
#define NDEF_BUFFER_H


/*
******************************************************************************
* INCLUDES
******************************************************************************
*/

#include <stdint.h>


/*
******************************************************************************
* GLOBAL DEFINES
******************************************************************************
*/


/*
******************************************************************************
* GLOBAL TYPES
******************************************************************************
*/


/*! NDEF structure to handle const buffers */
typedef struct
{
const uint8_t* buffer; /*!< Pointer to const buffer */
uint32_t length; /*!< buffer length */
} ndefConstBuffer;


/*! NDEF structure to handle buffers */
typedef struct
{
uint8_t* buffer; /*!< Pointer to buffer */
uint32_t length; /*!< buffer length */
} ndefBuffer;


/*! NDEF structure to handle const buffers limited to 256 bytes */
typedef struct
{
const uint8_t* buffer; /*!< Pointer to const buffer */
uint8_t length; /*!< buffer length */
} ndefConstBuffer8;


/*! NDEF structure to handle buffers limited to 256 bytes */
typedef struct
{
uint8_t* buffer; /*!< Pointer to buffer */
uint8_t length; /*!< buffer length */
} ndefBuffer8;


#endif /* NDEF_BUFFER_H */
211 changes: 211 additions & 0 deletions components/spi-st25r3911b/NDEF/include/message/ndef_message.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
/******************************************************************************
* @attention
*
* COPYRIGHT 2019 STMicroelectronics, all rights reserved
*
* 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,
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/

/*
* PROJECT: NDEF firmware
* Revision:
* LANGUAGE: ISO C99
*/

/*! \file
*
* \author
*
* \brief NDEF message header file
*
* NDEF Message provides functionalities required to perform message management.
* A message is a list of records.
*
* The most common interfaces are:
* <br>&nbsp; ndefMessageReset()
* <br>&nbsp; ndefMessageAppend()
* <br>&nbsp; ndefMessageEncode()
* <br>&nbsp; ndefMessageDecode()
*
* \addtogroup NDEF
* @{
*
*/

#ifndef NDEF_MESSAGE_H
#define NDEF_MESSAGE_H


/*
******************************************************************************
* INCLUDES
******************************************************************************
*/

#include "ndef_record.h"
#include "ndef_config.h"


/*
******************************************************************************
* GLOBAL DEFINES
******************************************************************************
*/

/*! Message scanning macros */
#define ndefMessageGetFirstRecord(message) (((message) == NULL) ? NULL : (message)->record) /*!< Get first record */
#define ndefMessageGetNextRecord(record) (((record) == NULL) ? NULL : (record)->next) /*!< Get next record */

/*
******************************************************************************
* GLOBAL TYPES
******************************************************************************
*/


/*! Message information */
typedef struct
{
uint32_t length; /*!< Message length in bytes */
uint32_t recordCount; /*!< Number of records in the message */
} ndefMessageInfo;


/*! NDEF message */
struct ndefMessageStruct
{
ndefRecord* record; /*!< Pointer to a record */
ndefMessageInfo info; /*!< Message information, e.g. length in bytes, record count */
};


/*
******************************************************************************
* GLOBAL FUNCTION PROTOTYPES
******************************************************************************
*/


/*!
*****************************************************************************
* Initialize an empty NDEF message
*
* \param[in,out] message to initialize
*
* \return ERR_NONE if successful or a standard error code
*****************************************************************************
*/
ndefStatus ndefMessageInit(ndefMessage* message);


/*!
*****************************************************************************
* Get NDEF message information
*
* Return the message information
*
* \param[in] message to get info from
* \param[out] info: e.g. message length in bytes, number of records
*
* \return ERR_NONE if successful or a standard error code
*****************************************************************************
*/
ndefStatus ndefMessageGetInfo(const ndefMessage* message, ndefMessageInfo* info);


/*!
*****************************************************************************
* Get the number of NDEF message records
*
* Return the number of records in the given message
*
* \param[in] message
*
* \return number of records
*****************************************************************************
*/
uint32_t ndefMessageGetRecordCount(const ndefMessage* message);


/*!
*****************************************************************************
* Append a record to an NDEF message
*
* \param[in] record: Record to append
* \param[in,out] message: Message to be appended with the given record
*
* \return ERR_NONE if successful or a standard error code
*****************************************************************************
*/
ndefStatus ndefMessageAppend(ndefMessage* message, ndefRecord* record);


/*!
*****************************************************************************
* Decode a raw buffer to an NDEF message
*
* Convert a raw buffer to a message
*
* \param[in] bufPayload: Payload buffer to convert into message
* \param[out] message: Message created from the raw buffer
*
* \return ERR_NONE if successful or a standard error code
*****************************************************************************
*/
ndefStatus ndefMessageDecode(const ndefConstBuffer* bufPayload, ndefMessage* message);


#if NDEF_FEATURE_FULL_API
/*!
*****************************************************************************
* Encode an NDEF message to a raw buffer
*
* Convert a message to a raw buffer
*
* \param[in] message: Message to convert
* \param[in,out] bufPayload: Output buffer to store the converted message
* The input length provides the output buffer allocated
* length, used for parameter check to avoid overflow.
* In case the buffer provided is too short, it is
* updated with the required buffer length.
* On success, it is updated with the actual buffer
* length used to contain the converted message.
*
* \return ERR_NONE if successful or a standard error code
*****************************************************************************
*/
ndefStatus ndefMessageEncode(const ndefMessage* message, ndefBuffer* bufPayload);
#endif


#if NDEF_FEATURE_FULL_API
/*!
*****************************************************************************
* Look for a given record type in an NDEF message
*
* Parses an NDEF message, looking for a record of given type
*
* \param[in] message: Message to parse
* \param[in] tnf: TNF type to match
* \param[in] bufType: Type buffer to match
*
* \return the record matching the type if successful or NULL
*****************************************************************************
*/
ndefRecord* ndefMessageFindRecordType(ndefMessage* message, uint8_t tnf, const ndefConstBuffer8* bufType);
#endif


#endif /* NDEF_MESSAGE_H */

/**
* @}
*
*/
Loading

0 comments on commit c222da6

Please sign in to comment.