SRD Standelone programmation box: CR95HF.h File Reference

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
Data Structures | Macros | Enumerations | Functions | Variables
CR95HF.h File Reference

Headerfile for CR95HF driver. More...

`#include "CR95UartMapper.h"`
`#include "StringTools.h"`
`#include "Tick.h"`
Include dependency graph for CR95HF.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | tCR95HFCtrl
| Define the structure used to control the CR95HF module. More...

## Macros

#define | CR95HF_UART_BAUDRATE (57600U)
| Define the baudrate of the interface used to communicate with the CR95HF. More...
#define | CR95HF_ECHO_MAX_TRY (20U)
| Define the maximum number of echo sended to try to establish a communication with the CR95HF. More...
#define | CR95HF_RX_BUF_SIZE (128U)
| Define the buffer size. More...
#define | CR95HF_ANSWER_BUF_SIZE (64U)
| Define the buffer size. More...

## Enumerations

enum | tCR95HFCommand { CR95HF_COMMAND_NONE = 0, CR95HF_COMMAND_ECHO, CR95HF_COMMAND_FIELDOFF, CR95HF_COMMAND_FIELD15693, CR95HF_COMMAND_HIBERNATE, CR95HF_COMMAND_READ, CR95HF_COMMAND_WRITE, CR95HF_COMMAND_BRIDGE }
| Define the global state machine of the CR95HF interface. More...
enum | tCR95HFEchoState { CR95HF_EchoState_Start, CR95HF_EchoState_Send, CR95HF_EchoState_WaitAnswer, CR95HF_EchoState_Finish }
| Define the different state of the Echo global state machine. More...
enum | tCR95HFFieldOffState { CR95HF_FieldOffState_Start, CR95HF_FieldOffState_Send, CR95HF_FieldOffState_WaitAnswer, CR95HF_FieldOffState_Finish }
| Define the different state of the Field off state machine. More...
enum | tCR95HFField15693State { CR95HF_Field15693State_Start, CR95HF_Field15693State_Send, CR95HF_Field15693State_WaitAnswer, CR95HF_Field15693State_Finish }
| Define the different state of the enable ISO15693 Field state machine. More...
enum | tCR95HFHibernateState { CR95HF_HibernateState_Start, CR95HF_HibernateState_Send, CR95HF_HibernateState_WaitAnswer, CR95HF_HibernateState_Finish }
| Define the different state of the hibernate state machine. More...
enum | tCR95HFReadState { CR95HF_ReadState_Start, CR95HF_ReadState_Send, CR95HF_ReadState_WaitAnswer, CR95HF_ReadState_Finish }
| Define the different state of the read state machine. More...
enum | tCR95HFWriteState { CR95HF_WriteState_Start, CR95HF_WriteState_Send, CR95HF_WriteState_WaitAnswer, CR95HF_WriteState_Finish }
| Define the different state of the write state machine. More...
enum | tCR95HFBridgeState { CR95HF_BridgeState_Start, CR95HF_BridgeState_Send, CR95HF_BridgeState_WaitAnswer, CR95HF_BridgeState_Finish }
| Define the different state of the bridge state machine. More...

enum

tCR95HFReturn {
CR95HF_RETURN_WORKING = 0, CR95HF_RETURN_OK = 1, CR95HF_RETURN_ECHO_ERROR = 2, CR95HF_RETURN_FIELDOFF_ERROR = 3,
CR95HF_RETURN_FIELD15693_ERROR = 4, CR95HF_RETURN_HIBERNATE_ERROR = 5, CR95HF_RETURN_READ_ERROR = 6, CR95HF_RETURN_WRITE_ERROR = 7,
CR95HF_RETURN_STATEMACHINE_ERROR = 0xFFFE, CR95HF_RETURN_BUSY = 0xFFFF
}

| Define the module error. More...
enum | tCR95HFIsReady { CR95HF_IS_BUSY, CR95HF_IS_READY }
| Define constant to indicate if module is used or not. More...

## Functions

