SRD Standelone programmation box: RFIDManager.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
RFIDManager.h File Reference

Headerfile for RFID management. More...

`#include "CR95HF.h"`
`#include "PowerManager.h"`
`#include "SRDMemoryMapping.h"`
`#include "UsbManager.h"`
Include dependency graph for RFIDManager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | tRFIDCtrl
| Define a structure to control the RFID operation. More...

## Macros

#define | RFIDMANAGER_BRIDGE_MAX_COMMAND_LENGTH (64U)
| Define the maximum length of a command send to the RFID bridge. More...

## Enumerations

enum | tRFIDLpm { RFID_READY_FOR_LPM = 1, RFID_WORKING = 0 }
| Define RFID low power mode. More...
enum | tRFIDPowerMode { RFID_POWERED, RFID_HIBERNATE }
| Define RFID power mode. More...
enum | tRFIDState { RFID_STATE_LOW_POWER_INT = 1, RFID_STATE_LOW_POWER_EXT = 2, RFID_STATE_STANDBY = 4, RFID_STATE_WRITE = 8, RFID_STATE_READ = 16, RFID_STATE_BRIDGE = 32 }
| Define RFID global state. More...
enum | tRFIDStateIntLPM { RFID_State_IntLpm_Start, RFID_State_IntLpm_Echo, RFID_State_IntLpm_WaitEcho, RFID_State_IntLpm_FieldOff, RFID_State_IntLpm_WaitFieldOff, RFID_State_IntLpm_Hibernate, RFID_State_IntLpm_WaitHibernate, RFID_State_IntLpm_Finish }
| Define internal low power mode state. More...
enum | tRFIDStateExtLPM { RFID_State_ExtLpm_Start, RFID_State_ExtLpm_Echo, RFID_State_ExtLpm_WaitEcho, RFID_State_ExtLpm_FieldOff, RFID_State_ExtLpm_WaitFieldOff, RFID_State_ExtLpm_Hibernate, RFID_State_ExtLpm_WaitHibernate, RFID_State_ExtLpm_Finish }
| Define external low power mode state. More...

enum

tRFIDStateBridge {
RFID_State_Bridge_Start, RFID_State_Bridge_Antenna, RFID_State_Bridge_WaitAntenna, RFID_State_Bridge_Echo,
RFID_State_Bridge_WaitEcho, RFID_State_Bridge_FieldOn, RFID_State_Bridge_WaitFieldOn, RFID_State_Bridge_Transfert,
RFID_State_Bridge_WaitTransfert, RFID_State_Bridge_SendResult, RFID_State_Bridge_SendError, RFID_State_Bridge_Finish
}

| Define bridge mode state. More...

enum

tRFIDStateRead {
RFID_State_Read_Start, RFID_State_Read_Antenna, RFID_State_Read_WaitAntenna, RFID_State_Read_Echo,
RFID_State_Read_WaitEcho, RFID_State_Read_FieldOn, RFID_State_Read_WaitFieldOn, RFID_State_Read_Read,
RFID_State_Read_WaitRead, RFID_State_Read_Finish
}

| Define read mode state. More...

enum

tRFIDStateWrite {
RFID_State_Write_Start, RFID_State_Write_Antenna, RFID_State_Write_WaitAntenna, RFID_State_Write_Echo,
RFID_State_Write_WaitEcho, RFID_State_Write_FieldOn, RFID_State_Write_WaitFieldOn, RFID_State_Write_ReadSerial,
RFID_State_Write_WaitReadSerial, RFID_State_Write_IsWritable, RFID_State_Write_Lock, RFID_State_Write_WaitLock,
RFID_State_Write_Write, RFID_State_Write_WaitWrite, RFID_State_Write_WriteChecksum, RFID_State_Write_WaitWriteChecksum,
RFID_State_Write_Unlock, RFID_State_Write_WaitUnlock, RFID_State_Write_Read, RFID_State_Write_WaitRead,
RFID_State_Write_Finish
}

| Define write mode state. More...
enum | tRFIDResultError { RFID_RESULT_OK = 0, RFID_RESULT_INTLPM_ERROR = 1, RFID_RESULT_EXTLPM_ERROR = 2, RFID_RESULT_WRITE_ERROR = 3, RFID_RESULT_READ_ERROR = 4, RFID_RESULT_BRIDGE_ERROR = 5 }
| Define the RFID errors. More...

## Functions

void | RFIDManagerInit (void)
| Function used to initialize the RFID manager. More...
void | RFIDManager (void)
| RFID manager. More...
signed short | RFIDManagerSendBridgeCommand (char *command, unsigned short commandSize)
| function used to send a bridge command. More...

## Variables

tRFIDCtrl | RFIDCtrl
| Variable used to control the RFID manager. More...
tSRDEeprom | SRDEeprom

## Detailed Description

Headerfile for RFID management.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  25/11/2014

Version
  1.0

All Right Reserved.

Definition in file RFIDManager.h.

## Macro Definition Documentation

#define RFIDMANAGER_BRIDGE_MAX_COMMAND_LENGTH (64U)

Define the maximum length of a command send to the RFID bridge.

Definition at line 37 of file RFIDManager.h.

## Enumeration Type Documentation

enum tRFIDLpm

Define RFID low power mode.

Enumerator
RFID_READY_FOR_LPM | RFID Low Power mode
RFID_WORKING | RFID working mode

Definition at line 53 of file RFIDManager.h.

53 {
54 RFID_READY_FOR_LPM = 1, /*!< RFID Low Power mode */
55 RFID_WORKING = 0 /*!<RFID working mode */
56 }tRFIDLpm;
RFID_WORKING
Definition: RFIDManager.h:55
tRFIDLpm
tRFIDLpm
Define RFID low power mode.
Definition: RFIDManager.h:53
RFID_READY_FOR_LPM
Definition: RFIDManager.h:54

enum tRFIDPowerMode

Define RFID power mode.

Enumerator
RFID_POWERED | RFID powered
RFID_HIBERNATE | RFID hibernate

Definition at line 64 of file RFIDManager.h.

64 {
65 RFID_POWERED, /*!< RFID powered */
66 RFID_HIBERNATE /*!< RFID hibernate */
67 }tRFIDPowerMode;
tRFIDPowerMode
tRFIDPowerMode
Define RFID power mode.
Definition: RFIDManager.h:64
RFID_HIBERNATE
Definition: RFIDManager.h:66
RFID_POWERED
Definition: RFIDManager.h:65

enum tRFIDResultError

Define the RFID errors.

Enumerator
RFID_RESULT_OK | Result is valid
RFID_RESULT_INTLPM_ERROR | Internal lpm error
RFID_RESULT_EXTLPM_ERROR | External lpm error
RFID_RESULT_WRITE_ERROR | write error
RFID_RESULT_READ_ERROR | read error
RFID_RESULT_BRIDGE_ERROR | Bridge error

Definition at line 194 of file RFIDManager.h.

194 {
195 RFID_RESULT_OK = 0, /*!< Result is valid */
196 RFID_RESULT_INTLPM_ERROR = 1, /*!< Internal lpm error */
197 RFID_RESULT_EXTLPM_ERROR = 2, /*!< External lpm error */
198 RFID_RESULT_WRITE_ERROR = 3, /*!< write error */
199 RFID_RESULT_READ_ERROR = 4, /*!< read error */
200 RFID_RESULT_BRIDGE_ERROR = 5 /*!< Bridge error */
201 }tRFIDResultError;
RFID_RESULT_READ_ERROR
Definition: RFIDManager.h:199
tRFIDResultError
tRFIDResultError
Define the RFID errors.
Definition: RFIDManager.h:194
RFID_RESULT_WRITE_ERROR
Definition: RFIDManager.h:198
RFID_RESULT_EXTLPM_ERROR
Definition: RFIDManager.h:197
RFID_RESULT_INTLPM_ERROR
Definition: RFIDManager.h:196
RFID_RESULT_OK
Definition: RFIDManager.h:195
RFID_RESULT_BRIDGE_ERROR
Definition: RFIDManager.h:200

enum tRFIDState

Define RFID global state.

Enumerator
RFID_STATE_LOW_POWER_INT | Initiate internal CR95HF communication state
RFID_STATE_LOW_POWER_EXT | initiatee external CR95HF communication state
RFID_STATE_STANDBY | Standby state
RFID_STATE_WRITE | write state
RFID_STATE_READ | read state
RFID_STATE_BRIDGE | Bridge state

