Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line | 
|---|---|---|---|
| 6 | f9daq | 1 | /************************************************************************\ | 
        
| 2 | ##                                                                      ## | 
        ||
| 3 | ##  Creation Date: 18 Mar 2007                                          ## | 
        ||
| 4 | ##  Last Update:   18 Mar 2007                                          ## | 
        ||
| 5 | ##  Author:            EviLove                                          ## | 
        ||
| 6 | ##                                                                      ## | 
        ||
| 7 | ##  Desc: Setup packet-building functions.                              ## | 
        ||
| 8 | ##                                                                      ## | 
        ||
| 9 | \************************************************************************/ | 
        ||
| 10 | |||
| 11 | |||
| 12 | #ifndef _USMCPKT_H | 
        ||
| 13 | #define _USMCPKT_H | 
        ||
| 14 | |||
| 15 | |||
| 16 | #include        "usmctypes.h" | 
        ||
| 17 | |||
| 18 | |||
| 19 | char * user_to_kernel ( const char * user_buf, int len );  | 
        ||
| 20 | |||
| 21 | |||
| 22 | /*==== SetupPacket building functions: ====*/ | 
        ||
| 23 | // Standard USB Device Requests: | 
        ||
| 24 | void bsp_GetDescriptor ( int descriptorType,  | 
        ||
| 25 |                          __u8  * bRequestType, | 
        ||
| 26 |                          __u8  * bRequest, | 
        ||
| 27 |                          __u16 * wValue, | 
        ||
| 28 |                          __u16 * wIndex, | 
        ||
| 29 | __u16 * wLength );  | 
        ||
| 30 | void bsp_GetStatus ( int statusType,  | 
        ||
| 31 |                          __u8  * bRequestType, | 
        ||
| 32 |                          __u8  * bRequest, | 
        ||
| 33 |                          __u16 * wValue, | 
        ||
| 34 |                          __u16 * wIndex, | 
        ||
| 35 | __u16 * wLength );  | 
        ||
| 36 | // Controller-specific Requests: | 
        ||
| 37 | // Direction In: | 
        ||
| 38 | void bsp_GetVersion ( __u8 * bRequestType,  | 
        ||
| 39 |                           __u8  * bRequest, | 
        ||
| 40 |                           __u16 * wValue, | 
        ||
| 41 |                           __u16 * wIndex, | 
        ||
| 42 | __u16 * wLength );  | 
        ||
| 43 | void bsp_GetSerial ( __u8 * bRequestType,  | 
        ||
| 44 |                           __u8  * bRequest, | 
        ||
| 45 |                           __u16 * wValue, | 
        ||
| 46 |                           __u16 * wIndex, | 
        ||
| 47 | __u16 * wLength );  | 
        ||
| 48 | void bsp_GetEncoderState ( __u8 * bRequestType,  | 
        ||
| 49 |                           __u8  * bRequest, | 
        ||
| 50 |                           __u16 * wValue, | 
        ||
| 51 |                           __u16 * wIndex, | 
        ||
| 52 | __u16 * wLength );  | 
        ||
| 53 | void bsp_GetState ( __u8 * bRequestType,  | 
        ||
| 54 |                           __u8  * bRequest, | 
        ||
| 55 |                           __u16 * wValue, | 
        ||
| 56 |                           __u16 * wIndex, | 
        ||
| 57 | __u16 * wLength );  | 
        ||
| 58 | // Direction Out: | 
        ||
| 59 | char * bsp_GoTo ( const char * user_buf,  | 
        ||
| 60 |                          __u8  * bRequestType, | 
        ||
| 61 |                          __u8  * bRequest, | 
        ||
| 62 |                          __u16 * wValue, | 
        ||
| 63 |                          __u16 * wIndex, | 
        ||
| 64 | __u16 * wLength );  | 
        ||
| 65 | char * bsp_SetMode ( const char * user_buf,  | 
        ||
| 66 |                          __u8  * bRequestType, | 
        ||
| 67 |                          __u8  * bRequest, | 
        ||
| 68 |                          __u16 * wValue, | 
        ||
| 69 |                          __u16 * wIndex, | 
        ||
| 70 | __u16 * wLength );  | 
        ||
| 71 | char * bsp_SetParameters ( const char * user_buf,  | 
        ||
| 72 |                          __u8  * bRequestType, | 
        ||
| 73 |                          __u8  * bRequest, | 
        ||
| 74 |                          __u16 * wValue, | 
        ||
| 75 |                          __u16 * wIndex, | 
        ||
| 76 | __u16 * wLength );  | 
        ||
| 77 | char * bsp_Download ( const char * user_buf,  | 
        ||
| 78 |                          __u8  * bRequestType, | 
        ||
| 79 |                          __u8  * bRequest, | 
        ||
| 80 |                          __u16 * wValue, | 
        ||
| 81 |                          __u16 * wIndex, | 
        ||
| 82 | __u16 * wLength );  | 
        ||
| 83 | char * bsp_SetSerial ( const char * user_buf,  | 
        ||
| 84 |                          __u8  * bRequestType, | 
        ||
| 85 |                          __u8  * bRequest, | 
        ||
| 86 |                          __u16 * wValue, | 
        ||
| 87 |                          __u16 * wIndex, | 
        ||
| 88 | __u16 * wLength );  | 
        ||
| 89 | // Direction N/A: | 
        ||
| 90 | void bsp_SetCurrentPosition ( const char * user_buf,  | 
        ||
| 91 |                               __u8  * bRequestType, | 
        ||
| 92 |                               __u8  * bRequest, | 
        ||
| 93 |                               __u16 * wValue, | 
        ||
| 94 |                               __u16 * wIndex, | 
        ||
| 95 | __u16 * wLength );  | 
        ||
| 96 | void bsp_StopStepMotor ( __u8 * bRequestType,  | 
        ||
| 97 |                               __u8  * bRequest, | 
        ||
| 98 |                               __u16 * wValue, | 
        ||
| 99 |                               __u16 * wIndex, | 
        ||
| 100 | __u16 * wLength );  | 
        ||
| 101 | void bsp_EmulateButtons ( const char * user_buf,  | 
        ||
| 102 |                               __u8  * bRequestType, | 
        ||
| 103 |                               __u8  * bRequest, | 
        ||
| 104 |                               __u16 * wValue, | 
        ||
| 105 |                               __u16 * wIndex, | 
        ||
| 106 | __u16 * wLength );  | 
        ||
| 107 | void bsp_SaveParameters ( __u8 * bRequestType,  | 
        ||
| 108 |                               __u8  * bRequest, | 
        ||
| 109 |                               __u16 * wValue, | 
        ||
| 110 |                               __u16 * wIndex, | 
        ||
| 111 | __u16 * wLength );  | 
        ||
| 112 | |||
| 113 | |||
| 114 | #endif  // _USMCPKT_H |