as3993 ST25RU3993 Firmware
as3993_public.h
Go to the documentation of this file.
1 /*
2  *****************************************************************************
3  * AS3993/ST25RU3993 Firmware tech@eleckits.com http://iot.eleckits.com *
4  * STMicroelectronics ST25RU3993 is an EPC Class 1 Gen 2 RFID reader IC *
5  * *
6  * IMPORTANT - PLEASE READ CAREFULLY BEFORE COPYING, INSTALLING OR USING *
7  * THE SOFTWARE. *
8  * *
9  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
10  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
11  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
12  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
13  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
14  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
15  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
16  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
17  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
18  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
19  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
20  *****************************************************************************
21  */
35 #ifndef _AS3993_PUBLIC_H_
36 #define _AS3993_PUBLIC_H_
37 
38 #include "global.h"
39 #include "errno_as3993.h"
40 
46 #define AS3993_ERR_NORES ERR_CHIP_NORESP
47 #define AS3993_ERR_PREAMBLE ERR_CHIP_PREAMBLE
48 #define AS3993_ERR_HEADER ERR_CHIP_HEADER
49 #define AS3993_ERR_FIFO_OVER ERR_CHIP_FIFO
50 #define AS3993_ERR_RXCOUNT ERR_CHIP_RXCOUNT
51 #define AS3993_ERR_CRC ERR_CHIP_CRCERROR
52 #define AS3993_ERR_RXERR ERR_CHIP_RXERR
53 
58 struct TagInfo_
59 {
61  u8 rn16[2];
62 
64  u8 pc[2];
66  u8 epc[EPCLENGTH]; /* epc must immediately follow pc */
68  u8 epclen; /*length in bytes */
70  u8 handle[2];
72  u8 rssi;
74  u8 agc;
76  u8 tidlength; /*length in bytes */
79 };
80 
82 typedef struct TagInfo_ Tag;
83 
90 typedef struct
91 {
93  u8 numFreqs;
94 
96  u32 freq[MAXFREQ];
97 #ifdef TUNER
98 
99  u16 countFreqHop[MAXFREQ];
100 #endif
101 } Freq;
102 
103 #ifdef TUNER
104 
108 typedef struct
109 {
115  unsigned long freq[MAXTUNE];
117  u8 tuneEnable[MAXTUNE];
119  u8 cin[2][MAXTUNE];
121  u8 clen[2][MAXTUNE];
123  u8 cout[2][MAXTUNE];
125  u16 tunedIQ[2][MAXTUNE];
126 } TuningTable;
127 #endif
128 
141 u16 as3993Initialize(u32 baseFreq);
142 
147 u8 as3993ReadChipVersion(void);
148 
149 /*------------------------------------------------------------------------- */
155 void as3993SetBaseFrequency(u8 regs, u32 frequency);
156 
157 /*------------------------------------------------------------------------- */
161 void as3993AntennaPower( u8 on);
162 #ifdef EXTPA
163 /*------------------------------------------------------------------------- */
175 void as3993GetRSSIMaxSensitive( u16 num_of_ms_to_scan, u8 *rawIQ);
176 /*------------------------------------------------------------------------- */
186 void as3993GetRSSI( u16 num_of_ms_to_scan, u8 *rawIQ);
187 /*------------------------------------------------------------------------- */
193 #endif
194 s8 as3993SetSensitivity( s8 minimumSignal );
195 
196 /*------------------------------------------------------------------------- */
199 s8 as3993GetSensitivity( void );
200 
201 /*------------------------------------------------------------------------- */
212 u16 as3993GetReflectedPower( void );
213 
214 /*------------------------------------------------------------------------- */
223 
224 /*------------------------------------------------------------------------- */
229 void as3993Reset(void);
230 
231 /*------------------------------------------------------------------------- */
236 
237 /*------------------------------------------------------------------------- */
270 s8 as3993TxRxGen2Bytes(u8 cmd, u8 *txbuf, u16 txbits,
271  u8 *rxbuf, u16 *rxbits,
272  u8 norestime, u8 followCmd,
273  u8 waitTxIrq);
274 
291 s8 as3980HandleResponseWithHeaderBit(s8 ret, u8 *destbuf, u16 rxbits, u8 const * handle);
292 
295 s8 as3993GetADC( void );
296 #endif /* _AS3993_PUBLIC_H_ */
s8 as3993TxRxGen2Bytes(u8 cmd, u8 *txbuf, u16 txbits, u8 *rxbuf, u16 *rxbits, u8 norestime, u8 followCmd, u8 waitTxIrq)
Definition: as3993.c:1180
u8 rn16[2]
Definition: as3993_public.h:61
u16 as3993GetReflectedPowerNoiseLevel(void)
Definition: as3993.c:1153
This file provides defines for error codes reported by the FW to the host.
s8 as3993GetADC(void)
Definition: as3993.c:1116
u8 epc[EPCLENGTH]
Definition: as3993_public.h:66
u16 as3993Initialize(u32 baseFreq)
Definition: as3993.c:127
This file provides declarations for global helper functions.
u8 tid[TIDLENGTH]
Definition: as3993_public.h:78
s8 as3993GetSensitivity()
Definition: as3993.c:921
s8 as3980HandleResponseWithHeaderBit(s8 ret, u8 *destbuf, u16 rxbits, u8 const *handle)
void as3993SetBaseFrequency(u8 regs, u32 frequency)
Definition: as3993.c:633
void as3993Reset(void)
Definition: as3993.c:789
u8 as3993ReadChipVersion(void)
Definition: as3993.c:438
u8 pc[2]
Definition: as3993_public.h:64
void as3993ResetDoNotPreserveRegisters(void)
Definition: as3993.c:796
void as3993AntennaPower(u8 on)
Definition: as3993.c:875
#define TIDLENGTH
Definition: global.h:67
#define MAXFREQ
Definition: global.h:73
u16 as3993GetReflectedPower(void)
Definition: as3993.c:1126
#define EPCLENGTH
Definition: global.h:65
#define MAXTUNE
Definition: global.h:75
u8 handle[2]
Definition: as3993_public.h:70