void | CR95HFInit (void)
| Function used to initialize the CR95HF global manager. More...
void | CR95HFManager (void)
| Global manager of the CR95HF module. More...
tCR95HFIsReady | CR95HFManagerIsReady ()
| Return the current state of the CR95HF module in it's manager. More...
void | CR95HFStartEcho (void)
| Manager used to deal each specific state. More...
void | CR95HFStartFieldOff (void)
| Manager used to deal each specific state. More...
void | CR95HFStartField15693 (void)
| Manager used to deal each specific state. More...
void | CR95HFStartHibernate (void)
| Manager used to deal each specific state. More...
void | CR95HFStartRead (unsigned short addr)
| Manager used to deal each specific state. More...
void | CR95HFStartWrite (unsigned short addr, unsigned long data)
| Manager used to deal each specific state. More...
void | CR95HFStartBridge (char *data, unsigned short dataLength)
| Manager used to deal each specific state. More...

## Variables

tCR95HFCtrl | CR95HFCtrl
| Variable used by the state machine of the CR95HF. More...

## Detailed Description

Headerfile for CR95HF driver.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  25/11/2014

Version
  1.0

All Right Reserved.

Definition in file CR95HF.h.

## Macro Definition Documentation

#define CR95HF_ANSWER_BUF_SIZE (64U)

Define the buffer size.

Definition at line 45 of file CR95HF.h.

#define CR95HF_ECHO_MAX_TRY (20U)

Define the maximum number of echo sended to try to establish a communication with the CR95HF.

Definition at line 54 of file CR95HF.h.

Referenced by CR95HFEchoStateMachine().

#define CR95HF_RX_BUF_SIZE (128U)

Define the buffer size.

Definition at line 44 of file CR95HF.h.

Referenced by CR95HFWriteCommand().

#define CR95HF_UART_BAUDRATE (57600U)

Define the baudrate of the interface used to communicate with the CR95HF.

Definition at line 36 of file CR95HF.h.

Referenced by CR95HFInit().

## Enumeration Type Documentation

enum tCR95HFBridgeState

Define the different state of the bridge state machine.

Enumerator
CR95HF_BridgeState_Start | Start
CR95HF_BridgeState_Send | Send command bridge
CR95HF_BridgeState_WaitAnswer | Wait answer
CR95HF_BridgeState_Finish | Finish

Definition at line 166 of file CR95HF.h.

166 {
167 CR95HF_BridgeState_Start, /*!< Start */
168 CR95HF_BridgeState_Send, /*!< Send command bridge */
169 CR95HF_BridgeState_WaitAnswer, /*!< Wait answer */
170 CR95HF_BridgeState_Finish /*!< Finish */
171 }tCR95HFBridgeState;
CR95HF_BridgeState_Send
Definition: CR95HF.h:168
tCR95HFBridgeState
tCR95HFBridgeState
Define the different state of the bridge state machine.
Definition: CR95HF.h:166
CR95HF_BridgeState_WaitAnswer
Definition: CR95HF.h:169
CR95HF_BridgeState_Finish
Definition: CR95HF.h:170
CR95HF_BridgeState_Start
Definition: CR95HF.h:167

enum tCR95HFCommand

Define the global state machine of the CR95HF interface.

Enumerator
CR95HF_COMMAND_NONE | Standby
CR95HF_COMMAND_ECHO | Echo
CR95HF_COMMAND_FIELDOFF | Field off command
CR95HF_COMMAND_FIELD15693 | Field enable and configured for ISO15693
CR95HF_COMMAND_HIBERNATE | Module hibernate
CR95HF_COMMAND_READ | Read operation
CR95HF_COMMAND_WRITE | Write operation
CR95HF_COMMAND_BRIDGE | Bridge command

Definition at line 71 of file CR95HF.h.

71 {
72 CR95HF_COMMAND_NONE = 0, /*!< Standby */
73 CR95HF_COMMAND_ECHO, /*!< Echo */
74 CR95HF_COMMAND_FIELDOFF, /*!< Field off command */
75 CR95HF_COMMAND_FIELD15693, /*!< Field enable and configured for ISO15693 */
76 CR95HF_COMMAND_HIBERNATE, /*!< Module hibernate */
77 CR95HF_COMMAND_READ, /*!< Read operation */
78 CR95HF_COMMAND_WRITE, /*!< Write operation */
79 CR95HF_COMMAND_BRIDGE /*!< Bridge command */
80 }tCR95HFCommand;
tCR95HFCommand
tCR95HFCommand
Define the global state machine of the CR95HF interface.
Definition: CR95HF.h:71
CR95HF_COMMAND_WRITE
Definition: CR95HF.h:78
CR95HF_COMMAND_READ
Definition: CR95HF.h:77
CR95HF_COMMAND_FIELD15693
Definition: CR95HF.h:75
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
CR95HF_COMMAND_HIBERNATE
Definition: CR95HF.h:76
CR95HF_COMMAND_ECHO
Definition: CR95HF.h:73
CR95HF_COMMAND_BRIDGE
Definition: CR95HF.h:79
CR95HF_COMMAND_FIELDOFF
Definition: CR95HF.h:74

enum tCR95HFEchoState

Define the different state of the Echo global state machine.

Enumerator
CR95HF_EchoState_Start | Start
CR95HF_EchoState_Send | Send echo command
CR95HF_EchoState_WaitAnswer | Wait answer
CR95HF_EchoState_Finish | Finish

Definition at line 88 of file CR95HF.h.

88 {
89 CR95HF_EchoState_Start, /*!< Start */
90 CR95HF_EchoState_Send, /*!< Send echo command */
91 CR95HF_EchoState_WaitAnswer, /*!< Wait answer */
92 CR95HF_EchoState_Finish /*!< Finish */
93 }tCR95HFEchoState;
CR95HF_EchoState_Finish
Definition: CR95HF.h:92
tCR95HFEchoState
tCR95HFEchoState
Define the different state of the Echo global state machine.
Definition: CR95HF.h:88
CR95HF_EchoState_Send
Definition: CR95HF.h:90
CR95HF_EchoState_Start
Definition: CR95HF.h:89
CR95HF_EchoState_WaitAnswer
Definition: CR95HF.h:91

enum tCR95HFField15693State

Define the different state of the enable ISO15693 Field state machine.

Enumerator
CR95HF_Field15693State_Start | Start
CR95HF_Field15693State_Send | Send configuration for IS15693
CR95HF_Field15693State_WaitAnswer | Wait answer
CR95HF_Field15693State_Finish | Finish

Definition at line 114 of file CR95HF.h.

114 {
115 CR95HF_Field15693State_Start, /*!< Start */
116 CR95HF_Field15693State_Send, /*!< Send configuration for IS15693 */
117 CR95HF_Field15693State_WaitAnswer, /*!< Wait answer */
118 CR95HF_Field15693State_Finish /*!< Finish */
119 } tCR95HFField15693State;
tCR95HFField15693State
tCR95HFField15693State
Define the different state of the enable ISO15693 Field state machine.
Definition: CR95HF.h:114
CR95HF_Field15693State_Start
Definition: CR95HF.h:115
CR95HF_Field15693State_Send
Definition: CR95HF.h:116
CR95HF_Field15693State_WaitAnswer
Definition: CR95HF.h:117
CR95HF_Field15693State_Finish
Definition: CR95HF.h:118

enum tCR95HFFieldOffState

Define the different state of the Field off state machine.

Enumerator
CR95HF_FieldOffState_Start | Start
CR95HF_FieldOffState_Send | Send filed off command
CR95HF_FieldOffState_WaitAnswer | Wait answer
CR95HF_FieldOffState_Finish | Finish

Definition at line 101 of file CR95HF.h.

101 {
102 CR95HF_FieldOffState_Start, /*!< Start */
103 CR95HF_FieldOffState_Send, /*!< Send filed off command */
104 CR95HF_FieldOffState_WaitAnswer, /*!< Wait answer */
105 CR95HF_FieldOffState_Finish /*!< Finish */
106 }tCR95HFFieldOffState;
CR95HF_FieldOffState_Finish
Definition: CR95HF.h:105
CR95HF_FieldOffState_WaitAnswer
Definition: CR95HF.h:104
tCR95HFFieldOffState
tCR95HFFieldOffState
Define the different state of the Field off state machine.
Definition: CR95HF.h:101
CR95HF_FieldOffState_Send
Definition: CR95HF.h:103
CR95HF_FieldOffState_Start
Definition: CR95HF.h:102

enum tCR95HFHibernateState

Define the different state of the hibernate state machine.

