UsbSrvProt.h
2.06 KB
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
#include "MMI_features.h"
#include "MMIDataType.h"
#include "USBSrvIprot.h"
#include "USBSrvGprot.h"
/* The delay time period when usb config screen is allowed to display */
#define PENDING_USBDETECTION_HDLR_TIMER_DUR 3000 /* 3 sec */
/* The display time of shutdown for mass storage notification screen */
#define USB_SHUTDOWN_SCR_TIMER_DUR 2000 /* 2 sec */
typedef struct
{
/*
* Bit 0: Before Power on Flag
* Bit 1: Pending Timer Flag
* Bit 2: Usb plug out during switch port
*/
U32 flag;
/* MMI usb state (previous, only use when interrupt at config page) */
srv_usb_status_enum usb_status_prev;
/* MMI usb state (current) */
srv_usb_status_enum usb_status;
/* Previous PS and TST port setting, for restore when plug out usb device */
//U8 ps_port_prev;
//U8 tst_port_prev;
U8 reset_type;
U8 ms_config_result;
U8 owner;
U8 ps_port;
} SRV_USB_CONTEXT;
/*****************************************************************************
* MMI USB context reference
*****************************************************************************/
extern SRV_USB_CONTEXT *srv_usb_ptr;
#define SRV_USB_CTX(a) srv_usb_ptr->a
/*****************************************************************************
* SRV USB context defination and operation
*****************************************************************************/
/* srv usb context bit-wise flag defination */
#define SRVUSB_MASK_BEFORE_POWERON 0x00000001
#define SRVUSB_MASK_PENDING_TIMER 0x00000002
#define SRVUSB_MASK_PORT_SWITCHING 0x00000004
#define SRVUSB_MASK_IS_CONNECT 0x00000008
#define SRVUSB_MASK_RESERVED_1 0x00000010
#define SRVUSB_MASK_RESERVED_2 0x00000020
#define SRVUSB_MASK_RESERVED_3 0x00000040
#define SRVUSB_MASK_RESERVED_4 0x00000080
/* SRV usb context bit-wise flag operation */
#define SRVUSB_GET_FLAG(a) ( ((srv_usb_ptr->flag) & a) == 0 ? MMI_FALSE : MMI_TRUE )
#define SRVUSB_SET_FLAG(a) ( (srv_usb_ptr->flag) |= a )
#define SRVUSB_RESET_FLAG(a) ( (srv_usb_ptr->flag) &= ~a )