Definition at line 75 of file RFIDManager.h.

75 {
76 RFID_STATE_LOW_POWER_INT = 1, /*!< Initiate internal CR95HF communication state */
77 RFID_STATE_LOW_POWER_EXT = 2, /*!< initiatee external CR95HF communication state */
78 RFID_STATE_STANDBY = 4, /*!< Standby state */
79 RFID_STATE_WRITE = 8, /*!< write state */
80 RFID_STATE_READ = 16, /*!< read state */
81 RFID_STATE_BRIDGE = 32 /*!< Bridge state */
82 }tRFIDState;
RFID_STATE_READ
Definition: RFIDManager.h:80
RFID_STATE_WRITE
Definition: RFIDManager.h:79
tRFIDState
tRFIDState
Define RFID global state.
Definition: RFIDManager.h:75
RFID_STATE_BRIDGE
Definition: RFIDManager.h:81
RFID_STATE_STANDBY
Definition: RFIDManager.h:78
RFID_STATE_LOW_POWER_EXT
Definition: RFIDManager.h:77
RFID_STATE_LOW_POWER_INT
Definition: RFIDManager.h:76

enum tRFIDStateBridge

Define bridge mode state.

Enumerator
RFID_State_Bridge_Start | Start
RFID_State_Bridge_Antenna | Antenna selection
RFID_State_Bridge_WaitAntenna | Wait antenna selection
RFID_State_Bridge_Echo | Send echo
RFID_State_Bridge_WaitEcho | Wait echo
RFID_State_Bridge_FieldOn | Field on
RFID_State_Bridge_WaitFieldOn | Wait field on
RFID_State_Bridge_Transfert | trnasfert data
RFID_State_Bridge_WaitTransfert | Wait transfert data
RFID_State_Bridge_SendResult | Send result
RFID_State_Bridge_SendError | Send error
RFID_State_Bridge_Finish | Finish

Definition at line 124 of file RFIDManager.h.

124 {
125 RFID_State_Bridge_Start, /*!< Start */
126 RFID_State_Bridge_Antenna, /*!< Antenna selection */
127 RFID_State_Bridge_WaitAntenna, /*!< Wait antenna selection */
128 RFID_State_Bridge_Echo, /*!< Send echo */
129 RFID_State_Bridge_WaitEcho, /*!< Wait echo */
130 RFID_State_Bridge_FieldOn, /*!< Field on */
131 RFID_State_Bridge_WaitFieldOn, /*!< Wait field on */
132 RFID_State_Bridge_Transfert, /*!< trnasfert data */
133 RFID_State_Bridge_WaitTransfert, /*!< Wait transfert data */
134 RFID_State_Bridge_SendResult, /*!< Send result */
135 RFID_State_Bridge_SendError, /*!< Send error */
136 RFID_State_Bridge_Finish /*!< Finish */
137 }tRFIDStateBridge;
RFID_State_Bridge_Start
Definition: RFIDManager.h:125
RFID_State_Bridge_WaitTransfert
Definition: RFIDManager.h:133
RFID_State_Bridge_FieldOn
Definition: RFIDManager.h:130
RFID_State_Bridge_SendResult
Definition: RFIDManager.h:134
tRFIDStateBridge
tRFIDStateBridge
Define bridge mode state.
Definition: RFIDManager.h:124
RFID_State_Bridge_SendError
Definition: RFIDManager.h:135
RFID_State_Bridge_WaitAntenna
Definition: RFIDManager.h:127
RFID_State_Bridge_Transfert
Definition: RFIDManager.h:132
RFID_State_Bridge_WaitEcho
Definition: RFIDManager.h:129
RFID_State_Bridge_Finish
Definition: RFIDManager.h:136
RFID_State_Bridge_WaitFieldOn
Definition: RFIDManager.h:131
RFID_State_Bridge_Antenna
Definition: RFIDManager.h:126
RFID_State_Bridge_Echo
Definition: RFIDManager.h:128

enum tRFIDStateExtLPM

Define external low power mode state.

Enumerator
RFID_State_ExtLpm_Start | Start
RFID_State_ExtLpm_Echo | Send echo
RFID_State_ExtLpm_WaitEcho | Wait echo
RFID_State_ExtLpm_FieldOff | Field off
RFID_State_ExtLpm_WaitFieldOff | Wait field off
RFID_State_ExtLpm_Hibernate | hibernate
RFID_State_ExtLpm_WaitHibernate | Wait hibernate
RFID_State_ExtLpm_Finish | Finish

Definition at line 107 of file RFIDManager.h.

107 {
108 RFID_State_ExtLpm_Start, /*!< Start */
109 RFID_State_ExtLpm_Echo, /*!< Send echo */
110 RFID_State_ExtLpm_WaitEcho, /*!< Wait echo */
111 RFID_State_ExtLpm_FieldOff, /*!< Field off */
112 RFID_State_ExtLpm_WaitFieldOff, /*!< Wait field off */
113 RFID_State_ExtLpm_Hibernate, /*!< hibernate */
114 RFID_State_ExtLpm_WaitHibernate,/*!< Wait hibernate */
115 RFID_State_ExtLpm_Finish /*!< Finish */
116 }tRFIDStateExtLPM;
RFID_State_ExtLpm_Start
Definition: RFIDManager.h:108
RFID_State_ExtLpm_Hibernate
Definition: RFIDManager.h:113
RFID_State_ExtLpm_WaitEcho
Definition: RFIDManager.h:110
RFID_State_ExtLpm_Finish
Definition: RFIDManager.h:115
RFID_State_ExtLpm_Echo
Definition: RFIDManager.h:109
RFID_State_ExtLpm_FieldOff
Definition: RFIDManager.h:111
RFID_State_ExtLpm_WaitFieldOff
Definition: RFIDManager.h:112
RFID_State_ExtLpm_WaitHibernate
Definition: RFIDManager.h:114
tRFIDStateExtLPM
tRFIDStateExtLPM
Define external low power mode state.
Definition: RFIDManager.h:107

enum tRFIDStateIntLPM

Define internal low power mode state.

Enumerator
RFID_State_IntLpm_Start | Start
RFID_State_IntLpm_Echo | Send echo
RFID_State_IntLpm_WaitEcho | Wait echo
RFID_State_IntLpm_FieldOff | Field off
RFID_State_IntLpm_WaitFieldOff | Wait field off
RFID_State_IntLpm_Hibernate | hibernate
RFID_State_IntLpm_WaitHibernate | Wait hibernate
RFID_State_IntLpm_Finish | Finish

Definition at line 90 of file RFIDManager.h.

90 {
91 RFID_State_IntLpm_Start, /*!< Start */
92 RFID_State_IntLpm_Echo, /*!< Send echo */
93 RFID_State_IntLpm_WaitEcho, /*!< Wait echo */
94 RFID_State_IntLpm_FieldOff, /*!< Field off */
95 RFID_State_IntLpm_WaitFieldOff, /*!< Wait field off */
96 RFID_State_IntLpm_Hibernate, /*!< hibernate */
97 RFID_State_IntLpm_WaitHibernate, /*!< Wait hibernate */
98 RFID_State_IntLpm_Finish /*!< Finish */
99 }tRFIDStateIntLPM;
RFID_State_IntLpm_Start
Definition: RFIDManager.h:91
RFID_State_IntLpm_WaitEcho
Definition: RFIDManager.h:93
RFID_State_IntLpm_WaitFieldOff
Definition: RFIDManager.h:95
RFID_State_IntLpm_Finish
Definition: RFIDManager.h:98
RFID_State_IntLpm_Echo
Definition: RFIDManager.h:92
tRFIDStateIntLPM
tRFIDStateIntLPM
Define internal low power mode state.
Definition: RFIDManager.h:90
RFID_State_IntLpm_FieldOff
Definition: RFIDManager.h:94
RFID_State_IntLpm_Hibernate
Definition: RFIDManager.h:96
RFID_State_IntLpm_WaitHibernate
Definition: RFIDManager.h:97

enum tRFIDStateRead

Define read mode state.

Enumerator
RFID_State_Read_Start | Start
RFID_State_Read_Antenna | Antenna selection
RFID_State_Read_WaitAntenna | Wait antenna selection
RFID_State_Read_Echo | send echo
RFID_State_Read_WaitEcho | wait echo
RFID_State_Read_FieldOn | field on
RFID_State_Read_WaitFieldOn | wait field on
RFID_State_Read_Read | read
RFID_State_Read_WaitRead | wait read
RFID_State_Read_Finish | finish