Enumerator
CR95HF_HibernateState_Start | Start
CR95HF_HibernateState_Send | Send hibernate command
CR95HF_HibernateState_WaitAnswer | Wait answer
CR95HF_HibernateState_Finish |

Definition at line 127 of file CR95HF.h.

127 {
128 CR95HF_HibernateState_Start, /*!< Start */
129 CR95HF_HibernateState_Send, /*!< Send hibernate command */
130 CR95HF_HibernateState_WaitAnswer, /*!< Wait answer */
131 CR95HF_HibernateState_Finish /*:< Finish */
132 }tCR95HFHibernateState;
CR95HF_HibernateState_Finish
Definition: CR95HF.h:131
tCR95HFHibernateState
tCR95HFHibernateState
Define the different state of the hibernate state machine.
Definition: CR95HF.h:127
CR95HF_HibernateState_Start
Definition: CR95HF.h:128
CR95HF_HibernateState_Send
Definition: CR95HF.h:129
CR95HF_HibernateState_WaitAnswer
Definition: CR95HF.h:130

enum tCR95HFIsReady

Define constant to indicate if module is used or not.

Enumerator
CR95HF_IS_BUSY | CR95HF is busy
CR95HF_IS_READY | CR95HF is ready

Definition at line 234 of file CR95HF.h.

234 {
235 CR95HF_IS_BUSY, /*!< CR95HF is busy */
236 CR95HF_IS_READY /*!< CR95HF is ready */
237 }tCR95HFIsReady;
CR95HF_IS_BUSY
Definition: CR95HF.h:235
tCR95HFIsReady
tCR95HFIsReady
Define constant to indicate if module is used or not.
Definition: CR95HF.h:234
CR95HF_IS_READY
Definition: CR95HF.h:236

enum tCR95HFReadState

Define the different state of the read state machine.

Enumerator
CR95HF_ReadState_Start | Start
CR95HF_ReadState_Send | Send read command
CR95HF_ReadState_WaitAnswer | Wait answer
CR95HF_ReadState_Finish | Finish

Definition at line 140 of file CR95HF.h.

140 {
141 CR95HF_ReadState_Start, /*!< Start */
142 CR95HF_ReadState_Send, /*!< Send read command */
143 CR95HF_ReadState_WaitAnswer, /*!< Wait answer */
144 CR95HF_ReadState_Finish /*!< Finish */
145 }tCR95HFReadState;
CR95HF_ReadState_Finish
Definition: CR95HF.h:144
tCR95HFReadState
tCR95HFReadState
Define the different state of the read state machine.
Definition: CR95HF.h:140
CR95HF_ReadState_Start
Definition: CR95HF.h:141
CR95HF_ReadState_WaitAnswer
Definition: CR95HF.h:143
CR95HF_ReadState_Send
Definition: CR95HF.h:142

enum tCR95HFReturn

Define the module error.

Enumerator
CR95HF_RETURN_WORKING | Module is working
CR95HF_RETURN_OK | module return OK
CR95HF_RETURN_ECHO_ERROR | Module echo error
CR95HF_RETURN_FIELDOFF_ERROR | Module field off error
CR95HF_RETURN_FIELD15693_ERROR | Module ISO15693 error
CR95HF_RETURN_HIBERNATE_ERROR | Module hibernate error
CR95HF_RETURN_READ_ERROR | Module read error
CR95HF_RETURN_WRITE_ERROR | Module write error
CR95HF_RETURN_STATEMACHINE_ERROR | State machine error
CR95HF_RETURN_BUSY | Module is busy

Definition at line 180 of file CR95HF.h.

