WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
globals.h File Reference

Global definitions, typedefs, variables. More...

#include <msp430.h>
#include "config/pin-assign.h"
#include <stdint.h>
#include "config/wispGuts.h"

Go to the source code of this file.

Data Structures

struct  RFIDstruct
 
struct  RWstruct
 

Macros

#define FOREVER   (1)
 
#define NEVER   (0)
 
#define TRUE   (1)
 
#define FALSE   (0)
 
#define HIGH   (1)
 
#define LOW   (0)
 
#define FAIL   (0)
 
#define SUCCESS   (1)
 
#define EPC_WORDS   (6) /* length of EPC value in words, 0 <= n <= 31 */
 
#define CMDBUFF_SIZE   (30) /* ? */
 
#define DATABUFF_SIZE   (2+(EPC_WORDS<<1)+2) /* first2/last2 are reserved. put data into B2..B13 */
 
#define RFIDBUFF_SIZE   (1+16+2+2+50) /* longest command handled is the read command for 8 wds*/
 
#define USRBANK_SIZE   (32) /* ? */
 
#define RFID_SEED   (0x1234)
 
#define CMD_PARSE_AS_QUERY_REP   (0x00) /** @todo describe these myst vals! */
 
#define CMD_PARSE_AS_OVF   (0xFF)
 
#define ENOUGH_BITS_TO_FORCE_EXECUTION   (200)
 
#define RESET_BITS_VAL   (-2) /* this is the value which will reset the TA1_SM if found in 'bits (R5)' by rfid_sm */
 
#define RTCAL_MIN   (200)
 
#define RTCAL_MAX   (300)
 
#define TRCAL_MIN   (220)
 
#define TRCAL_MAX   (900)
 
#define TX_TIMING_QUERY   (24)/*53.5-60us (depends on which Q value is loaded). */
 
#define TX_TIMING_ACK   (20)/*60.0us*/
 
#define TX_TIMING_QR   (52)
 
#define TX_TIMING_QA   (48)
 
#define TX_TIMING_REQRN   (33)
 
#define TX_TIMING_READ   (29)
 
#define TX_TIMING_WRITE   (31)
 
#define QUERY_TIMEOUT_PERIOD   (65535)
 
#define NUM_SEL_BITS   (48) /* only need to parse through mask: (4+3+3+2+8+8+16 = 44 -> round to 48) */
 
#define NUM_QUERY_BITS   (22)
 
#define NUM_ACK_BITS   (18)
 
#define NUM_REQRN_BITS   (40)
 
#define NUM_WRITE_BITS   (66)
 
#define EPC_LENGTH   (EPC_WORDS) /* 10h..14h EPC Length in Words. (6 is 96bit std) */
 
#define UMI   (0x01) /* 15h User-Memory Indicator. '1' means the tag has user memory available. */
 
#define XI   (0x00) /* 16h XPC_W1 indicator. '0' means the tag does not support this feature. */
 
#define NSI   (0x00) /* 17h..1Fh Numbering System Identifier. */
 
#define TREXT_ON   (1) /* Tag should use TRext format for backscatter */
 
#define TREXT_OFF   (0) /* Tag shouldn't use TRext format for backscatter */
 
#define WRITE_DATA_BLINK_LED   (0x00)
 
#define WRITE_DATA_NEW_ID   (0x01)
 
#define bits   _get_R5_register()
 
#define dest   _get_R4_register()
 
#define setBits(x)   _set_R5_register(x)
 
#define setDest(x)   _set_R4_register(x)
 
#define BITSET(port, pin)   port |= (pin)
 
#define BITCLR(port, pin)   port &= ~(pin)
 
#define BITTOG(port, pin)   port ^= (pin)
 
#define STORED_PC   ( ((EPC_LENGTH&0x001F)<<11) | ((UMI&0x0001)<<10) | ((XI&0x0001)<<9) | (NSI&0x01FF)<<01 )
 
#define STORED_PC1   ( (STORED_PC&0xFF00)>>8 )
 
#define STORED_PC0   ( (STORED_PC&0x00FF)>>0 )
 

Typedefs

