18 #ifndef INCLUDED_UHD_TRANSPORT_NIRIO_NIRIO_PROXY_IMPL_V2_H
19 #define INCLUDED_UHD_TRANSPORT_NIRIO_NIRIO_PROXY_IMPL_V2_H
21 #include <boost/smart_ptr.hpp>
22 #include <boost/noncopyable.hpp>
28 typedef uint64_t
tAlignedU64 __attribute__ ((aligned(8)));
33 namespace uhd {
namespace niusrprio
42 #define IOCTL(type, function, access) \
43 CTL_CODE((0x8000+type), (0x800+function), METHOD_BUFFERED, access)
45 #define IOCTL_ACCESS_ANY (FILE_ANY_ACCESS)
46 #define IOCTL_ACCESS_READ (FILE_READ_ACCESS)
47 #define IOCTL_ACCESS_WRITE (FILE_WRITE_ACCESS)
48 #define IOCTL_ACCESS_RW (FILE_READ_ACCESS | FILE_WRITE_ACCESS)
50 #define IOCTL_TRANSPORT_GET32 IOCTL(0, 0, IOCTL_ACCESS_READ)
51 #define IOCTL_TRANSPORT_SET32 IOCTL(0, 1, IOCTL_ACCESS_WRITE)
52 #define IOCTL_TRANSPORT_GET_STRING IOCTL(0, 2, IOCTL_ACCESS_READ)
53 #define IOCTL_TRANSPORT_SET_STRING IOCTL(0, 3, IOCTL_ACCESS_WRITE)
54 #define IOCTL_TRANSPORT_RESET IOCTL(1, 1, IOCTL_ACCESS_WRITE)
55 #define IOCTL_TRANSPORT_ADD_INPUT_FIFO_RESOURCE IOCTL(2, 0, IOCTL_ACCESS_ANY)
56 #define IOCTL_TRANSPORT_ADD_OUTPUT_FIFO_RESOURCE IOCTL(2, 1, IOCTL_ACCESS_ANY)
57 #define IOCTL_TRANSPORT_SET_DEVICE_CONFIG IOCTL(2, 3, IOCTL_ACCESS_WRITE)
58 #define IOCTL_TRANSPORT_FIFO_CONFIG IOCTL(4, 0, IOCTL_ACCESS_ANY)
59 #define IOCTL_TRANSPORT_FIFO_START IOCTL(4, 1, IOCTL_ACCESS_ANY)
60 #define IOCTL_TRANSPORT_FIFO_STOP IOCTL(4, 2, IOCTL_ACCESS_ANY)
61 #define IOCTL_TRANSPORT_FIFO_READ IOCTL(4, 3, IOCTL_ACCESS_READ)
62 #define IOCTL_TRANSPORT_FIFO_WRITE IOCTL(4, 4, IOCTL_ACCESS_WRITE)
63 #define IOCTL_TRANSPORT_FIFO_WAIT IOCTL(4, 5, IOCTL_ACCESS_ANY)
64 #define IOCTL_TRANSPORT_FIFO_GRANT IOCTL(4, 6, IOCTL_ACCESS_ANY)
65 #define IOCTL_TRANSPORT_FIFO_STOP_ALL IOCTL(4, 7, IOCTL_ACCESS_ANY)
66 #define IOCTL_TRANSPORT_PEEK64 IOCTL(5, 2, IOCTL_ACCESS_READ)
67 #define IOCTL_TRANSPORT_PEEK32 IOCTL(5, 3, IOCTL_ACCESS_READ)
68 #define IOCTL_TRANSPORT_POKE64 IOCTL(5, 6, IOCTL_ACCESS_WRITE)
69 #define IOCTL_TRANSPORT_POKE32 IOCTL(5, 7, IOCTL_ACCESS_WRITE)
70 #define IOCTL_TRANSPORT_POST_OPEN IOCTL(8, 0, IOCTL_ACCESS_ANY)
71 #define IOCTL_TRANSPORT_PRE_CLOSE IOCTL(8, 1, IOCTL_ACCESS_ANY)
307 virtual nirio_status open(
const std::string& interface_path);
308 virtual void close(
void);
319 uint32_t& maintenance,
325 uint32_t& attrValue);
329 const uint32_t value);
331 virtual nirio_status peek(uint32_t offset, uint32_t& value);
333 virtual nirio_status peek(uint32_t offset, uint64_t& value);
335 virtual nirio_status poke(uint32_t offset,
const uint32_t& value);
337 virtual nirio_status poke(uint32_t offset,
const uint64_t& value);
340 uint32_t fifo_instance,
361 uint32_t requested_depth,
362 uint8_t requires_actuals,
363 uint32_t& actual_depth,
364 uint32_t& actual_size);
368 uint32_t elements_requested,
369 uint32_t scalar_type,
374 uint32_t& elements_acquired,
375 uint32_t& elements_remaining);
379 uint32_t elements_to_grant);
383 uint32_t elements_to_read,
385 uint32_t buffer_datatype_width,
386 uint32_t scalar_type,
389 uint32_t& number_read,
390 uint32_t& number_remaining);
394 uint32_t elements_to_write,
396 uint32_t buffer_datatype_width,
397 uint32_t scalar_type,
400 uint32_t& number_remaining);
404 virtual void _close();