180 {
181 CR95HF_RETURN_WORKING = 0, /*!< Module is working */
182 CR95HF_RETURN_OK = 1, /*!< module return OK */
183 CR95HF_RETURN_ECHO_ERROR = 2, /*!< Module echo error */
184 CR95HF_RETURN_FIELDOFF_ERROR = 3, /*!< Module field off error*/
185 CR95HF_RETURN_FIELD15693_ERROR = 4, /*!< Module ISO15693 error */
186 CR95HF_RETURN_HIBERNATE_ERROR = 5, /*!< Module hibernate error */
187 CR95HF_RETURN_READ_ERROR = 6, /*!< Module read error */
188 CR95HF_RETURN_WRITE_ERROR = 7, /*!< Module write error */
189 CR95HF_RETURN_STATEMACHINE_ERROR = 0xFFFE, /*!< State machine error */
190 CR95HF_RETURN_BUSY = 0xFFFF /*!< Module is busy */
191 }tCR95HFReturn;
CR95HF_RETURN_WRITE_ERROR
Definition: CR95HF.h:188
CR95HF_RETURN_FIELD15693_ERROR
Definition: CR95HF.h:185
CR95HF_RETURN_READ_ERROR
Definition: CR95HF.h:187
CR95HF_RETURN_FIELDOFF_ERROR
Definition: CR95HF.h:184
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
CR95HF_RETURN_STATEMACHINE_ERROR
Definition: CR95HF.h:189
CR95HF_RETURN_HIBERNATE_ERROR
Definition: CR95HF.h:186
CR95HF_RETURN_BUSY
Definition: CR95HF.h:190
CR95HF_RETURN_OK
Definition: CR95HF.h:182
tCR95HFReturn
tCR95HFReturn
Define the module error.
Definition: CR95HF.h:180
CR95HF_RETURN_ECHO_ERROR
Definition: CR95HF.h:183

enum tCR95HFWriteState

Define the different state of the write state machine.

Enumerator
CR95HF_WriteState_Start | Start
CR95HF_WriteState_Send | Send write command and data
CR95HF_WriteState_WaitAnswer | Wait answer
CR95HF_WriteState_Finish | Finish

Definition at line 153 of file CR95HF.h.

153 {
154 CR95HF_WriteState_Start, /*!< Start */
155 CR95HF_WriteState_Send, /*!< Send write command and data */
156 CR95HF_WriteState_WaitAnswer, /*!< Wait answer */
157 CR95HF_WriteState_Finish /*!< Finish */
158 }tCR95HFWriteState;
CR95HF_WriteState_WaitAnswer
Definition: CR95HF.h:156
CR95HF_WriteState_Start
Definition: CR95HF.h:154
CR95HF_WriteState_Send
Definition: CR95HF.h:155
tCR95HFWriteState
tCR95HFWriteState
Define the different state of the write state machine.
Definition: CR95HF.h:153
CR95HF_WriteState_Finish
Definition: CR95HF.h:157

## Function Documentation

void CR95HFInit | ( | void |  | ) |

Function used to initialize the CR95HF global manager.

Definition at line 585 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, tCR95HFCtrl::completionTimeMs, CR95HF_COMMAND_NONE, CR95HF_UART_BAUDRATE, CR95UartInit(), tCR95HFCtrl::flags, tCR95HFCtrl::refMs, tCR95HFCtrl::rxPos, and tCR95HFCtrl::timeoutMs.

Referenced by RFIDManagerInit().

585 {
586 CR95UartInit(CR95HF_UART_BAUDRATE);
587
588 CR95HFCtrl.flags.all = 0;
589 CR95HFCtrl.rxPos = 0;
590 CR95HFCtrl.refMs = 0;
591 CR95HFCtrl.timeoutMs = 0;
592 CR95HFCtrl.completionTimeMs = 0;
593 CR95HFCtrl.command = CR95HF_COMMAND_NONE;
594 CR95HFCtrl.commandState = 0;
595 }
tCR95HFCtrl::completionTimeMs
unsigned short completionTimeMs
Definition: CR95HF.h:218
tCR95HFCtrl::refMs
unsigned long refMs
Definition: CR95HF.h:216
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_UART_BAUDRATE
#define CR95HF_UART_BAUDRATE
Define the baudrate of the interface used to communicate with the CR95HF.
Definition: CR95HF.h:36
CR95UartInit
void CR95UartInit(unsigned long baudrate)
CR95HF Uart interface.
Definition: CR95UartMapper.c:84
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::rxPos
unsigned short rxPos
Definition: CR95HF.h:212
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219
tCR95HFCtrl::timeoutMs
unsigned long timeoutMs
Definition: CR95HF.h:217

Here is the call graph for this function:

Here is the caller graph for this function:

void CR95HFManager | ( | void |  | ) |

Global manager of the CR95HF module.

