![]() |
STM8L libraries for CR95HF 1.0
|
This file contains all the functions in order to send commands to the CR95HF. More...
#include "cr95hf_command.h"
Functions | |
u8 | CR95HF_IDN (CR95HF_ResponseReceiving *IDN_Response) |
This function sends an IDN command. | |
u8 | CR95HF_ProtocolSelect (const u8 Protocol, const u8 ParametersLength, const u8 *Parameters, CR95HF_Protocol_Config *Protocol_Settings) |
This function sends a protocol select command. | |
u8 | CR95HF_SendRecv (CR95HF_ResponseReceiving *SendRecv_Response, CR95HF_CommandSending *SendRecv_Command) |
this function sends an Send Receive command allowing user to perform communication with tag protocol must be selected before calling this function | |
u8 | CR95HF_Idle (const u8 WakeUpFlags, const u8 EnterCtrlL, const u8 EnterCtrlH, const u8 WUCtrlL, const u8 WUCtrlH, const u8 LeaveCtrlL, const u8 LeaveCtrlH, const u8 WUPeriod, const u8 OscStart, const u8 DacStart, const u8 DacDataL, const u8 DacDataH, const u8 SwingsCnt, const u8 MaxSleep, CR95HF_Idle_Config *Idle_Config) |
This function sends an idle command using the parameters provided. | |
u8 | CR95HF_Rd_Wake_up_Reg (CR95HF_ResponseReceiving *Response, CR95HF_Idle_Config *Idle_Config) |
This function reads the wake up register of the CR95HF to determine what caused the awakening of the CR95HF after an Idle command. | |
u8 | CR95HF_Rd_Analog_Register_Config_B (CR95HF_ResponseReceiving *Response) |
This function reads the RCB register of the CR95HF to check the analog configuration Register containing the modulation depth and reader chain gain. Note that a CR95HF_Set_Analog_Register_Config_B_Index command must be issued before reading the register. | |
u8 | CR95HF_Set_Analog_Register_Config_B_Index (void) |
This command is used to set the address index before reading the analog configuration register. | |
u8 | CR95HF_Wr_Analog_Register_Config_B_Reg (u8 Analog_Configuration_Register) |
This command is used to overwrite the Analog Configuration Register. | |
u8 | CR95HF_Baud_Rate (const u8 New_Baud_Rate) |
This function changes the baud rate communication between MCU and CR95HF. If the command fails last. | |
u8 | CR95HF_Echo (void) |
this function sends an ECHO command | |
u8 | CR95HF_FieldOff (CR95HF_Protocol_Config *Protocol_Settings) |
This function swithes the RF Field Off using the protocol select comand. | |
u8 | CR95HF_SendEOF (CR95HF_ResponseReceiving *Response) |
This function sends an End Of Frame. This can be used for instance in ISO15693 inventory command or write command. Right after the EOF the tag could answer a command (Write or Inventory), so the response is received and written into the structure provided. | |
u8 | CR95HF_Modify_Baud_Rate (const u8 New_Baud_Rate) |
This function is a procedure to change Baud_Rate in UART communication. The function calls the Baud_Rate function and changes the MCU internal baud rate. In case of failure the function tries to recover the communication by returning into the previous baud rate or into the default baud rate. | |
void | CR95HF_SendCommand (CR95HF_CommandSending *Cmd) |
This function sends a command to the cr95hf. | |
CR95HF_ResponseReceiving | CR95HF_ReceiveAnswer (void) |
this function receives and returns the response to a command previously sent to the cr95hf | |
void | CR95HF_Wait_Receive_Answer (CR95HF_ResponseReceiving *Response) |
This function waits and receive the answer frrom the CR95HF. | |
void | CR95HF_Init_ResponseReceiving (CR95HF_ResponseReceiving *Response) |
this function initialize the response structure to erase previous data from any other command this allows to be sure that resp_code is not issued by random data | |
void | CR95HF_Add_Data_ToCommand (CR95HF_CommandSending *Cmd, u8 *Cptr_ToIncrement, u8 DataLength, u8 *Data) |
This function add an array of data into the command's data and increments the counter of data. | |
u8 | CR95HF_IsReaderResultOK (CR95HF_ResponseReceiving *Response, const u8 Code_OK) |
This function checks if the CR95HF has answered a success code. | |
u8 | CR95HF_ISO15693_ComputeParameterByte_ProtocolSelect (u8 Bit7_6, u8 Bit5_4, u8 Bit3, u8 Bit2, u8 Bit1) |
This function computes the parameter byte for iso15693 protocol Select command, bit0 is forced to 1 to append CRC. | |
u8 | CR95HF_Is_IRQin_Interrupt_Wake_up_Condition (const u8 WUFlags) |
This function is related to the idle mode. Its first goal is to determine whether an interrupt on IRQ_in is a wakeup condition (For instance if the CR95HF is in idle Mode, this function could also be called to determine which way to use to wake up the CR95HF).It can also be called once the CR95HF has woken up to determine if the CR95HF woke up because of timeout.Note that for the first case the WuFlags issued for the Idle command sould be given as input parameter (available in the CR95HF_Idle_Config structure) and for the second the case afther having issued CR95HF_Rd_Wake_up_Reg the last_reason_of_wakeup field of the CR95HF_Idle_Config structure may be used as input parameter. | |
u8 | CR95HF_Is_NSS_Interrupt_Wake_up_Condition (const u8 WUFlags) |
This function is related to the idle mode. Its first goal is to determine whether an interrupt on NSS is a wakeup condition (For instance if the CR95HF is in idle Mode, this function could also be called to determine which way to use to wake up the CR95HF).It can also be called once the CR95HF has woken up to determine if the CR95HF woke up because of timeout.Note that for the first case the WuFlags issued for the Idle command sould be given as input parameter (available in the CR95HF_Idle_Config structure) and for the second the case afther having issued CR95HF_Rd_Wake_up_Reg the last_reason_of_wakeup field of the CR95HF_Idle_Config structure may be used as input parameter. | |
u8 | CR95HF_Is_Tag_Detected_Wake_up_Condition (const u8 WUFlags) |
This function is related to the idle mode. Its first goal is to determine whether a tag detection is a wakeup condition (For instance if the CR95HF is in idle Mode, this function could also be called to determine which way to use to wake up the CR95HF).It can also be called once the CR95HF has woken up to determine if the CR95HF woke up because of timeout.Note that for the first case the WuFlags issued for the Idle command sould be given as input parameter (available in the CR95HF_Idle_Config structure) and for the second the case afther having issued CR95HF_Rd_Wake_up_Reg the last_reason_of_wakeup field of the CR95HF_Idle_Config structure may be used as input parameter. | |
u8 | CR95HF_Is_Timeout_Wake_up_Condition (const u8 WUFlags) |
This function is related to the idle mode. Its goal is to determine whether the internal timer is a wakeup condition (For instance if the CR95HF is in idle Mode, this fucntion could be called to determine which way to use to wake up the CR95HF).It can also be called once the CR95HF has woken up to determine if the CR95HF woke up because of timeout.Note that for the first case the WuFlags issued for the Idle command sould be given as input parameter (available in the CR95HF_Idle_Config structure) and for the second the case afther having issued CR95HF_Rd_Wake_up_Reg the last_reason_of_wakeup field of the CR95HF_Idle_Config structure may be used as input parameter. | |
u8 | CR95HF_Idle_Detector_Calibration (CR95HF_Protocol_Config *Protocol_Settings, CR95HF_Idle_Config *Idle_Config) |
The purpose of this function is to perform the detector calibration according to the Application Note : | |
u8 | CR95HF_Tagdet (const u8 DacDataL, const u8 DacDataH) |
The purpose of this function is to perform the detector calibration according to the Application Note : AN3433 Tag Detection Calibration Process. | |
u8 | CR95HF_Wait_Wake_up_from_Idle (CR95HF_ResponseReceiving *CR95HF_Response_Idle, CR95HF_Idle_Config *Idle_Config, u8 Number_of_DELAY_BEFORE_TIMEOUT_250MS) |
The purpose of this function is to wait for CR95HF exiting the idle mode and retrieve what caused the wake-up. The method proposed is to wait for the CR95HF answer and then to send several echo command in order to resume communication and clear the fifo stack. Note that this function waits for CR95HF wakes up on its own (internal timer, tag detection), after this function the CR95HF_Wake_up_CR95HF fucntion may be called to wake up the CR95HF with NNS or IRQ_in interrupt. | |
u8 | CR95HF_Wake_up_CR95HF (CR95HF_Idle_Config *Idle_Config) |
The purpose of this function is to avoid getting stuck when the CR95HF exists idle mode. The method proposed is to send several echo command in order to resume communication and clear the fifo stack. | |
Variables | |
u8 | SPI_or_UART_Communication |
u32 | MCU_Baud_Rate |
u8 | communication_watchdog |
CR95HF_CommandSending | CR95HF_Cmd_to_Send |
CR95HF_ResponseReceiving | CR95HF_Response |
This file contains all the functions in order to send commands to the CR95HF.
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.
Common Stucture used to transmit data within commands
Common Stucture used to receive data within commands