typedef uint8_t BOOL
 

Functions

void WISP_doRFID (void)
 
void TxFM0 (volatile uint8_t *data, uint8_t numBytes, uint8_t numBits, uint8_t TRext)
 
void RX_ISR (void)
 
void Timer0A0_ISR (void)
 
void Timer0A1_ISR (void)
 
void Timer1A0_ISR (void)
 
void handleQuery (void)
 
void handleAck (void)
 
void handleQR (void)
 
void handleQA (void)
 
void handleReq_RN (void)
 
void handleRead (void)
 
void handleWrite (void)
 
void handleBlockWrite (void)
 

Variables

RFIDstruct rfid
 
RWstruct RWData
 
uint8_t cmd [CMDBUFF_SIZE]
 
uint8_t dataBuf [DATABUFF_SIZE]
 
uint8_t rfidBuf [RFIDBUFF_SIZE]
 
uint8_t usrBank [USRBANK_SIZE]
 
uint16_t wisp_ID
 
volatile uint8_t isDoingLowPwrSleep
 

Detailed Description

Global definitions, typedefs, variables.

Author
Justin Reina, UW Sensor Systems Lab 4.14.12 rev

Macro Definition Documentation

◆ BITCLR

#define BITCLR (   port,
  pin 
)    port &= ~(pin)

◆ bits

#define bits   _get_R5_register()

◆ BITSET

#define BITSET (   port,
  pin 
)    port |= (pin)

◆ BITTOG

#define BITTOG (   port,
  pin 
)    port ^= (pin)

◆ CMD_PARSE_AS_OVF

#define CMD_PARSE_AS_OVF   (0xFF)

◆ CMD_PARSE_AS_QUERY_REP

#define CMD_PARSE_AS_QUERY_REP   (0x00) /** @todo describe these myst vals! */

◆ CMDBUFF_SIZE

#define CMDBUFF_SIZE   (30) /* ? */

◆ DATABUFF_SIZE

#define DATABUFF_SIZE   (2+(EPC_WORDS<<1)+2) /* first2/last2 are reserved. put data into B2..B13 */

◆ dest

#define dest   _get_R4_register()

◆ ENOUGH_BITS_TO_FORCE_EXECUTION

#define ENOUGH_BITS_TO_FORCE_EXECUTION   (200)

◆ EPC_LENGTH

#define EPC_LENGTH   (EPC_WORDS) /* 10h..14h EPC Length in Words. (6 is 96bit std) */

◆ EPC_WORDS

#define EPC_WORDS   (6) /* length of EPC value in words, 0 <= n <= 31 */
Todo:
write the comments for 4 below so I can actually read them...

◆ FAIL

#define FAIL   (0)

◆ FALSE

#define FALSE   (0)

◆ FOREVER

#define FOREVER   (1)

◆ HIGH

#define HIGH   (1)

◆ LOW

#define LOW   (0)

◆ NEVER

#define NEVER   (0)

◆ NSI

#define NSI   (0x00) /* 17h..1Fh Numbering System Identifier. */

◆ NUM_ACK_BITS

#define NUM_ACK_BITS   (18)

◆ NUM_QUERY_BITS

#define NUM_QUERY_BITS   (22)

◆ NUM_REQRN_BITS

#define NUM_REQRN_BITS   (40)

◆ NUM_SEL_BITS

#define NUM_SEL_BITS   (48) /* only need to parse through mask: (4+3+3+2+8+8+16 = 44 -> round to 48) */

◆ NUM_WRITE_BITS

#define NUM_WRITE_BITS   (66)

◆ QUERY_TIMEOUT_PERIOD

#define QUERY_TIMEOUT_PERIOD   (65535)

◆ RESET_BITS_VAL

#define RESET_BITS_VAL   (-2) /* this is the value which will reset the TA1_SM if found in 'bits (R5)' by rfid_sm */

◆ RFID_SEED

#define RFID_SEED   (0x1234)

◆ RFIDBUFF_SIZE

#define RFIDBUFF_SIZE   (1+16+2+2+50) /* longest command handled is the read command for 8 wds*/

