1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-04 05:42:34 +00:00

chore(core): Align RFAL library with most relevant public version 3.0.1.

This commit is contained in:
kopecdav 2025-02-11 16:35:21 +01:00
parent 9a41feb683
commit 073bd6ce2a
4 changed files with 1388 additions and 1471 deletions

View File

@ -1,6 +1,6 @@
RFAL middleware was imported into trezor-firmware to support a low level NFC operations of st25r3916b from 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 # Local changes

View File

@ -1,18 +1,18 @@
/****************************************************************************** /******************************************************************************
* @attention * @attention
* *
* COPYRIGHT 2019 STMicroelectronics, all rights reserved * COPYRIGHT 2019 STMicroelectronics, all rights reserved
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
******************************************************************************/ ******************************************************************************/
/* /*
* PROJECT: ST25R firmware * PROJECT: ST25R firmware
@ -70,39 +70,42 @@
****************************************************************************** ******************************************************************************
*/ */
/*! Card Detection NFC technology type */ /*! Card Detection NFC technology type */
typedef enum { typedef enum
RFAL_CD_TECH_NONE = 0x00, /*!< No NFC Technology */ {
RFAL_CD_TECH_NFCA = 0x01, /*!< NFC Technology NFCB */ RFAL_CD_TECH_NONE = 0x00, /*!< No NFC Technology */
RFAL_CD_TECH_NFCB = 0x02, /*!< NFC Technology NFCB */ RFAL_CD_TECH_NFCA = 0x01, /*!< NFC Technology NFCB */
RFAL_CD_TECH_NFCF = 0x04, /*!< NFC Technology NFCF */ RFAL_CD_TECH_NFCB = 0x02, /*!< NFC Technology NFCB */
RFAL_CD_TECH_NFCV = 0x08, /*!< NFC Technology NFCV */ RFAL_CD_TECH_NFCF = 0x04, /*!< NFC Technology NFCF */
RFAL_CD_TECH_OTHER = 0x10 /*!< NFC Technology OTHER */ RFAL_CD_TECH_NFCV = 0x08, /*!< NFC Technology NFCV */
} rfalCdTech; 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 */ /*! Card Detection result|outcome type */
typedef struct { typedef enum
bool detected; /*!< Card detected flag */ {
rfalCdDetType detType; /*!< Card detection type */ RFAL_CD_NOT_FOUND = 0, /*<! No NFC device found */
} rfalCdRes; 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;
/* /*
****************************************************************************** ******************************************************************************
@ -127,7 +130,8 @@ typedef struct {
* *
***************************************************************************** *****************************************************************************
*/ */
ReturnCode rfalCdDetectCard(rfalCdRes *result); ReturnCode rfalCdDetectCard( rfalCdRes *result );
/*! /*!
***************************************************************************** *****************************************************************************
@ -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 */ #endif /* RFAL_CD_H */
/** /**
* @} * @}
* *
* @} * @}
* *
* @} * @}
*/ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff