ADTF
|
The IDevice interface wraps I/O devices. More...
Classes | |
struct | tDeviceConfig |
Device configuration structure. More... | |
struct | tDeviceInfo |
Device information. More... | |
Public Types | |
enum | tIOCTL_Command : uint16_t { IOCTL_Unknown = 0 , IOCTL_GetDeviceInfo = 1 , IOCTL_RegisterHandler = 2 , IOCTL_UnregisterHandler = 3 , IOCTL_GetDataSize = 4 , IOCTL_GetDataTime = 5 , IOCTL_Start = 6 , IOCTL_Stop = 7 , IOCTL_Pause = 8 , IOCTL_GetConfig = 9 , IOCTL_SetConfig = 10 , IOCTL_BusWakeup = 11 , IOCTL_BusSleep = 12 , IOCTL_User = 0x0100 } |
Device I/O control commands. More... | |
enum | tDeviceMode : uint8_t { DM_Unknown = 0 , DM_Read = 1 , DM_Write = 2 , DM_ReadWrite = 3 } |
Device access modes. More... | |
enum | tDeviceFlags { DF_None = 0x00 , DF_AsyncIO = 0x01 } |
Device operation flags. More... | |
Public Member Functions | |
ADTF_IID (IDevice, "device.ant.ucom.adtf.iid") | |
Marks the IDevice to be castable with the ucom_cast<> More... | |
virtual tResult | Open (const char *strDeviceName, int nMode=0)=0 |
Open device. More... | |
virtual tResult | Close ()=0 |
Close device. More... | |
virtual int | Read (void *pvBuffer, int nBufferSize)=0 |
Read data from device. More... | |
virtual int | Write (const void *pvBuffer, int nBufferSize)=0 |
Write data to device. More... | |
virtual int | IOCtl (int nCommand, void *pvData=NULL, int nDataSize=0)=0 |
Execute I/O control command. More... | |
Public Member Functions inherited from IObject | |
ADTF_IID (IObject, "object.ant.ucom.adtf.iid") | |
Marks the IObject to be castable with the ucom_cast() More... | |
Protected Member Functions | |
~IDevice ()=default | |
Protected destructor --> Use implemented Destroy() instead of delete! | |
Protected Member Functions inherited from IObject | |
~IObject ()=default | |
Protected destructor --> Use implemented Destroy() instead of delete! | |
The IDevice interface wraps I/O devices.
Definition at line 23 of file device_intf.h.
enum tDeviceFlags |
Device operation flags.
Enumerator | |
---|---|
DF_None | No flags specified. |
DF_AsyncIO | Device needs to by synchronized to frequency. |
Definition at line 119 of file device_intf.h.
enum tDeviceMode : uint8_t |
Device access modes.
Enumerator | |
---|---|
DM_Unknown | Unknown mode. |
DM_Read | Device will be opened for read-only access. |
DM_Write | Device will be opened for write-only access. |
DM_ReadWrite | Device will be opened for read-write access. |
Definition at line 103 of file device_intf.h.
enum tIOCTL_Command : uint16_t |
Device I/O control commands.
Definition at line 44 of file device_intf.h.
ADTF_IID | ( | IDevice | , |
"device.ant.ucom.adtf.iid" | |||
) |
Marks the IDevice
to be castable with the ucom_cast<>
|
pure virtual |
Close device.
The Close method closes a device.
|
pure virtual |
Execute I/O control command.
The IOCtl method executes a device specific I/O control command.
[in] | nCommand | Command identifier. |
[in] | pvData | Pointer to command specific data. |
[in] | nDataSize | Size of command specific data. |
|
pure virtual |
Open device.
The Open method opens a device.
[in] | strDeviceName | Name or identifier to be used to specifiy the device. |
[in] | nMode | Access mode to be opened the device for. |
|
pure virtual |
Read data from device.
The Read method reads data from an opened device.
[in] | pvBuffer | Pointer to an existing buffer. |
[in] | nBufferSize | Size in bytes of the existing buffer. |
|
pure virtual |
Write data to device.
The Write method writes data to an opened device.
pvBuffer | [in] Pointer to an existing buffer. |
nBufferSize | [in] Size in bytes of the existing buffer. |