STM8L libraries for CR95HF 1.0
Functions
ISO15693_Commands
ISO15693_Tags

Functions

u8 ISO15693_Inventory (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 Tag_AFI, const u8 MaskLength, const u8 *Mask, u8 *Inventory_16_slots_Nb_UID_Retrieved)
 This function sends, through the CR95HF, to a contactless tag, an inventory command and fills the Tag structure if some contactless tag answers. Note that if there are 16 slots it's recommend to set the CR95HF into WAIT302µs parameter with the protocol select command. Indeed, if the CR95HF is in Wait SOF mode it will waits up to 20ms before returning that there is no tag in the field whereas by waiting ionly 302 µs it allows to the application to know more rapidly that there is no tag and to send an EOF to switch to the next slot.
u8 ISO15693_Stay_Quiet (const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, a stay quiet command to a unique contactless tag designated by its UID.
u8 ISO15693_Read_Single_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Block_number)
 This function sends, through the CR95HF, a read single block command to the contactless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Write_Single_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Block_number, const u8 Block_Length, const u8 *Data)
 This function sends, through the CR95HF, a write single block command to the contactless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Lock_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Block_number)
 This function sends, through the CR95HF, a lock block command to the contactless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Read_Multiple_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 First_Block_number, const u8 Number_of_Blocks)
 This function sends, through the CR95HF, a read multiple block command to the contactless tag in the field or to an unique contactless tag designated by its UID. Note that data received are stored into the internal EEPROM of the MCU.
u8 ISO15693_Select (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, a select command to the unique contactless tag designated by its UID.
u8 ISO15693_Reset_to_Ready (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, a reset to ready state command to a contactless tag . This command could be used in two different case:
u8 ISO15693_Write_AFI (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Tag_AFI)
 This function sends, through the CR95HF, a write AFI command to the contacless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Lock_AFI (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, a Lock AFI command to the contacless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Write_DSFID (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Tag_DSFID)
 This function sends, through the CR95HF, a write DSFID command to the contacless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Lock_DSFID (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, a Lock DSFID command to the contacless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Get_System_Info (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID)
 This function sends, through the CR95HF, an get System Information commandto the contacless tag in the field or to an unique contactless tag designated by its UID.
u8 ISO15693_Get_Multiple_Blocks_Security_Status (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 First_Block_number, const u8 Number_of_Blocks)
 This function sends, through the CR95HF, a get multiple blocks security status command to the contactless tag in the field or to an unique contactless tag designated by its UID. note that data are stored into the eeprom.
u8 ISO15693_Custom_Commands (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 Custom, u8 IC_Mfg_Code, const u8 Parameters_Length, const u8 *Parameters)
 This function sends, through the CR95HF, a custom command to the contactless tag in the field or to an unique contactless tag designated by its UID.. User should add in parameters all the data needed. Command size is limited to MAX_DATASENT_LENGTH.

Function Documentation

u8 ISO15693_Custom_Commands ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8  Custom,
u8  IC_Mfg_Code,
const u8  Parameters_Length,
const u8 *  Parameters 
)

This function sends, through the CR95HF, a custom command to the contactless tag in the field or to an unique contactless tag designated by its UID.. User should add in parameters all the data needed. Command size is limited to MAX_DATASENT_LENGTH.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Custom: the custom command code.
IC_Mfg_Code: the IC manufacturer code designting manufacturer of the contactless tag
Parameters_Length: Length of parameters .
Parameters: data to write.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct)
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS:there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Get_Multiple_Blocks_Security_Status ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  First_Block_number,
const u8  Number_of_Blocks 
)

This function sends, through the CR95HF, a get multiple blocks security status command to the contactless tag in the field or to an unique contactless tag designated by its UID. note that data are stored into the eeprom.

Parameters:
MyTag: pointer on the structure to write command status
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block reading (optionnal).
First_Block_number: address of the first block to read.
Number_of_Blocks: number of block to read after the first one. For instance 0x06 means that 7 seven blocks will be read, 0x00 : only one
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct )
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Get_System_Info ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, an get System Information commandto the contacless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless Tag answered the command.
u8 ISO15693_Inventory ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8  Tag_AFI,
const u8  MaskLength,
const u8 *  Mask,
u8 *  Inventory_16_slots_Nb_UID_Retrieved 
)

This function sends, through the CR95HF, to a contactless tag, an inventory command and fills the Tag structure if some contactless tag answers. Note that if there are 16 slots it's recommend to set the CR95HF into WAIT302µs parameter with the protocol select command. Indeed, if the CR95HF is in Wait SOF mode it will waits up to 20ms before returning that there is no tag in the field whereas by waiting ionly 302 µs it allows to the application to know more rapidly that there is no tag and to send an EOF to switch to the next slot.

