![]() |
STM8L libraries for CR95HF 1.0
|
Header for the m24lrxx_command.c. More...
#include "iso15693_command.h"
Go to the source code of this file.
Defines | |
#define | USE_ENERGY_HARVESTING_COMMANDS |
#define | M24LRXX_CMD_GET_MULTIPLE_BLOCK_SECURITY_STATUS 0x2C |
#define | M24LRXX_CMD_WRITE_SECTOR_PASSWORD 0xB1 |
#define | M24LRXX_CMD_LOCK_SECTOR_PASSWORD 0xB2 |
#define | M24LRXX_CMD_PRESENT_SECTOR_PASSWORD 0xB3 |
#define | M24LRXX_CMD_FAST_READ_SINGLE_BLOCK 0xC0 |
#define | M24LRXX_CMD_FAST_INVENTORY_INITIATED 0xC1 |
#define | M24LRXX_CMD_FAST_INITIATE 0xC2 |
#define | M24LRXX_CMD_FAST_READ_MULTIPLE_BLOCKS 0xC3 |
#define | M24LRXX_CMD_INVENTORY_INITIATED 0xD1 |
#define | M24LRXX_CMD_INITIATE 0xD2 |
#define | M24LRXX_CMD_READ_CFG 0xA0 |
#define | M24LRXX_CMD_WRITE_EH_CFG 0xA1 |
#define | M24LRXX_CMD_SET_RST_EH_EN 0xA2 |
#define | M24LRXX_CMD_CHECK_EH_EN 0xA3 |
#define | M24LRXX_CMD_WRITE_DO_CFG 0xA4 |
#define | M24LRXX_SUCCESS_CODE 0x00 |
#define | M24LRXX_ERROR_PARAMETERS_REQUEST_FLAGS 0x02 |
#define | M24LRXX_ERROR_CODE 0x01 |
#define | M24LRXX_BLOCK_SIZE_ERROR 0x00 |
#define | M24LRXX_ERROR_CRC 0xCC |
#define | M24LRXX_SPECIFIED_BLOCK_READ_PROTECTED 0x15 |
#define | M24LRXX_DEFAULT_BLOCK_SIZE 0x04 |
#define | M24LRXX_DEFAULT_SECTOR_SIZE 0x20 |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_OPTION_EXTENSION_FLAG 0x48 |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_EXTENSION_INVENTORY_FLAG 0x0C |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_OPTION_INVENTORY_FLAG 0x44 |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_OPTION_EXTENSION_INVENTORY_FLAG 0x4C |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_OPTION_EXTENSION_INVENTORY_SELECT_FLAG 0x5C |
#define | M24LRXX_MASK_REQUEST_FLAGS_NO_EXTENSION_FLAG 0x08 |
#define | M24LRXX_MASK_REQUEST_FLAGS_CMD_INITIATE 0x7C |
#define | M24LRXX_SECURITY_STATUS_BLOCK_LOCKED 0x01 |
#define | M24LRXX_SECURITY_STATUS_MASK_PASSWORD_CTRL 0x18 |
#define | M24LRXX_SECURITY_STATUS_NO_PASSWORD 0x00 |
#define | M24LRXX_SECURITY_STATUS_PASSWORD_1 0x08 |
#define | M24LRXX_SECURITY_STATUS_PASSWORD_2 0x10 |
#define | M24LRXX_SECURITY_STATUS_PASSWORD_3 0x18 |
#define | M24LRXX_SECURITY_STATUS_MASK_READ_WRITE_PROTECTION 0x06 |
#define | M24LRXX_SECURITY_STATUS_WITH_PASSWORD_READ_WRITE 0x00 |
#define | M24LRXX_SECURITY_STATUS_WITH_PASSWORD_READ_ONLY 0x06 |
#define | M24LRXX_SECURITY_STATUS_WITHOUT_PASSWORD_READ_ONLY 0x00 |
#define | M24LRXX_SECURITY_STATUS_WITHOUT_PASSWORD_READ_WRITE 0x02 |
#define | M24LRXX_SECURITY_STATUS_WITHOUT_PASSWORD_NO_READ_NO_WRITE 0x04 |
#define | M24LRXX_CONFIGURATION_BYTE_CURSOR 0x01 |
#define | M24LRXX_CONFIGURATION_BYTE_MASK_RANGE 0x03 |
#define | M24LRXX_CONFIGURATION_BYTE_RANGE_6_MA 0x00 |
#define | M24LRXX_CONFIGURATION_BYTE_RANGE_3_MA 0x01 |
#define | M24LRXX_CONFIGURATION_BYTE_RANGE_1_MA 0x02 |
#define | M24LRXX_CONFIGURATION_BYTE_RANGE_300_UA 0x03 |
#define | M24LRXX_CONFIGURATION_BYTE_MASK_RF_WIP_BUSY 0x08 |
#define | M24LRXX_CONFIGURATION_BYTE_RF_BUSY 0x00 |
#define | M24LRXX_CONFIGURATION_BYTE_RF_WIP 0x08 |
#define | M24LRXX_CONFIGURATION_BYTE_MASK_EH_MODE 0x04 |
#define | M24LRXX_CONFIGURATION_BYTE_EH_ENABLED 0x00 |
#define | M24LRXX_CONFIGURATION_BYTE_EH_DISABLED 0x04 |
#define | M24LRXX_CONTROL_REGISTER_CURSOR 0x01 |
#define | M24LRXX_CONTROL_REGISTER_EH_ENABLE 0x01 |
#define | M24LRXX_CONTROL_REGISTER_EH_DISABLE 0x00 |
Functions | |
u8 | M24LRXX_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 posssibly of the M24LRXX family, an inventory command and fills the Tag structure if some contactless tag answers. | |
u8 | M24LRXX_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 possibly belonging to the M24LRXX family designated by its UID. | |
u8 | M24LRXX_Read_Single_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u16 Block_number) |
This function sends, through the CR95HF, a read single block command to the contactless tag possibly of the M24LRX family in the field or to an unique contactless tag designated by its UID. Note that for more than 8kbits device, the protocol extension should be set within the request flags as the block number is on two bytes. | |
u8 | M24LRXX_Write_Single_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u16 Block_number, const u8 *Data) |
This function sends, through the CR95HF, a write single block command to the contactless tag opssibly from the M24LRXX family in the field or to an unique contactless tag designated by its UID.Note that for more than 8kbits device, the protocol extension should be set within the request flags as the block number is on two bytes. | |
u8 | M24LRXX_Read_Multiple_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u16 First_Block_number, const u8 Number_of_Blocks) |
This function sends, through the CR95HF, a read multiple block command to the contactless tag possibly belonging to the M24LRXX family 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 | M24LRXX_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 possibly belonging to the M24LRXX family. | |
u8 | M24LRXX_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 possibly belong to the M24LRXX family. This command could be used in two different case: | |
u8 | M24LRXX_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 possibly belonging to the M24LRXX family or to an unique contactless tag designated by its UID. | |
u8 | M24LRXX_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 possibly from the M24LRXX family or to an unique contactless tag designated by its UID. | |
u8 | M24LRXX_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 possibly belonging to the M24LRXX family or to an unique contactless tag designated by its UID. | |
u8 | M24LRXX_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 possibly from the M24LRXX family or to an unique contactless tag designated by its UID. | |
u8 | M24LRXX_Get_System_Info (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID) |
This function sends, through the CR95HF, an get System Information command to the contacless tag ,possibly from the M24LRXX family, in the field or to an unique contactless tag designated by its UID. Note that here the protocol extension flag is set. | |
u8 | M24LRXX_Get_Multiple_Blocks_Security_Status (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u16 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,possibly from the M24LRXX family, or to an unique contactless tag designated by its UID. note that data are stored into the eeprom. | |
u8 | M24LRXX_Write_Sector_Password (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Password_Number, const u8 *Password) |
This function sends, through the CR95HF, a write sector password command to a M24LRXX contactless tag in the field or designated by its UID . The password written will be usefull to protect data contained within the contactless tag. Note that on delivery state the passwords are 00.00.00.00 h and a present password must be issued whith this value before issuing the command and then when each time password is changed. | |
u8 | M24LRXX_Lock_Sector_Password (ISO15693_Tag *MyTag, u8 Request_flags, const u8 *Tag_UID, u16 Sector_Number, u8 Sector_Security_Status) |
This function sends, through the CR95HF, a lock sector password command to a M24LRXX contactless tag in the field or designated by its UID. Note that for devices with more than 8kbits memory this command locks a entire sector (i.e : 32 blocks). This command can also be used to lock only one block (less than 8kbits devices. | |
u8 | M24LRXX_Present_Sector_Password (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u8 Password_Number, const u8 *Password) |
This function sends, through the CR95HF, a present sector password command to a M24LRXX contactless tag in the field or designated by its UID . The password provided is compared with the one within the conctactless tag. If they macth the access to all memory linked to the password is changed as set with the lock sector password command previously. | |
u8 | M24LRXX_Fast_Read_Single_Block (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, const u16 Block_number) |
This function sends, through the CR95HF, a read single block command to the M24LRXX contactless tag in the field or to an unique contactless tag designated by its UID. The particularity of this command is the datatrate used by the contactless tag to answer which is 53kbits/s. | |
u8 | M24LRXX_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) |
This function sends, through the CR95HF, a fast inventory command to the M24LRXX contactless tags in the field. The datarate of the response is multiplied by 2 (here 52kbits/s). Note that a fast initiate command should be issued before calling this function. | |
u8 | M24LRXX_Fast_Initiate (ISO15693_Tag *MyTag, const u8 Request_flags) |
This function sends, through the CR95HF, a fast initiate command to a M24LRXX contactless tag in the field or designated by its UID . On receiving the fast initiate command the M24LRXX contactless tag set the internal initiate flag ( to send a inventory initited command) and returns its UID and its DSFID, with a datarate multiplied by two (here 52kbits/s). Note that the command should not be in addressed or selected mode, the flag is reset afther a power off. | |
u8 | M24LRXX_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) |
This function sends, through the CR95HF, a read multiple block command a fast read multiple blocks command to a M24LRXX contactless tag in the field or designated by its UID . Note that data received are stored into the internal EEPROM of the MCU. | |
u8 | M24LRXX_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) |
This function sends, through the CR95HF, an inventory initiated command to the M24LRXX contactless tags in the field. On receiving the initiate command the M24LRXX contactless tag set the internal initiate flag ( to send a inventory initited command) and returns its UID and its DSFID. Note that a initiate command should be issued before calling this function. | |
u8 | M24LRXX_Initiate (ISO15693_Tag *MyTag, const u8 Request_flags) |
This function sends, through the CR95HF, an initiate command to a M24LRXX contactless tag in the field or designated by its UID . On receiving the initiate command the M24LRXX contactless tag set the internal initiate flag ( to send a inventory initited command) and returns its UID and its DSFID. Note that the command should not be in addressed or selected mode, the flag is reset afther a power off. | |
u8 | M24LRXX_ReadCfg (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID) |
This function sends, through the CR95HF, an read Config command to a M24LRXX-E contactless tag in the field or designated by its UID . On receiving the read Config command the M24LRXX-E contactless tag reads the configuration byte and sends back its value. | |
u8 | M24LRXX_Write_EH_Cfg (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, u8 Configuration_Byte) |
This function sends, through the CR95HF, an WriteEHCfg command to a M24LRXX-E contactless tag in the field or designated by its UID . On receiving the write Energy Harvesting Configuration command the M24LRXX-E contactless tag writes the data provided to the configuration byte and reports the status of the command.Note that only bits 0 to 2 are written bit 3 is ignored. | |
u8 | M24LRXX_Write_DO_Cfg (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, u8 Configuration_Byte) |
This function sends, through the CR95HF, an WriteDOCfg command to a M24LRXX-E contactless tag in the field or designated by its UID . On receiving the write Data Out Configuration command the M24LRXX-E contactless tag writes the data provided to the configuration byte and reports the status of the command. Note that only the fourth bit (bit 3) is written, bits 0 to 2 are ignored. | |
u8 | M24LRXX_SetRst_EH_en (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID, u8 Set_Reset) |
This function sends, through the CR95HF, an setRstEHen command to a M24LRXX-E contactless tag in the field or designated by its UID . On receiving the set reset Energy Harvesting Enable command the M24LRXX-E contactless tag set or reset the EHenable bit, within the volatile control register. | |
u8 | M24LRXX_Check_EH_En (ISO15693_Tag *MyTag, const u8 Request_flags, const u8 *Tag_UID) |
This function sends, through the CR95HF, an Check EH En command to a M24LRXX-E contactless tag in the field or designated by its UID . On receiving the Check Energy Harvesting enabled command the M24LRXX-E contactless tag reads the control register and sends back its value. Note that as this command is a RF command the bit 1 (field on ) is expected to be set, the main purpose of this command is detemrine if the Energy Harvesting mode is enabled. | |
u8 | M24LRXX_Is_Request_Flags_ok (const u8 Request_flags, const u8 M24LRXX_cmd_code) |
This function performs several checks to verify that the request flag is not wrong for the M24LRXX family contactless tags. | |
u8 | M24LRXX_Is_Memory_programming_function (const u8 M24LRXX_cmd_code) |
This function returns if the M24LRXX contactless tag performs a memory programming by processing the command (write, lock). Note that this functions includes the M24LRXX custom commands. | |
u8 | M24LRXX_Is_Fast_Datarate_ok (const u8 Request_flags, const CR95HF_Protocol_Config *Protocol_Settings) |
This function returns for fast commands if the datarate selected with the protocol select function is really 52kbits/s and if the requestflags is really in high datarate ( fast command multiplies the data rate per 2 (High datarate : 26kbits/s) | |
u8 | M24LRXX_Is_Fast_Command (const u8 M24LRXX_cmd_code) |
This function returns if the command is a fast command. | |
u8 | M24LRXX_Get_Block_Security_Password_number (u8 Byte_Status) |
This function returns if the block is protected by password and the number of the pasword protecting the block. | |
u8 | M24LRXX_Get_Block_Security_Read_Write_Protection_with_Password (u8 Byte_Status) |
This function returns the read write protection of the block when password is presented. | |
u8 | M24LRXX_Get_Energy_Harvesting_Range (u8 Configuration_Byte) |
This function returns the range of energy harvesting using the Configuration byte retrieved with a Read Cfg command. | |
u8 | M24LRXX_Get_RF_BUSY_WIP (u8 Configuration_Byte) |
This function returns the RF busy or Write in progress bit using the Configuration byte retrieved with a Read Cfg command. | |
u8 | M24LRXX_Get_EH_mode_Configuration_Byte (u8 Configuration_Byte) |
This function returns the Energy Harvesting Mode bit using the Configuration byte retrieved with a Read Cfg command. | |
u8 | M24LRXX_Get_EH_mode_Control_Register (u8 Control_Register) |
This function returns the Energy Harvesting Mode bit using the Control Register retrieved with a Check EH En command. | |
u8 | M24LRXX_Compute_Security_Status_byte (u8 Password_Number, u8 Read_Write_Protection_Password, u8 Read_Write_Protection_No_Password) |
The purpose of this function is to compute the security byte given the password number and the read write protection with and without password. | |
u8 | M24LRXX_Compute_Configuration_Byte (u8 RF_WIP_BUSY, u8 EH_Enable, u8 EH_Range) |
The purpose of this function is to compute the configuration byte for energy harvesting mode given the parameters Energy Harvesting activation and range. |
Header for the m24lrxx_command.c.
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.