Home | History | Annotate | Download | only in utils
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2015 NXP Semiconductors
      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   /*Init Response*/
     27   const uint16_t offsetInitHwVersion = 24;
     28   const uint16_t offsetInitFwVersion = 25;
     29   /*Reset Notification*/
     30   const uint16_t offsetRstHwVersion = 8;
     31   const uint16_t offsetRstFwVersion = 9;
     32   /*Propreitary Response*/
     33   const uint16_t offsetPropHwVersion = 3;
     34   const uint16_t offsetPropFwVersion = 4;
     35 
     36   /*product[] will be used to print product version and
     37   should be kept in accordance with tNFC_chipType*/
     38   const char* product[11] = {"UNKNOWN", "PN547C2", "PN65T", "PN548C2",
     39                              "PN66T",   "PN551",   "PN67T", "PN553",
     40                              "PN80T",   "PN557",   "PN81T"};
     41   capability();
     42 
     43  public:
     44   static tNFC_chipType chipType;
     45   static capability* getInstance();
     46   tNFC_chipType getChipType(uint8_t* msg, uint16_t msg_len);
     47 };
     48 #endif
     49