Definition at line 145 of file RFIDManager.h.

145 {
146 RFID_State_Read_Start, /*!< Start */
147 RFID_State_Read_Antenna, /*!< Antenna selection */
148 RFID_State_Read_WaitAntenna, /*!< Wait antenna selection */
149 RFID_State_Read_Echo, /*!< send echo */
150 RFID_State_Read_WaitEcho, /*!< wait echo */
151 RFID_State_Read_FieldOn, /*!< field on */
152 RFID_State_Read_WaitFieldOn, /*!< wait field on */
153 RFID_State_Read_Read, /*!< read */
154 RFID_State_Read_WaitRead, /*!< wait read */
155 RFID_State_Read_Finish, /*!< finish */
156 }tRFIDStateRead;
RFID_State_Read_WaitAntenna
Definition: RFIDManager.h:148
RFID_State_Read_Start
Definition: RFIDManager.h:146
RFID_State_Read_FieldOn
Definition: RFIDManager.h:151
RFID_State_Read_Read
Definition: RFIDManager.h:153
RFID_State_Read_Antenna
Definition: RFIDManager.h:147
tRFIDStateRead
tRFIDStateRead
Define read mode state.
Definition: RFIDManager.h:145
RFID_State_Read_WaitRead
Definition: RFIDManager.h:154
RFID_State_Read_Finish
Definition: RFIDManager.h:155
RFID_State_Read_Echo
Definition: RFIDManager.h:149
RFID_State_Read_WaitFieldOn
Definition: RFIDManager.h:152
RFID_State_Read_WaitEcho
Definition: RFIDManager.h:150

enum tRFIDStateWrite

Define write mode state.

Enumerator
RFID_State_Write_Start | Start
RFID_State_Write_Antenna | antenna selection
RFID_State_Write_WaitAntenna | wait antenna selection
RFID_State_Write_Echo | Send echo
RFID_State_Write_WaitEcho | Wait echo
RFID_State_Write_FieldOn | Filed on
RFID_State_Write_WaitFieldOn | Wait field on
RFID_State_Write_ReadSerial | Read serial
RFID_State_Write_WaitReadSerial | Wait read serial
RFID_State_Write_IsWritable | Check if device is writable
RFID_State_Write_Lock | lock device
RFID_State_Write_WaitLock | wait lock
RFID_State_Write_Write | Write data
RFID_State_Write_WaitWrite | Wait data written
RFID_State_Write_WriteChecksum | Write checksum
RFID_State_Write_WaitWriteChecksum | Wait checksum written
RFID_State_Write_Unlock | unlock device
RFID_State_Write_WaitUnlock | Wait unlock
RFID_State_Write_Read | Read back result
RFID_State_Write_WaitRead | Wait read
RFID_State_Write_Finish | Finish

Definition at line 164 of file RFIDManager.h.

