mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-13 14:46:06 +00:00
chore(core): Align RFAL library with most relevant public version 3.0.1.
This commit is contained in:
parent
9a41feb683
commit
073bd6ce2a
@ -1,6 +1,6 @@
|
||||
|
||||
RFAL middleware was imported into trezor-firmware to support a low level NFC operations of st25r3916b from
|
||||
https://www.st.com/en/embedded-software/stsw-st25r-lib.html#overview (version 1.7.0)
|
||||
https://www.st.com/en/embedded-software/stsw-st25rfal002.html (version 3.0.1)
|
||||
|
||||
# Local changes
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
|
||||
/******************************************************************************
|
||||
* @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.
|
||||
*
|
||||
******************************************************************************/
|
||||
* @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: ST25R firmware
|
||||
@ -70,39 +70,42 @@
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Card Detection NFC technology type */
|
||||
typedef enum {
|
||||
RFAL_CD_TECH_NONE = 0x00, /*!< No NFC Technology */
|
||||
RFAL_CD_TECH_NFCA = 0x01, /*!< NFC Technology NFCB */
|
||||
RFAL_CD_TECH_NFCB = 0x02, /*!< NFC Technology NFCB */
|
||||
RFAL_CD_TECH_NFCF = 0x04, /*!< NFC Technology NFCF */
|
||||
RFAL_CD_TECH_NFCV = 0x08, /*!< NFC Technology NFCV */
|
||||
RFAL_CD_TECH_OTHER = 0x10 /*!< NFC Technology OTHER */
|
||||
} rfalCdTech;
|
||||
/*! Card Detection NFC technology type */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_CD_TECH_NONE = 0x00, /*!< No NFC Technology */
|
||||
RFAL_CD_TECH_NFCA = 0x01, /*!< NFC Technology NFCB */
|
||||
RFAL_CD_TECH_NFCB = 0x02, /*!< NFC Technology NFCB */
|
||||
RFAL_CD_TECH_NFCF = 0x04, /*!< NFC Technology NFCF */
|
||||
RFAL_CD_TECH_NFCV = 0x08, /*!< NFC Technology NFCV */
|
||||
RFAL_CD_TECH_OTHER = 0x10 /*!< NFC Technology OTHER */
|
||||
}rfalCdTech;
|
||||
|
||||
/*! Card Detection result|outcome type */
|
||||
typedef enum {
|
||||
RFAL_CD_NOT_FOUND = 0, /*<! No NFC device found */
|
||||
RFAL_CD_SINGLE_DEV = 1, /*<! An NFC card was found */
|
||||
RFAL_CD_MULTIPLE_DEV = 2, /*<! Multiple NFC devices found */
|
||||
RFAL_CD_MULTIPLE_TECH =
|
||||
3, /*<! Multiple NFC technologies observed in a single RF carrier */
|
||||
RFAL_CD_CARD_TECH = 4, /*<! A card-exclusive NFC technology found */
|
||||
RFAL_CD_SINGLE_MULTI_TECH =
|
||||
5, /*<! A single NFC device which supports multiple technologies found */
|
||||
RFAL_CD_SINGLE_P2P =
|
||||
6, /*<! A single NFC device which supports NFC-DEP|P2P found */
|
||||
RFAL_CD_SINGLE_HB =
|
||||
7, /*<! A single NFC device where heartbeat was detected */
|
||||
RFAL_CD_UNKOWN = 8 /*<! Unable to complete the Card Detection due to
|
||||
unknow|unexpected event */
|
||||
} rfalCdDetType;
|
||||
|
||||
/*! Card Detection result|outcome */
|
||||
typedef struct {
|
||||
bool detected; /*!< Card detected flag */
|
||||
rfalCdDetType detType; /*!< Card detection type */
|
||||
} rfalCdRes;
|
||||
/*! Card Detection result|outcome type */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_CD_NOT_FOUND = 0, /*<! No NFC device found */
|
||||
RFAL_CD_SINGLE_DEV = 1, /*<! An NFC card was found */
|
||||
RFAL_CD_MULTIPLE_DEV = 2, /*<! Multiple NFC devices found */
|
||||
RFAL_CD_MULTIPLE_TECH = 3, /*<! Multiple NFC technologies observed in a single RF carrier */
|
||||
RFAL_CD_CARD_TECH = 4, /*<! A card-exclusive NFC technology found */
|
||||
RFAL_CD_SINGLE_MULTI_TECH = 5, /*<! A single NFC device which supports multiple technologies found */
|
||||
RFAL_CD_SINGLE_P2P = 6, /*<! A single NFC device which supports NFC-DEP|P2P found */
|
||||
RFAL_CD_SINGLE_HB = 7, /*<! A single NFC device where heartbeat was detected */
|
||||
RFAL_CD_UNKOWN = 8 /*<! Unable to complete the Card Detection due to unknow|unexpected event */
|
||||
}
|
||||
rfalCdDetType;
|
||||
|
||||
|
||||
/*! Card Detection result|outcome */
|
||||
typedef struct
|
||||
{
|
||||
bool detected; /*!< Card detected flag */
|
||||
rfalCdDetType detType; /*!< Card detection type */
|
||||
}
|
||||
rfalCdRes;
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
@ -117,23 +120,24 @@ typedef struct {
|
||||
* This function checks if a passive NFC card is present in the vicinity
|
||||
*
|
||||
* \param[out] result : Pointer to detection result|outcome
|
||||
*
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameters
|
||||
* \return RFAL_ERR_WRONG_STATE : Incorrect state for this operation
|
||||
* \return RFAL_ERR_NONE : Detection excuted with no error
|
||||
* \return RFAL_ERR_RF_COLLISION : RF carrier collision detected
|
||||
* \return RFAL_ERR_XXXX : Error occurred
|
||||
|
||||
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode rfalCdDetectCard(rfalCdRes *result);
|
||||
ReturnCode rfalCdDetectCard( rfalCdRes *result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Start Card Detection
|
||||
*
|
||||
* This function starts the detection for a passive NFC card is present
|
||||
* This function starts the detection for a passive NFC card is present
|
||||
* in the vicinity
|
||||
*
|
||||
* \param[out] result : Pointer to detection result|outcome
|
||||
@ -144,7 +148,8 @@ ReturnCode rfalCdDetectCard(rfalCdRes *result);
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode rfalCdStartDetectCard(rfalCdRes *result);
|
||||
ReturnCode rfalCdStartDetectCard( rfalCdRes *result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
@ -160,14 +165,15 @@ ReturnCode rfalCdStartDetectCard(rfalCdRes *result);
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode rfalCdGetDetectCardStatus(void);
|
||||
ReturnCode rfalCdGetDetectCardStatus( void );
|
||||
|
||||
|
||||
#endif /* RFAL_CD_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user