Definition at line 598 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::answerKeyWord, tCR95HFCtrl::answerSize, tCR95HFCtrl::bits, tCR95HFCtrl::completionTimeMs, CR95HFBufCompare(), CR95HFCommandManager(), CR95HFReadAnswer(), tCR95HFCtrl::flags, tCR95HFCtrl::receiveBuf, tCR95HFCtrl::refMs, tCR95HFCtrl::rxPos, TickMilliSecElapsedFrom(), tCR95HFCtrl::timeoutMs, and tCR95HFCtrl::waitForNbrRx.

Referenced by RFIDManager().

598 {
599
600 unsigned long timeElapsed = 0;
601
602 if(CR95HFCtrl.flags.bits.isWorking) {
603 timeElapsed = TickMilliSecElapsedFrom(CR95HFCtrl.refMs);
604
605 if(timeElapsed > CR95HFCtrl.timeoutMs) {
606 CR95HFCtrl.flags.bits.timeout = 1;
607 }
608 }
609
610 if(CR95HFCtrl.flags.all == 0x0001) { //Only working flag
611
612 if(timeElapsed >= CR95HFCtrl.completionTimeMs) {
613
614 CR95HFReadAnswer();
615
616 if(CR95HFCtrl.waitForNbrRx == 0) {
617
618 if(CR95HFBufCompare(CR95HFCtrl.receiveBuf, CR95HFCtrl.rxPos, CR95HFCtrl.answerKeyWord, CR95HFCtrl.answerSize) != -1) {
619 CR95HFCtrl.flags.bits.anwserReceived = 1;
620 }
621 } else {
622
623 if((CR95HFCtrl.rxPos + 1) > CR95HFCtrl.waitForNbrRx) {
624 CR95HFCtrl.flags.bits.sizeReceive = 1;
625 }
626 }
627 }
628 } else {
629 CR95HFCommandManager();
630 }
631 }
CR95HFBufCompare
signed short CR95HFBufCompare(char *dataBuf, unsigned short dataBufSize, char *dataBufRef, unsigned short dataBufRefSize)
Definition: CR95HF.c:129
tCR95HFCtrl::completionTimeMs
unsigned short completionTimeMs
Definition: CR95HF.h:218
tCR95HFCtrl::waitForNbrRx
unsigned short waitForNbrRx
Definition: CR95HF.h:215
tCR95HFCtrl::refMs
unsigned long refMs
Definition: CR95HF.h:216
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
CR95HFReadAnswer
void CR95HFReadAnswer(void)
Definition: CR95HF.c:115
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
tCR95HFCtrl::answerSize
unsigned short answerSize
Definition: CR95HF.h:214
tCR95HFCtrl::receiveBuf
char receiveBuf[CR95HF_RX_BUF_SIZE]
Definition: CR95HF.h:211
tCR95HFCtrl::bits
struct tCR95HFCtrl::@17::@18 bits
tCR95HFCtrl::rxPos
unsigned short rxPos
Definition: CR95HF.h:212
tCR95HFCtrl::answerKeyWord
char answerKeyWord[CR95HF_ANSWER_BUF_SIZE]
Definition: CR95HF.h:213
TickMilliSecElapsedFrom
unsigned long TickMilliSecElapsedFrom(unsigned long refTimeMs)
Get the milliseconds counter.
Definition: tick.c:141
CR95HFCommandManager
void CR95HFCommandManager(void)
Definition: CR95HF.c:161
tCR95HFCtrl::timeoutMs
unsigned long timeoutMs
Definition: CR95HF.h:217

Here is the call graph for this function:

Here is the caller graph for this function:

tCR95HFIsReady CR95HFManagerIsReady | ( |  | ) |

Return the current state of the CR95HF module in it's manager.

Definition at line 718 of file CR95HF.c.

References tCR95HFCtrl::command, CR95HF_COMMAND_NONE, CR95HF_IS_BUSY, and CR95HF_IS_READY.

Referenced by RFIDBridgeStateMachine(), RFIDExtLpmStateMachine(), RFIDIntLpmStateMachine(), RFIDReadStateMachine(), and RFIDWriteStateMachine().

718 {
719 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
720 return CR95HF_IS_READY;
721 } else {
722 return CR95HF_IS_BUSY;
723 }
724 }
CR95HF_IS_BUSY
Definition: CR95HF.h:235
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_IS_READY
Definition: CR95HF.h:236
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