164 {
165 RFID_State_Write_Start, /*!< Start */
166 RFID_State_Write_Antenna, /*!< antenna selection */
167 RFID_State_Write_WaitAntenna, /*!< wait antenna selection */
168 RFID_State_Write_Echo, /*!< Send echo */
169 RFID_State_Write_WaitEcho, /*!< Wait echo */
170 RFID_State_Write_FieldOn, /*!< Filed on */
171 RFID_State_Write_WaitFieldOn, /*!< Wait field on */
172 RFID_State_Write_ReadSerial, /*!< Read serial */
173 RFID_State_Write_WaitReadSerial, /*!< Wait read serial */
174 RFID_State_Write_IsWritable, /*!< Check if device is writable */
175 RFID_State_Write_Lock, /*!< lock device */
176 RFID_State_Write_WaitLock, /*!< wait lock */
177 RFID_State_Write_Write, /*!< Write data */
178 RFID_State_Write_WaitWrite, /*!< Wait data written */
179 RFID_State_Write_WriteChecksum, /*!< Write checksum */
180 RFID_State_Write_WaitWriteChecksum, /*!< Wait checksum written */
181 RFID_State_Write_Unlock, /*!< unlock device */
182 RFID_State_Write_WaitUnlock, /*!< Wait unlock */
183 RFID_State_Write_Read, /*!< Read back result */
184 RFID_State_Write_WaitRead, /*!< Wait read */
185 RFID_State_Write_Finish, /*!< Finish */
186 }tRFIDStateWrite;
RFID_State_Write_WaitWrite
Definition: RFIDManager.h:178
RFID_State_Write_WaitAntenna
Definition: RFIDManager.h:167
RFID_State_Write_WaitEcho
Definition: RFIDManager.h:169
tRFIDStateWrite
tRFIDStateWrite
Define write mode state.
Definition: RFIDManager.h:164
RFID_State_Write_WaitWriteChecksum
Definition: RFIDManager.h:180
RFID_State_Write_WriteChecksum
Definition: RFIDManager.h:179
RFID_State_Write_WaitFieldOn
Definition: RFIDManager.h:171
RFID_State_Write_WaitUnlock
Definition: RFIDManager.h:182
RFID_State_Write_Lock
Definition: RFIDManager.h:175
RFID_State_Write_WaitRead
Definition: RFIDManager.h:184
RFID_State_Write_WaitReadSerial
Definition: RFIDManager.h:173
RFID_State_Write_FieldOn
Definition: RFIDManager.h:170
RFID_State_Write_Read
Definition: RFIDManager.h:183
RFID_State_Write_Unlock
Definition: RFIDManager.h:181
RFID_State_Write_IsWritable
Definition: RFIDManager.h:174
RFID_State_Write_Write
Definition: RFIDManager.h:177
RFID_State_Write_Start
Definition: RFIDManager.h:165
RFID_State_Write_Echo
Definition: RFIDManager.h:168
RFID_State_Write_ReadSerial
Definition: RFIDManager.h:172
RFID_State_Write_WaitLock
Definition: RFIDManager.h:176
RFID_State_Write_Antenna
Definition: RFIDManager.h:166
RFID_State_Write_Finish
Definition: RFIDManager.h:185

## Function Documentation

void RFIDManager | ( | void |  | ) |

RFID manager.

Definition at line 93 of file RFIDManager.c.

References tRFIDCtrl::all, tRFIDCtrl::bits, CR95_EXT_CONNECTED, CR95ExtGetConnectionState(), CR95HFManager(), tRFIDCtrl::lpm, tRFIDCtrl::msRef, tRFIDCtrl::request, tRFIDCtrl::result, RFID_HIBERNATE, RFID_POWERED, RFID_READY_FOR_LPM, RFID_RESULT_OK, RFID_STATE_BRIDGE, RFID_State_Bridge_Start, RFID_State_ExtLpm_Start, RFID_State_IntLpm_Start, RFID_STATE_LOW_POWER_EXT, RFID_STATE_LOW_POWER_INT, RFID_STATE_READ, RFID_State_Read_Start, RFID_STATE_STANDBY, RFID_STATE_WRITE, RFID_State_Write_Start, RFID_WORKING, RFIDDealer(), RFIDExternalPowerMode, RFIDInternalPowerMode, tRFIDCtrl::state, tRFIDCtrl::subState, and TickMilliSecElapsedFrom().

Referenced by taskBackground().

