C++Instrument Catalog MFC 1.2
Metrolab C++InstrumentCatalog for MFC
Loading...
Searching...
No Matches
USBRemoteBox.h
Go to the documentation of this file.
1#pragma once
2
3// Standard includes
4#include <string>
5
6// Personal includes
7#include "VISAInstrument.h"
8
9namespace MTL {
10 namespace Instrument {
11
12 //----------------------------------------------------------------------//
13 // USB Remote Box Interrface //
14 //----------------------------------------------------------------------//
16 {
17 public:
18 static const std::string RSRC_FILTER;
19 union uLEDs {
20 struct sLEDs
21 {
22 uint32_t ON : 1;
23 uint32_t BUSY : 1;
25 uint32_t Buf;
26 };
28 {
29 struct sButtons
30 {
31 uint32_t StartState : 1;
32 uint32_t StartEvent : 1;
33 uint32_t ResetState : 1;
34 uint32_t ResetEvent : 1;
36 uint32_t Buf;
37 };
38 private:
39 const uint32_t m_Timeout_ms = 2000;
40 enum usb_request_type {
41 USB_REQUEST_TYPE_STANDARD = (0x00 << 5),
42 USB_REQUEST_TYPE_CLASS = (0x01 << 5),
43 USB_REQUEST_TYPE_VENDOR = (0x02 << 5),
44 USB_REQUEST_TYPE_RESERVED = (0x03 << 5)
45 };
46 enum usb_request_recipient {
47 USB_RECIPIENT_DEVICE = 0x00,
48 USB_RECIPIENT_INTERFACE = 0x01,
49 USB_RECIPIENT_ENDPOINT = 0x02,
50 USB_RECIPIENT_OTHER = 0x03,
51 };
52 enum usb_endpoint_direction {
53 USB_ENDPOINT_IN = 0x80, // Device to host
54 USB_ENDPOINT_OUT = 0x00 // Host to device
55 };
56
57 public:
58 //----------------------------------------------------------------------//
59 // Constructors / destructors
60 CUSBRemoteBox(CVISAResourceManager & rRM, tResourceName Rsrc);
61 virtual ~CUSBRemoteBox();
62
63 //----------------------------------------------------------------------//
64 // Open / Close
65 bool Connect();
66 void Disconnect();
67
68 //----------------------------------------------------------------------//
69 // Read / Write
70 bool Update(const uLEDs LEDs, uButtons & rButtons);
71 };
72
73 }
74}
C++ wrapper for NI-VISA: interface definition.
std::string tResourceName
static const std::string RSRC_FILTER
bool Update(const uLEDs LEDs, uButtons &rButtons)
CUSBRemoteBox(CVISAResourceManager &rRM, tResourceName Rsrc)
struct MTL::Instrument::CUSBRemoteBox::uLEDs::sLEDs LEDs
struct MTL::Instrument::CUSBRemoteBox::uButtons::sButtons BUTs
CVISAInstrument(CVISAResourceManager &rRM, tResourceName Rsrc)