Parameters:
MyTag: pointer on the structure
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. Here inventory flag should be set, if AFI is present, AFI flag should be set.
Tag_AFI: the optionnal AFI to select a contactless tag family ( Flag indicates if the field is present or not
MaskLength: Length of the mask for transmitting, for example to transmit a part of the UID of one contactless tag. MaskLength represents the number of significant bits . The user should ensure that others bits are reset for padding in order to transmit only whole bytes.
Mask: The mask to transmit. (Mask[0] = LSB)
Inventory_16_slots_Nb_UID_Retrieved: pointer to retrieve the number of tag seen during the inventory 16 slots.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the tag did not manage to perform the request.
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: The inventory flag is not set, the mask size overweight the limited size or there is another error into the request flags parameters
ISO15693_SUCCESS_CODE: A contactless tag answered the command.
u8 ISO15693_Lock_AFI ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, a Lock AFI command to the contacless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Lock_Block ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  Block_number 
)

This function sends, through the CR95HF, a lock block command to the contactless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag where the data should be written (optionnal).
Block_number: address of the block where the data are written.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Lock_DSFID ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, a Lock DSFID command to the contacless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Read_Multiple_Block ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  First_Block_number,
const u8  Number_of_Blocks 
)

This function sends, through the CR95HF, a read multiple block command to the contactless tag in the field or to an unique contactless tag designated by its UID. Note that data received are stored into the internal EEPROM of the MCU.

Parameters:
MyTag: pointer of the structure to write the command status and eventual error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block reading (optionnal).
First_Block_number: address of the first block to read.
Number_of_Blocks: number of block to read after the first one. For instance 0x06 means that 7 seven blocks will be read, 0x00 : only one
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct )
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Read_Single_Block ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  Block_number 
)

This function sends, through the CR95HF, a read single block command to the contactless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer of the structure to write data read
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block reading (optionnal).
Block_number: address of the block to read.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct )
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Reset_to_Ready ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, a reset to ready state command to a contactless tag . This command could be used in two different case:

  • thecontactless tag is in quiet mode, it returns into ready mode (request could be addressed or not),
  • the contactless tag is in select mode it returns into ready mode (select flag shall be set). Note that for this case another select command with another UID turn automatically the tag into ready mode.
    Parameters:
    MyTag: pointer on the structure to write status of the command especially for error code
    Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
    Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
    Return values:
    ISO15693_ERROR_CODE:the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
    ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
    ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Select ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, a select command to the unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. Here command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Stay_Quiet ( const u8  Request_flags,
const u8 *  Tag_UID 
)

This function sends, through the CR95HF, a stay quiet command to a unique contactless tag designated by its UID.

Parameters:
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. Here command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag to put in quiet mode.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the tag did not manage to perform the request.
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: The inventory flag is set or request is not well addressed
ISO15693_SUCCESS_CODE: contactless tag is supposed to be in quiet mode.
u8 ISO15693_Write_AFI ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  Tag_AFI 
)

This function sends, through the CR95HF, a write AFI command to the contacless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Tag_AFI: AFI of the contacless tag, refer to datasheet for further information.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Write_DSFID ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  Tag_DSFID 
)

This function sends, through the CR95HF, a write DSFID command to the contacless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Tag_DSFID: DSFID of the contacless tag, refer to datasheet for further information.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct).
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
u8 ISO15693_Write_Single_Block ( ISO15693_Tag MyTag,
const u8  Request_flags,
const u8 *  Tag_UID,
const u8  Block_number,
const u8  Block_Length,
const u8 *  Data 
)

This function sends, through the CR95HF, a write single block command to the contactless tag in the field or to an unique contactless tag designated by its UID.

Parameters:
MyTag: pointer on the structure to write status of the command especially for error code
Request_flags: specifies how the contactless shall perform the command and answer. Also indicates whether corresponding fields are present or not. If command is addressed UID should be present and address flag set.
Tag_UID: pointer on the UID of the contactless tag for block writing (optionnal).
Block_number: address of the block to write.
Block_Length: number of byte in a block.
Data: data to write.
Return values:
ISO15693_ERROR_CODE: the command failed. Either there is no contactless tag or the answer is not valid (CR95HF returns an error or CRC residue is not correct)
ISO15693_ERROR_PARAMETERS_REQUEST_FLAGS: there is an error within the request flags parameters
ISO15693_SUCCESS_CODE: contactless tag answered the command.
 All Data Structures Files Functions Variables Defines