void CR95HFStartBridge | ( | char * | data,
|  | unsigned short | dataLength
| ) |  |

Manager used to deal each specific state.

Definition at line 699 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::bridgeCommand, tCR95HFCtrl::bridgeCommandLength, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_BridgeState_Start, CR95HF_COMMAND_BRIDGE, CR95HF_COMMAND_NONE, CR95HF_RETURN_WORKING, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDBridgeStateMachine().

699 {
700
701 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
702
703 unsigned char i;
704
705 for(i=0 ; i<dataLength ; i++) {
706 CR95HFCtrl.bridgeCommand[i] = *(data+i);
707 }
708
709 CR95HFCtrl.bridgeCommandLength = dataLength;
710
711 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
712 CR95HFCtrl.command = CR95HF_COMMAND_BRIDGE;
713 CR95HFCtrl.commandState = CR95HF_BridgeState_Start;
714 CR95HFCtrl.flags.all = 0;
715 }
716 }
tCR95HFCtrl::bridgeCommand
char bridgeCommand[CR95HF_ANSWER_BUF_SIZE]
Definition: CR95HF.h:224
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
tCR95HFCtrl::bridgeCommandLength
unsigned short bridgeCommandLength
Definition: CR95HF.h:225
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
CR95HF_BridgeState_Start
Definition: CR95HF.h:167
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219
CR95HF_COMMAND_BRIDGE
Definition: CR95HF.h:79

Here is the caller graph for this function:

void CR95HFStartEcho | ( | void |  | ) |

Manager used to deal each specific state.

Definition at line 635 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_ECHO, CR95HF_COMMAND_NONE, CR95HF_EchoState_Start, CR95HF_RETURN_WORKING, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDBridgeStateMachine(), RFIDExtLpmStateMachine(), RFIDIntLpmStateMachine(), RFIDReadStateMachine(), and RFIDWriteStateMachine().

635 {
636
637 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
638 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
639 CR95HFCtrl.command = CR95HF_COMMAND_ECHO;
640 CR95HFCtrl.commandState = CR95HF_EchoState_Start;
641 CR95HFCtrl.flags.all = 0;
642 }
643 }
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
CR95HF_COMMAND_ECHO
Definition: CR95HF.h:73
CR95HF_EchoState_Start
Definition: CR95HF.h:89
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

void CR95HFStartField15693 | ( | void |  | ) |

Manager used to deal each specific state.

Definition at line 655 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_FIELD15693, CR95HF_COMMAND_NONE, CR95HF_Field15693State_Start, CR95HF_RETURN_WORKING, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDBridgeStateMachine(), RFIDReadStateMachine(), and RFIDWriteStateMachine().

655 {
656
657 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
658 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
659 CR95HFCtrl.command = CR95HF_COMMAND_FIELD15693;
660 CR95HFCtrl.commandState = CR95HF_Field15693State_Start;
661 CR95HFCtrl.flags.all = 0;
662 }
663 }
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_Field15693State_Start
Definition: CR95HF.h:115
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
CR95HF_COMMAND_FIELD15693
Definition: CR95HF.h:75
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

void CR95HFStartFieldOff | ( | void |  | ) |

Manager used to deal each specific state.

Definition at line 645 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_FIELDOFF, CR95HF_COMMAND_NONE, CR95HF_FieldOffState_Start, CR95HF_RETURN_WORKING, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDExtLpmStateMachine(), and RFIDIntLpmStateMachine().

645 {
646
647 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
648 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
649 CR95HFCtrl.command = CR95HF_COMMAND_FIELDOFF;
650 CR95HFCtrl.commandState = CR95HF_FieldOffState_Start;
651 CR95HFCtrl.flags.all = 0;
652 }
653 }
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219
CR95HF_COMMAND_FIELDOFF
Definition: CR95HF.h:74
CR95HF_FieldOffState_Start
Definition: CR95HF.h:102

Here is the caller graph for this function:

void CR95HFStartHibernate | ( | void |  | ) |

Manager used to deal each specific state.

Definition at line 666 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_HIBERNATE, CR95HF_COMMAND_NONE, CR95HF_HibernateState_Start, CR95HF_RETURN_WORKING, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDExtLpmStateMachine(), and RFIDIntLpmStateMachine().

