![]() |
STM8L libraries for CR95HF 1.0
|
00001 00021 #ifndef __LRIXK_COMMAND_H 00022 #define __LRIXK_COMMAND_H 00023 00024 00025 /* Includes ----------------------------------------------*/ 00026 #include "iso15693_command.h" 00027 00028 // Custom commands code 00029 #define LRIXK_CMD_KILL 0xA6 00030 #define LRIXK_CMD_WRITE_KILL 0xB1 00031 #define LRIXK_CMD_LOCK_KILL 0xB2 00032 #define LRIXK_CMD_LOCK_KILL 0xB2 00033 #define LRIXK_CMD_FAST_READ_SINGLE_BLOCK 0xC0 00034 #define LRIXK_CMD_FAST_INVENTORY_INITIATED 0xC1 00035 #define LRIXK_CMD_FAST_INITIATE 0xC2 00036 #define LRIXK_CMD_FAST_READ_MULTIPLE_BLOCKS 0xC3 00037 #define LRIXK_CMD_INVENTORY_INITIATED 0xD1 00038 #define LRIXK_CMD_INITIATE 0xD2 00039 00040 // Constants for returning value 00041 #define LRIXK_SUCCESS_CODE 0x00 00042 #define LRIXK_ERROR_PARAMETERS_REQUEST_FLAGS 0x02 00043 #define LRIXK_ERROR_CODE 0x01 00044 #define LRIXK_BLOCK_SIZE_ERROR 0x00 00045 #define LRIXK_ERROR_CRC 0xCC // arbritrary defined constant 00046 00047 // others constants for commands specific to LRIXK family 00048 #define LRIXK_DEFAULT_BLOCK_SIZE 0x04 00049 #define LRIXK_KILL_ACCESS 0x00 00050 #define LRIXK_KILL_PROTECT_STATUS 0x01 00051 00052 // For Request flags 00053 // !! For all commands Protocol extension flag is set to 0 and is included in all the constants 00054 #define LRIXK_MASK_REQUEST_NO_PROT_EXTENSION 0x08 00055 #define LRIXK_BIT8_LOCK_KILL_RFU_FLAG 0x80 00056 #define LRIXK_MASK_REQUEST_FLAGS_INITIATE 0x7C 00057 #define LRIXK_MASK_REQUEST_FLAGS_NO_INVENTORY_OR_OPTION 0x4C 00058 #define LRIXK_MASK_REQUEST_FLAGS_NO_INVENTORY_OPTION_SELECT 0x5C 00059 #define LRIXK_MASK_REQUEST_FLAGS_NO_INVENTORY 0x0C 00060 #define LRIXK_MASK_REQUEST_FLAGS_NO_OPTION 0x48 00061 00062 00063 //------------------------------------------------------------------------ 00064 00065 u8 LRIXK_Inventory(ISO15693_Tag* MyTag, u8 Request_flags, const u8 Tag_AFI, 00066 const u8 MaskLength,const u8* Mask, u8* Inventory_16_slots_Nb_UID_Retrieved); 00067 00068 u8 LRIXK_Stay_Quiet( const u8 Request_flags, const u8* Tag_UID); 00069 00070 u8 LRIXK_Read_Single_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Block_number); 00071 00072 u8 LRIXK_Write_Single_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Block_number, const u8* Data); 00073 00074 u8 LRIXK_Lock_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Block_number); 00075 00076 u8 LRIXK_Read_Multiple_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 First_Block_number, const u8 Number_of_Blocks); 00077 00078 u8 LRIXK_Select(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID); 00079 00080 u8 LRIXK_Reset_to_Ready(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID); 00081 00082 u8 LRIXK_Write_AFI(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Tag_AFI); 00083 00084 u8 LRIXK_Lock_AFI(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID); 00085 00086 u8 LRIXK_Write_DSFID(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Tag_DSFID); 00087 00088 u8 LRIXK_Lock_DSFID(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID); 00089 00090 u8 LRIXK_Get_System_Info(ISO15693_Tag* MyTag,const u8 Request_flags,const u8* Tag_UID); 00091 00092 u8 LRIXK_Get_Multiple_Blocks_Security_Status(ISO15693_Tag* MyTag, u8 Request_flags, const u8* Tag_UID, const u8 First_Block_number, const u8 Number_of_Blocks); 00093 00094 // Custom code command ------------------------------------------------------------- 00095 00096 u8 LRIXK_Kill(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8* Kill_Code); 00097 00098 u8 LRIXK_Write_Kill(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8* Kill_Code); 00099 00100 u8 LRIXK_Lock_Kill(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID); 00101 00102 u8 LRIXK_Fast_Read_Single_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 Block_number); 00103 00104 u8 LRIXK_Fast_Inventory_Initiated(ISO15693_Tag* MyTag, const u8 Request_flags, const u8 Tag_AFI, const u8 MaskLength, const u8* Mask, u8* Inventory_16_slots_Nb_UID_Retrieved); 00105 00106 u8 LRIXK_Fast_Initiate(ISO15693_Tag* MyTag, const u8 Request_flags); 00107 00108 u8 LRIXK_Fast_Read_Multiple_Block(ISO15693_Tag* MyTag, const u8 Request_flags, const u8* Tag_UID, const u8 First_Block_number, const u8 Number_of_Blocks); 00109 00110 u8 LRIXK_Inventory_Initiated(ISO15693_Tag* MyTag, const u8 Request_flags, const u8 Tag_AFI, const u8 MaskLength, const u8* Mask, u8* Inventory_16_slots_Nb_UID_Retrieved); 00111 00112 u8 LRIXK_Initiate(ISO15693_Tag* MyTag, const u8 Request_flags); 00113 00114 00115 // support functions ------------------------------------------------------------------ 00116 00117 u8 LRIXK_Is_Request_Flags_ok(const u8 Request_flags, const u8 ISO15693_LRIXK_cmd_code); 00118 00119 u8 LRIXK_Is_Memory_programming_function(const u8 ISO15693_LRIXK_cmd_code); 00120 00121 u8 LRIXK_Is_Fast_Datarate_ok(const u8 Request_flags,const CR95HF_Protocol_Config* Protocol_Settings); 00122 00123 u8 LRIXK_Is_Fast_Command(const u8 LRIXK_cmd_code); 00124 00125 #endif /*__LRIXK_COMMAND_H */ 00126 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/