aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/fx2/include/usrp_commands.h
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2010-08-12 16:22:04 -0700
committerThomas Tsou <ttsou@vt.edu>2010-08-13 17:54:01 -0700
commitb3a092055abacb99b3e9d71edd26c2dd2059dd7f (patch)
tree6c3466c342525e21de69008ebb6b2d9e2eb87ffd /firmware/fx2/include/usrp_commands.h
parent70eae1d242a9530cab4efa927bd1331b099fdd00 (diff)
downloaduhd-b3a092055abacb99b3e9d71edd26c2dd2059dd7f.tar.gz
uhd-b3a092055abacb99b3e9d71edd26c2dd2059dd7f.tar.bz2
uhd-b3a092055abacb99b3e9d71edd26c2dd2059dd7f.zip
usrp1: Add SPI transaction command to FX2 firmware
The existing SPI read command is set for half-duplex 8-bit or 16-bit writes followed by an equivalent sized read. This patch adds a new command, VRQ_SPI_TRANSACT, which performs a full-duplex transaction up to 4-bytes. Since the data buffer of the USB control transfer is not available for outbound data on IN requests, the 4 bytes of write data are sent through the request parameters. Enables are sent in the previsouly unused high byte of the length parameter. The USB field mappings are shown below. Only rising edge and MSB operation is supported. Field (8-bit) Description ===== ===== bmRequestType 0x80 (USB Device IN request) bRequest 0x83 (VRQ_SPI_TRANSACT) wValueH OUT data(0) wValueL OUT data(1) wIndexH OUT data(2) wIndexL OUT data(3) wLengthH SPI enables wLengthL Number of bytes to transfer (1-4) EP0BUF IN data
Diffstat (limited to 'firmware/fx2/include/usrp_commands.h')
-rw-r--r--firmware/fx2/include/usrp_commands.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/fx2/include/usrp_commands.h b/firmware/fx2/include/usrp_commands.h
index 20c28e264..02778c7e3 100644
--- a/firmware/fx2/include/usrp_commands.h
+++ b/firmware/fx2/include/usrp_commands.h
@@ -54,6 +54,13 @@
// wIndexL: format
// len: how much to read
+#define VRQ_SPI_TRANSACT 0x83 // wValueH: OUT byte 0
+ // wValueL: OUT byte 1
+ // wIndexH: OUT byte 2
+ // wIndexL: OUT byte 3
+ // wLengthH: enables
+ // wLengthL: transaction length
+
// OUT commands
#define VRQ_SET_LED 0x01 // wValueL off/on {0,1}; wIndexL: which {0,1}