666 {
667
668 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
669 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
670 CR95HFCtrl.command = CR95HF_COMMAND_HIBERNATE;
671 CR95HFCtrl.commandState = CR95HF_HibernateState_Start;
672 CR95HFCtrl.flags.all = 0;
673 }
674 }
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HF_HibernateState_Start
Definition: CR95HF.h:128
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
CR95HF_COMMAND_HIBERNATE
Definition: CR95HF.h:76
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

void CR95HFStartRead | ( | unsigned short | addr | ) |

Manager used to deal each specific state.

Definition at line 676 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_NONE, CR95HF_COMMAND_READ, CR95HF_ReadState_Start, CR95HF_RETURN_WORKING, tCR95HFCtrl::deviceRegAddr, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDReadStateMachine(), and RFIDWriteStateMachine().

676 {
677
678 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
679 CR95HFCtrl.deviceRegAddr = addr;
680 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
681 CR95HFCtrl.command = CR95HF_COMMAND_READ;
682 CR95HFCtrl.commandState = CR95HF_ReadState_Start;
683 CR95HFCtrl.flags.all = 0;
684 }
685 }
tCR95HFCtrl::deviceRegAddr
unsigned short deviceRegAddr
Definition: CR95HF.h:222
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
CR95HF_COMMAND_READ
Definition: CR95HF.h:77
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
CR95HF_ReadState_Start
Definition: CR95HF.h:141
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

void CR95HFStartWrite | ( | unsigned short | addr,
|  | unsigned long | data
| ) |  |

Manager used to deal each specific state.

Definition at line 687 of file CR95HF.c.

References tCR95HFCtrl::all, tCR95HFCtrl::command, tCR95HFCtrl::commandState, CR95HF_COMMAND_NONE, CR95HF_COMMAND_WRITE, CR95HF_RETURN_WORKING, CR95HF_WriteState_Start, tCR95HFCtrl::deviceReg, tCR95HFCtrl::deviceRegAddr, tCR95HFCtrl::flags, and tCR95HFCtrl::resultCode.

Referenced by RFIDWriteStateMachine().

687 {
688
689 if(CR95HFCtrl.command == CR95HF_COMMAND_NONE) {
690 CR95HFCtrl.deviceRegAddr = addr;
691 CR95HFCtrl.deviceReg = data;
692 CR95HFCtrl.resultCode = CR95HF_RETURN_WORKING;
693 CR95HFCtrl.command = CR95HF_COMMAND_WRITE;
694 CR95HFCtrl.commandState = CR95HF_WriteState_Start;
695 CR95HFCtrl.flags.all = 0;
696 }
697 }
tCR95HFCtrl::deviceReg
unsigned long deviceReg
Definition: CR95HF.h:223
tCR95HFCtrl::deviceRegAddr
unsigned short deviceRegAddr
Definition: CR95HF.h:222
tCR95HFCtrl::all
unsigned short all
Definition: CR95HF.h:208
CR95HF_COMMAND_WRITE
Definition: CR95HF.h:78
CR95HF_WriteState_Start
Definition: CR95HF.h:154
tCR95HFCtrl::flags
union tCR95HFCtrl::@17 flags
CR95HFCtrl
tCR95HFCtrl CR95HFCtrl
Variable used by the state machine of the CR95HF.
Definition: CR95HF.c:67
CR95HF_RETURN_WORKING
Definition: CR95HF.h:181
tCR95HFCtrl::resultCode
unsigned long resultCode
Definition: CR95HF.h:221
CR95HF_COMMAND_NONE
Definition: CR95HF.h:72
tCR95HFCtrl::commandState
unsigned long commandState
Definition: CR95HF.h:220
tCR95HFCtrl::command
tCR95HFCommand command
Definition: CR95HF.h:219

Here is the caller graph for this function:

## Variable Documentation

tCR95HFCtrl CR95HFCtrl

Variable used by the state machine of the CR95HF.

Definition at line 67 of file CR95HF.c.

Referenced by RFIDBridgeStateMachine(), RFIDExtLpmStateMachine(), RFIDIntLpmStateMachine(), RFIDReadStateMachine(), and RFIDWriteStateMachine().