1 /****************************************************************************** 2 * 3 * Copyright 2015-2018,2020-2023 NXP 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 #ifndef __CAP_H__ 19 #define __CAP_H__ 20 #include "Nxp_Features.h" 21 #define pConfigFL (capability::getInstance()) 22 23 class capability { 24 private: 25 static capability* instance; 26 const uint16_t offsetDlRspChipType = 3; 27 const uint16_t offsetFwRomCodeVersion = 4; 28 const uint16_t offsetFwMinorVersion = 6; 29 const uint16_t offsetFwMajorVersion = 7; 30 const uint16_t offsetFwMajorVersion_pn557 = 11; 31 capability(); 32 tNFC_chipType determineChipTypeFromNciRsp(uint8_t* msg, uint16_t msg_len); 33 tNFC_chipType determineChipTypeFromDLRsp(uint8_t* msg, uint16_t msg_len); 34 35 public: 36 /*product[] will be used to print product version and 37 should be kept in accordance with tNFC_chipType*/ 38 const char* product[15] = {"UNKNOWN", "PN547C2", "PN65T", "PN548C2", "PN66T", 39 "PN551", "PN67T", "PN553", "PN80T", "PN557", 40 "PN81T", "sn100", "SN220", "pn560", "SN300"}; 41 static tNFC_chipType chipType; 42 static capability* getInstance(); 43 tNFC_chipType processChipType(uint8_t* msg, uint16_t msg_len); 44 uint32_t getFWVersionInfo(uint8_t* msg, uint16_t msg_len); 45 }; 46 #endif 47