aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/fw_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/fw_common.h')
-rw-r--r--host/lib/usrp/usrp2/fw_common.h53
1 files changed, 23 insertions, 30 deletions
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h
index 4c66aa41e..fd728e393 100644
--- a/host/lib/usrp/usrp2/fw_common.h
+++ b/host/lib/usrp/usrp2/fw_common.h
@@ -24,18 +24,14 @@
* Therefore, this header may only contain valid C code.
*/
#ifdef __cplusplus
-#include <boost/cstdint.hpp>
-#define _SINS_ boost:://stdint namespace when in c++
+ #include <boost/cstdint.hpp>
+ #define __stdint(type) boost::type
extern "C" {
#else
-#include <stdint.h>
-#define _SINS_
+ #include <stdint.h>
+ #define __stdint(type) type
#endif
-// define limits on bytes per udp packet
-#define USRP2_MTU_BYTES 1500
-#define USRP2_UDP_BYTES ((USRP2_MTU_BYTES) - (2 + 14 + 20 + 8)) //size of headers (pad, eth, ip, udp)
-
//defines the protocol version in this shared header
//increment this value when the protocol is changed
#define USRP2_PROTO_VERSION 5
@@ -43,10 +39,6 @@ extern "C" {
//used to differentiate control packets over data port
#define USRP2_INVALID_VRT_HEADER 0
-// size of the vrt header and trailer to the host
-#define USRP2_HOST_RX_VRT_HEADER_WORDS32 5
-#define USRP2_HOST_RX_VRT_TRAILER_WORDS32 1 //FIXME fpga sets wrong header size when no trailer present
-
// udp ports for the usrp2 communication
// Dynamic and/or private ports: 49152-65535
#define USRP2_UDP_CTRL_PORT 49152
@@ -90,34 +82,35 @@ typedef enum{
} usrp2_clk_edge_t;
typedef struct{
- _SINS_ uint32_t proto_ver;
- _SINS_ uint32_t id;
- _SINS_ uint32_t seq;
+ __stdint(uint32_t) proto_ver;
+ __stdint(uint32_t) id;
+ __stdint(uint32_t) seq;
union{
- _SINS_ uint32_t ip_addr;
+ __stdint(uint32_t) ip_addr;
struct {
- _SINS_ uint8_t dev;
- _SINS_ uint8_t miso_edge;
- _SINS_ uint8_t mosi_edge;
- _SINS_ uint8_t readback;
- _SINS_ uint32_t data;
- _SINS_ uint8_t num_bits;
+ __stdint(uint8_t) dev;
+ __stdint(uint8_t) miso_edge;
+ __stdint(uint8_t) mosi_edge;
+ __stdint(uint8_t) readback;
+ __stdint(uint32_t) data;
+ __stdint(uint8_t) num_bits;
} spi_args;
struct {
- _SINS_ uint8_t addr;
- _SINS_ uint8_t bytes;
- _SINS_ uint8_t data[20];
+ __stdint(uint8_t) addr;
+ __stdint(uint8_t) bytes;
+ __stdint(uint8_t) data[20];
} i2c_args;
struct {
- _SINS_ uint32_t addr;
- _SINS_ uint32_t data;
- _SINS_ uint32_t addrhi;
- _SINS_ uint32_t datahi;
- _SINS_ uint8_t num_bytes; //1, 2, 4, 8
+ __stdint(uint32_t) addr;
+ __stdint(uint32_t) data;
+ __stdint(uint32_t) addrhi;
+ __stdint(uint32_t) datahi;
+ __stdint(uint8_t) num_bytes; //1, 2, 4, 8
} poke_args;
} data;
} usrp2_ctrl_data_t;
+#undef __stdint
#ifdef __cplusplus
}
#endif