93 {
94
95 /*=== Wait for RFID ready ===*/
96 if(RFIDCtrl.state == RFID_STATE_STANDBY) {
97
98 /*=== If no request for the moment ===*/
99 if(RFIDCtrl.request.all == 0) {
100
101 if(RFIDCtrl.msRef == 0) {
102
103 /*-- Try to put all device in LPM --*/
104 if(RFIDInternalPowerMode == RFID_POWERED) {
105 RFIDCtrl.state = RFID_STATE_LOW_POWER_INT;
106 RFIDCtrl.subState = RFID_State_IntLpm_Start;
107 //RFIDCtrl.result = RFID_RESULT_OK;
108
109 } else if (CR95ExtGetConnectionState() == CR95_EXT_CONNECTED) {
110 if(RFIDExternalPowerMode == RFID_POWERED) {
111 RFIDCtrl.state = RFID_STATE_LOW_POWER_EXT;
112 RFIDCtrl.subState = RFID_State_ExtLpm_Start;
113 //RFIDCtrl.result = RFID_RESULT_OK;
114 }
115 } else {
116 RFIDExternalPowerMode = RFID_HIBERNATE;
117 }
118
119 if(RFIDExternalPowerMode == RFID_HIBERNATE && RFIDInternalPowerMode == RFID_HIBERNATE) {
120 RFIDCtrl.lpm = RFID_READY_FOR_LPM;
121 }
122
123 } else {
124
125 if(TickMilliSecElapsedFrom(RFIDCtrl.msRef) > 1000) {
126 RFIDCtrl.msRef = 0;
127 }
128
129 }
130
131 /*=== Deal request ===*/
132 } else {
133
134 RFIDCtrl.lpm = RFID_WORKING;
135
136 if(RFIDCtrl.request.bits.read) {
137 RFIDCtrl.state = RFID_STATE_READ;
138 RFIDCtrl.subState = RFID_State_Read_Start;
139 RFIDCtrl.result = RFID_RESULT_OK;
140 }
141
142 else if(RFIDCtrl.request.bits.write) {
143 RFIDCtrl.state = RFID_STATE_WRITE;
144 RFIDCtrl.subState = RFID_State_Write_Start;
145 RFIDCtrl.result = RFID_RESULT_OK;
146 }
147
148 else if(RFIDCtrl.request.bits.bridge) {
149 RFIDCtrl.state = RFID_STATE_BRIDGE;
150 RFIDCtrl.subState = RFID_State_Bridge_Start;
151 RFIDCtrl.result = RFID_RESULT_OK;
152 }
153 }
154 } else {
155 RFIDCtrl.lpm = RFID_WORKING;
156 }
157
158 RFIDDealer();
159
160 /*=== Deal CR95 Manager ===*/
161 CR95HFManager();
162 }
RFID_STATE_READ
Definition: RFIDManager.h:80
RFID_State_Read_Start
Definition: RFIDManager.h:146
RFID_State_Bridge_Start
Definition: RFIDManager.h:125
RFIDDealer
void RFIDDealer(void)
Definition: RFIDManager.c:165
CR95ExtGetConnectionState
tCR95ExternalConnexion CR95ExtGetConnectionState(void)
Return the connection state of the CR95HF module.
Definition: CR95UartMapper.c:174
RFID_State_ExtLpm_Start
Definition: RFIDManager.h:108
RFID_STATE_WRITE
Definition: RFIDManager.h:79
CR95HFManager
void CR95HFManager(void)
Global manager of the CR95HF module.
Definition: CR95HF.c:598
RFID_State_IntLpm_Start
Definition: RFIDManager.h:91
tRFIDCtrl::bits
struct tRFIDCtrl::@6::@7 bits
RFID_WORKING
Definition: RFIDManager.h:55
tRFIDCtrl::lpm
tRFIDLpm lpm
Definition: RFIDManager.h:223
RFID_HIBERNATE
Definition: RFIDManager.h:66
tRFIDCtrl::result
tRFIDResultError result
Definition: RFIDManager.h:221
tRFIDCtrl::msRef
unsigned long msRef
Definition: RFIDManager.h:229
tRFIDCtrl::request
union tRFIDCtrl::@6 request
tRFIDCtrl::all
unsigned short all
Definition: RFIDManager.h:217
RFIDInternalPowerMode
tRFIDPowerMode RFIDInternalPowerMode
Definition: RFIDManager.c:50
RFID_STATE_BRIDGE
Definition: RFIDManager.h:81
RFID_READY_FOR_LPM
Definition: RFIDManager.h:54
RFID_STATE_STANDBY
Definition: RFIDManager.h:78
CR95_EXT_CONNECTED
Definition: CR95UartMapper.h:66
RFID_STATE_LOW_POWER_EXT
Definition: RFIDManager.h:77
RFIDExternalPowerMode
tRFIDPowerMode RFIDExternalPowerMode
Definition: RFIDManager.c:51
RFID_State_Write_Start
Definition: RFIDManager.h:165
tRFIDCtrl::state
tRFIDState state
Definition: RFIDManager.h:219
RFID_STATE_LOW_POWER_INT
Definition: RFIDManager.h:76
tRFIDCtrl::subState
unsigned long subState
Definition: RFIDManager.h:220
RFID_POWERED
Definition: RFIDManager.h:65
TickMilliSecElapsedFrom
unsigned long TickMilliSecElapsedFrom(unsigned long refTimeMs)
Get the milliseconds counter.
Definition: tick.c:141
RFIDCtrl
tRFIDCtrl RFIDCtrl
Variable used to control the RFID manager.
Definition: RFIDManager.c:59
RFID_RESULT_OK
Definition: RFIDManager.h:195

