/************************************************************************\
## ##
## Creation Date: 18 Mar 2007 ##
## Last Update: 18 Mar 2007 ##
## Author: EviLove ##
## ##
## Desc: Setup packet-building functions. ##
## ##
\************************************************************************/
#ifndef _USMCPKT_H
#define _USMCPKT_H
#include "usmctypes.h"
char * user_to_kernel ( const char * user_buf, int len );
/*==== SetupPacket building functions: ====*/
// Standard USB Device Requests:
void bsp_GetDescriptor ( int descriptorType,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_GetStatus ( int statusType,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
// Controller-specific Requests:
// Direction In:
void bsp_GetVersion ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_GetSerial ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_GetEncoderState ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_GetState ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
// Direction Out:
char * bsp_GoTo ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
char * bsp_SetMode ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
char * bsp_SetParameters ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
char * bsp_Download ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
char * bsp_SetSerial ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
// Direction N/A:
void bsp_SetCurrentPosition ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_StopStepMotor ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_EmulateButtons ( const char * user_buf,
__u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
void bsp_SaveParameters ( __u8 * bRequestType,
__u8 * bRequest,
__u16 * wValue,
__u16 * wIndex,
__u16 * wLength );
#endif // _USMCPKT_H