revert between 56095 -> 55830 in arch
[AROS.git] / rom / usb / classes / dfu / dfu.h
blob05062f09e08a0ee21a5aad28ddcc3adb419c943f
1 #ifndef DFU_H
2 #define DFU_H
4 #include <intuition/intuition.h>
5 #include <intuition/intuitionbase.h>
6 #include <libraries/mui.h>
7 #include <libraries/gadtools.h>
8 #include <devices/usb_dfu.h>
10 #if defined(__GNUC__)
11 # pragma pack(2)
12 #endif
14 #define ID_ABOUT 0x55555555
15 #define ID_DOWNLOAD 0xaaaaaaaa
16 #define ID_UPLOAD 0xaaaaaaab
17 #define ID_DETACH 0xaaaaaaac
20 #define STATUS_OK 0x00
21 #define STATUS_ERR_TARGET 0x01
22 #define STATUS_ERR_FILE 0x02
23 #define STATUS_ERR_WRITE 0x03
24 #define STATUS_ERR_ERASE 0x04
25 #define STATUS_ERR_CHECK_ERASED 0x05
26 #define STATUS_ERR_PROG 0x06
27 #define STATUS_ERR_VERIFY 0x07
28 #define STATUS_ERR_ADDRESS 0x08
29 #define STATUS_ERR_NOTDONE 0x09
30 #define STATUS_ERR_FIRMWARE 0x0A
31 #define STATUS_ERR_VENDOR 0x0B
32 #define STATUS_ERR_USBR 0x0C
33 #define STATUS_ERR_POR 0x0D
34 #define STATUS_ERR_UNKNOWN 0x0E
35 #define STATUS_ERR_STALLEDPKT 0x0F
37 #define STATE_APP_IDLE 0
38 #define STATE_APP_DETACH 1
39 #define STATE_DFU_IDLE 2
40 #define STATE_DFU_DNLOAD_SYNC 3
41 #define STATE_DFU_DNBUSY 4
42 #define STATE_DFU_DNLOAD_IDLE 5
43 #define STATE_DFU_MANIFEST_SYNC 6
44 #define STATE_DFU_MANIFEST 7
45 #define STATE_DFU_MANIFEST_WAIT_RESET 8
46 #define STATE_DFU_UPLOAD_IDLE 9
47 #define STATE_DFU_ERROR 10
49 #if defined(__GNUC__)
50 # pragma pack()
51 #endif
53 struct NepClassDFU
55 struct Node nch_Node; /* Node linkage */
56 struct NepDFUBase *nch_ClsBase; /* Up linkage */
57 struct Library *nch_Base; /* Poseidon base */
58 struct PsdDevice *nch_Device; /* Up linkage */
59 struct PsdDevice *nch_Hub; /* Up linkage */
60 struct PsdConfig *nch_Config; /* Up linkage */
61 struct PsdInterface *nch_Interface; /* Up linkage */
62 struct PsdPipe *nch_EP0Pipe; /* Endpoint 0 pipe */
63 ULONG nch_HubPort;
64 struct Task *nch_ReadySigTask; /* Task to send ready signal to */
65 LONG nch_ReadySignal; /* Signal to send when ready */
66 struct MsgPort *nch_TaskMsgPort; /* Message Port for Pipe */
67 ULONG nch_IfNum; /* Interface number */
69 STRPTR nch_DevIDString; /* Device ID String */
70 STRPTR nch_IfIDString; /* Interface ID String */
72 BOOL nch_WillDetach; /* automatically detaches */
73 BOOL nch_CanRetrieve; /* allows firmware downloading */
74 BOOL nch_CanUpgrade; /* allows firmware upgrading */
75 BOOL nch_NoManifestReset; /* no need to reset after manifestation */
76 ULONG nch_DetachTimeOut; /* Max time (ms) before detach fails */
77 ULONG nch_TransferSize; /* Maximum bytes to write */
79 UBYTE *nch_Buffer;
80 BPTR nch_InOutFile;
82 struct UsbDFUStatus nch_DFUStatus;
84 struct Library *nch_MUIBase; /* MUI master base */
85 struct Library *nch_PsdBase; /* Poseidon base */
86 struct Library *nch_IntBase; /* Intuition base */
87 struct Library *nch_DOSBase; /* DOS base */
88 struct Task *nch_GUITask; /* GUI Task */
89 struct NepClassDFU *nch_GUIBinding; /* Window of binding that's open */
91 Object *nch_App;
92 Object *nch_MainWindow;
93 Object *nch_FWFileObj;
94 Object *nch_GaugeObj;
96 Object *nch_DetachObj;
97 Object *nch_DownloadObj;
98 Object *nch_UploadObj;
99 Object *nch_CloseObj;
101 Object *nch_AboutMI;
102 Object *nch_MUIPrefsMI;
105 struct NepDFUBase
107 struct Library nh_Library; /* standard */
108 UWORD nh_Flags; /* various flags */
110 struct Library *nh_UtilityBase; /* Utility base */
113 #endif /* DFU_H */