◆ RTCAL_MAX

#define RTCAL_MAX   (300)

◆ RTCAL_MIN

#define RTCAL_MIN   (200)

◆ setBits

#define setBits (   x)    _set_R5_register(x)

◆ setDest

#define setDest (   x)    _set_R4_register(x)

◆ STORED_PC

#define STORED_PC   ( ((EPC_LENGTH&0x001F)<<11) | ((UMI&0x0001)<<10) | ((XI&0x0001)<<9) | (NSI&0x01FF)<<01 )

◆ STORED_PC0

#define STORED_PC0   ( (STORED_PC&0x00FF)>>0 )

◆ STORED_PC1

#define STORED_PC1   ( (STORED_PC&0xFF00)>>8 )

◆ SUCCESS

#define SUCCESS   (1)

◆ TRCAL_MAX

#define TRCAL_MAX   (900)

◆ TRCAL_MIN

#define TRCAL_MIN   (220)

◆ TREXT_OFF

#define TREXT_OFF   (0) /* Tag shouldn't use TRext format for backscatter */

◆ TREXT_ON

#define TREXT_ON   (1) /* Tag should use TRext format for backscatter */

◆ TRUE

#define TRUE   (1)

◆ TX_TIMING_ACK

#define TX_TIMING_ACK   (20)/*60.0us*/

◆ TX_TIMING_QA

#define TX_TIMING_QA   (48)

◆ TX_TIMING_QR

#define TX_TIMING_QR   (52)

◆ TX_TIMING_QUERY

#define TX_TIMING_QUERY   (24)/*53.5-60us (depends on which Q value is loaded). */

◆ TX_TIMING_READ

#define TX_TIMING_READ   (29)

◆ TX_TIMING_REQRN

#define TX_TIMING_REQRN   (33)

◆ TX_TIMING_WRITE

#define TX_TIMING_WRITE   (31)

◆ UMI

#define UMI   (0x01) /* 15h User-Memory Indicator. '1' means the tag has user memory available. */

◆ USRBANK_SIZE

#define USRBANK_SIZE   (32) /* ? */

◆ WRITE_DATA_BLINK_LED

#define WRITE_DATA_BLINK_LED   (0x00)

◆ WRITE_DATA_NEW_ID

#define WRITE_DATA_NEW_ID   (0x01)

◆ XI

#define XI   (0x00) /* 16h XPC_W1 indicator. '0' means the tag does not support this feature. */

Typedef Documentation

◆ BOOL

typedef uint8_t BOOL

Function Documentation

◆ handleAck()

void handleAck ( void  )

◆ handleBlockWrite()

void handleBlockWrite ( void  )

◆ handleQA()

void handleQA ( void  )

◆ handleQR()

void handleQR ( void  )

◆ handleQuery()

void handleQuery ( void  )

◆ handleRead()

void handleRead ( void  )

◆ handleReq_RN()

void handleReq_RN ( void  )

◆ handleWrite()

void handleWrite ( void  )

◆ RX_ISR()

void RX_ISR ( void  )

◆ Timer0A0_ISR()

void Timer0A0_ISR ( void  )

◆ Timer0A1_ISR()

void Timer0A1_ISR ( void  )

◆ Timer1A0_ISR()

void Timer1A0_ISR ( void  )

◆ TxFM0()

void TxFM0 ( volatile uint8_t *  data,
uint8_t  numBytes,
uint8_t  numBits,
uint8_t  TRext 
)

◆ WISP_doRFID()

void WISP_doRFID ( void  )

Variable Documentation

◆ cmd

uint8_t cmd[CMDBUFF_SIZE]

◆ dataBuf

uint8_t dataBuf[DATABUFF_SIZE]

◆ isDoingLowPwrSleep

volatile uint8_t isDoingLowPwrSleep

◆ rfid

RFIDstruct rfid

◆ rfidBuf

uint8_t rfidBuf[RFIDBUFF_SIZE]

◆ RWData

RWstruct RWData

◆ usrBank

uint8_t usrBank[USRBANK_SIZE]

◆ wisp_ID

uint16_t wisp_ID