forked from spqr/umichmoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mymoo.h
92 lines (81 loc) · 3.95 KB
/
mymoo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* See license.txt for license information. */
#ifndef MYMOO_H
#define MYMOO_H
#include "version.h"
////////////////////////////////////////////////////////////////////////////////
// Step 1: pick an application
// simple hardcoded query-ack
#define SIMPLE_QUERY_ACK 0
// return sampled sensor data as epc. best for range.
#define SENSOR_DATA_IN_ID 1
// support read commands. returns one word of counter data
#define SIMPLE_READ_COMMAND 0
// return sampled sensor data in a read command. returns three words of accel
// data
#define SENSOR_DATA_IN_READ_COMMAND 0
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Step 1A: pick a sensor type
// If you're not using the SENSOR_DATA_IN_ID or SENSOR_DATA_IN_READ_COMMAND
// apps, then this is a don't care.
// Choices:
// use "0C" - static data - for test purposes only
#define SENSOR_NULL 0
// use "0D" accel sensor sampled with 10-bit ADC, full RC settling time
#define SENSOR_ACCEL 1
// use "0B" accel sensor sampled with 10-bit ADC, partial RC settling ("quick")
// for more info, see wiki: Code Examples
#define SENSOR_ACCEL_QUICK 2
// use "0F" built-in temperature sensor sampled with a 10-bit ADC
#define SENSOR_INTERNAL_TEMP 3
// use "0E" external temperature sensor sampled with a 10-bit ADC
#define SENSOR_EXTERNAL_TEMP 4
// use "0A" comm statistics
#define SENSOR_COMM_STATS 5
// use "12" for digital accelerometer
#define SENSOR_DIGITAL_ACCEL 6
// use "14" for simple counter
#define SENSOR_SIMPLE 7
// use "16" for spi data
#define SENSOR_SPI 8
// Choose Active Sensor:
#define ACTIVE_SENSOR SENSOR_SPI
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Step 2: pick a reader and moo hardware
// make sure this syncs with project target
#define IMPINJ_READER 1
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Step 3: pick protocol features
// The spec actually requires all these features, but as a practical matter
// supporting things like slotting and sessions requires extra power and thus
// limits range. Another factor is if you are running out of room on flash --
// e.g., you're using the flash-limited free IAR kickstart compiler -- you
// probably want to leave these features out unless you really need them.
//
// You only need ENABLE_SLOTS when you're working with more than one Moo. The
// code will run fine without ENABLE_SLOTS if you're using one Moo with
// multiple non-Moo rfid tags.
//
// ENABLE_SESSIONS is new code that hasn't been tested in a multiple reader
// environment. Also note a workaround I use in handle_queryrep to deal with
// what appears to be unexpected session values in the reader I'm using.
//
// Known issue: ENABLE_SLOTS and ENABLE_SESSIONS won't work together;
// it's probably just a matter of finding the right reply timing in handle_query
#define ENABLE_SLOTS 0
#define ENABLE_SESSIONS 0
#define ENABLE_HANDLE_CHECKING 0 // not implemented yet ...
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Step 4: set EPC and TID identifiers (optional)
#define MOO_ID 0x12, 0x1A
#define EPC 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, \
MOO_VERSION, MOO_ID
#define TID_DESIGNER_ID_AND_MODEL_NUMBER 0xFF, 0xF0, 0x01
////////////////////////////////////////////////////////////////////////////////
// Step 5: pick either Miller-2 or Miller-4 encoding
#define MILLER_2_ENCODING 0 // not tested ... use ayor
#define MILLER_4_ENCODING 1
#endif // MYMOO_H