//////////////////////////////////////////////////////////////////
//
// App:			Communication
// Author:		Milan Korinek
// Version:		1.0
// Notice:		Function for communication with Digital I/O USB card
//////////////////////////////////////////////////////////////////

#ifndef __COMMUNICATION_H__
#define __COMMUNICATION_H__

#include "libusbk.h"
#include "DigitalIOUSBCard.h"
#include "GlobalDevicesLists.h"

#define EP_CONTROL_BUFFER_SIZE 64
#define EP_INTERRUPT_IMMEDIATE_RW_BUFFER_SIZE 7




NOMANGLE DIO_Errors_t SetDeviceConfiguration(_In_ DeviceInfoInternal_t * deviceInfo, _In_ DIO_Behavior_t * DeviceBehavior, _In_ DIO_PortConfig_t PortsConfiguration[DIO_MAX_PORTS]);

NOMANGLE DIO_Errors_t GetDeviceConfiguration(_In_ DeviceInfoInternal_t * deviceInfo,  _Out_ E_DeviceState_t * DeviceState, _Out_ DIO_Behavior_t * DeviceBehavior, _Out_ DIO_PortConfig_t PortsConfiguration[DIO_MAX_PORTS]);

NOMANGLE DIO_Errors_t DeviceImmediateRW(_In_ BOOL write, _In_ DeviceInfoInternal_t * deviceInfo, _In_ UINT32 ports, _In_ UINT32 offset, _Inout_ UINT8 * Data);

NOMANGLE void PrintRawPacket(_In_ UINT8 * payload, _In_ UINT payload_length);


#endif /* __COMMUNICATION_H__ */
