-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpro_driver.h
77 lines (69 loc) · 1.96 KB
/
pro_driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef _PRO_DRIVER_H
#define _PRO_DRIVER_H
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <process.h>
#include <assert.h>
#include <tchar.h>
#include <time.h>
#include <conio.h>
#include "ftd2xx.h"
#include <stdint.h>
// Enttec Pro definitions
#define GET_WIDGET_PARAMS 3
#define GET_WIDGET_SN 10
#define GET_WIDGET_PARAMS_REPLY 3
#define SET_WIDGET_PARAMS 4
#define SET_DMX_RX_MODE 5
#define SET_DMX_TX_MODE 6
#define SEND_DMX_RDM_TX 7
#define RECEIVE_DMX_ON_CHANGE 8
#define RECEIVED_DMX_COS_TYPE 9
#define ONE_BYTE 1
#define DMX_START_CODE 0x7E
#define DMX_END_CODE 0xE7
#define OFFSET 0xFF
#define DMX_HEADER_LENGTH 4
#define BYTE_LENGTH 8
#define HEADER_RDM_LABEL 5
#define NO_RESPONSE 0
#define DMX_PACKET_SIZE 512
#pragma pack(1)
typedef struct {
unsigned char FirmwareLSB;
unsigned char FirmwareMSB;
unsigned char BreakTime;
unsigned char MaBTime;
unsigned char RefreshRate;
}DMXUSBPROParamsType;
typedef struct {
unsigned char UserSizeLSB;
unsigned char UserSizeMSB;
unsigned char BreakTime;
unsigned char MaBTime;
unsigned char RefreshRate;
}DMXUSBPROSetParamsType;
#pragma pack()
struct ReceivedDmxCosStruct
{
unsigned char start_changed_byte_number;
unsigned char changed_byte_array[5];
unsigned char changed_byte_data[40];
};
#define MAX_PROS 20
#define SEND_NOW 0
#define TRUE 1
#define FALSE 0
#define HEAD 0
#define IO_ERROR 9
int FTDI_SendData(int label, unsigned char *data, int length);
int FTDI_ReceiveData(int label, unsigned char *data, unsigned int expected_length);
uint8_t FTDI_SendDataToPro(uint8_t label, unsigned char *data, uint32_t length);
void* Get_Pro_Handle();
uint8_t FTDI_ReceiveDataFromPro(uint8_t label, unsigned char *data, uint32_t expected_length);
uint16_t FTDI_OpenDevice(int device_num, int* VersionMSB, int* VersionLSB,bool full_mode = true);
int FTDI_ListDevices(uint64_t * Locations);
void FTDI_ClosePort();
void FTDI_PurgeBuffer();
#endif