Here is the call graph for this function:

Here is the caller graph for this function:

void RFIDManagerInit | ( | void |  | ) |

Function used to initialize the RFID manager.

Definition at line 79 of file RFIDManager.c.

References CR95HFInit(), tRFIDCtrl::lpm, tRFIDCtrl::msRef, RFID_POWERED, RFID_STATE_STANDBY, RFID_WORKING, RFIDExternalPowerMode, RFIDInternalPowerMode, and tRFIDCtrl::state.

Referenced by Setup().

79 {
80
81 CR95HFInit();
82 RFIDInternalPowerMode = RFID_POWERED;
83 RFIDExternalPowerMode = RFID_POWERED;
84
85 RFIDCtrl.state = RFID_STATE_STANDBY;
86
87 RFIDCtrl.lpm = RFID_WORKING;
88
89 RFIDCtrl.msRef = 0;
90
91 }
RFID_WORKING
Definition: RFIDManager.h:55
tRFIDCtrl::lpm
tRFIDLpm lpm
Definition: RFIDManager.h:223
tRFIDCtrl::msRef
unsigned long msRef
Definition: RFIDManager.h:229
RFIDInternalPowerMode
tRFIDPowerMode RFIDInternalPowerMode
Definition: RFIDManager.c:50
RFID_STATE_STANDBY
Definition: RFIDManager.h:78
RFIDExternalPowerMode
tRFIDPowerMode RFIDExternalPowerMode
Definition: RFIDManager.c:51
tRFIDCtrl::state
tRFIDState state
Definition: RFIDManager.h:219
RFID_POWERED
Definition: RFIDManager.h:65
RFIDCtrl
tRFIDCtrl RFIDCtrl
Variable used to control the RFID manager.
Definition: RFIDManager.c:59
CR95HFInit
void CR95HFInit(void)
Function used to initialize the CR95HF global manager.
Definition: CR95HF.c:585

Here is the call graph for this function:

Here is the caller graph for this function:

signed short RFIDManagerSendBridgeCommand | ( | char * | command,
|  | unsigned short | commandSize
| ) |  |

function used to send a bridge command.

Parameters

  [in] | command | (char*) : pointer on data to send over the bridge.
  [in] | commandSize | (unsigned short) : data length to send over the bridge interface.

Definition at line 763 of file RFIDManager.c.

References tRFIDCtrl::bits, tRFIDCtrl::bridgeCommand, tRFIDCtrl::bridgeCommandLength, and tRFIDCtrl::request.

Referenced by UsbManagerCmdDealer().

763 {
764
765 //if(RFIDCtrl.state == RFID_STATE_STANDBY) {
766 unsigned short i;
767
768 for(i=0 ; i<commandSize ; i++) {
769 RFIDCtrl.bridgeCommand[i] = *(command+i);
770 }
771
772 RFIDCtrl.bridgeCommandLength = commandSize;
773
774 RFIDCtrl.request.bits.bridge = 1;
775
776 return 0;
777
778 //} else {
779 // return -1; //Error
780 //}
781 }
tRFIDCtrl::bridgeCommandLength
unsigned short bridgeCommandLength
Definition: RFIDManager.h:227
tRFIDCtrl::bits
struct tRFIDCtrl::@6::@7 bits
tRFIDCtrl::request
union tRFIDCtrl::@6 request
tRFIDCtrl::bridgeCommand
unsigned char bridgeCommand[RFIDMANAGER_BRIDGE_MAX_COMMAND_LENGTH]
Definition: RFIDManager.h:225
RFIDCtrl
tRFIDCtrl RFIDCtrl
Variable used to control the RFID manager.
Definition: RFIDManager.c:59

Here is the caller graph for this function:

## Variable Documentation

tRFIDCtrl RFIDCtrl

Variable used to control the RFID manager.

Definition at line 59 of file RFIDManager.c.

Referenced by ButtonManagerDealer(), and PowerManagerLPMController().

tSRDEeprom SRDEeprom

Definition at line 61 of file RFIDManager.c.

Referenced by ButtonManagerDealer(), ButtonManagerDisplayRead(), and ButtonManagerDisplayWrite().