123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- #ifndef NRF_FICR_H__
- #define NRF_FICR_H__
- #include <nrfx.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- __STATIC_INLINE uint32_t nrf_ficr_codepagesize_get(NRF_FICR_Type const * p_reg);
- __STATIC_INLINE uint32_t nrf_ficr_codesize_get(NRF_FICR_Type const * p_reg);
- __STATIC_INLINE uint32_t nrf_ficr_deviceid_get(NRF_FICR_Type const * p_reg, uint32_t reg_id);
- #if defined(FICR_NFC_TAGHEADER0_MFGID_Msk) || defined(__NRFX_DOXYGEN__)
- __STATIC_INLINE uint32_t nrf_ficr_nfc_tagheader_get(NRF_FICR_Type const * p_reg,
- uint32_t tagheader_id);
- #endif
- #ifndef SUPPRESS_INLINE_IMPLEMENTATION
- __STATIC_INLINE uint32_t nrf_ficr_codepagesize_get(NRF_FICR_Type const * p_reg)
- {
- #if defined(FICR_INFO_CODEPAGESIZE_CODEPAGESIZE_Msk)
- return p_reg->INFO.CODEPAGESIZE;
- #else
- return p_reg->CODEPAGESIZE;
- #endif
- }
- __STATIC_INLINE uint32_t nrf_ficr_codesize_get(NRF_FICR_Type const * p_reg)
- {
- #if defined(FICR_INFO_CODESIZE_CODESIZE_Msk)
- return p_reg->INFO.CODESIZE;
- #else
- return p_reg->CODESIZE;
- #endif
- }
- __STATIC_INLINE uint32_t nrf_ficr_deviceid_get(NRF_FICR_Type const * p_reg, uint32_t reg_id)
- {
- #if defined(FICR_INFO_DEVICEID_DEVICEID_Msk)
- return p_reg->INFO.DEVICEID[reg_id];
- #else
- return p_reg->DEVICEID[reg_id];
- #endif
- }
- #if defined(FICR_NFC_TAGHEADER0_MFGID_Msk)
- __STATIC_INLINE uint32_t nrf_ficr_nfc_tagheader_get(NRF_FICR_Type const * p_reg,
- uint32_t tagheader_id)
- {
- switch(tagheader_id) {
- case 0:
- return p_reg->NFC.TAGHEADER0;
- break;
- case 1:
- return p_reg->NFC.TAGHEADER1;
- break;
- case 2:
- return p_reg->NFC.TAGHEADER2;
- break;
- case 3:
- return p_reg->NFC.TAGHEADER3;
- break;
- default:
- return 0;
- }
- }
- #endif
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|