Contiki 2.5
usb-arch.h
1 #ifndef __USB_ARCH_H__0Z52ZDP0H6__
2 #define __USB_ARCH_H__0Z52ZDP0H6__
3 
4 #include <contiki-conf.h>
5 #include <usb-api.h>
6 
7 
8 /* Includes control endpoint 0 */
9 #ifndef USB_MAX_ENDPOINTS
10 #define USB_MAX_ENDPOINTS 4
11 #endif
12 
13 #ifndef CTRL_EP_SIZE
14 #define CTRL_EP_SIZE 8
15 #endif
16 
17 #ifndef USB_EP1_SIZE
18 #define USB_EP1_SIZE 8
19 #endif
20 #ifndef USB_EP2_SIZE
21 #define USB_EP2_SIZE 8
22 #endif
23 #ifndef USB_EP3_SIZE
24 #define USB_EP3_SIZE 8
25 #endif
26 #ifndef USB_EP4_SIZE
27 #define USB_EP4_SIZE 0
28 #endif
29 #ifndef USB_EP5_SIZE
30 #define USB_EP5_SIZE 0
31 #endif
32 #ifndef USB_EP6_SIZE
33 #define USB_EP6_SIZE 0
34 #endif
35 #ifndef USB_EP7_SIZE
36 #define USB_EP7_SIZE 0
37 #endif
38 
39 
40 #ifndef MAX_CTRL_DATA
41 #define MAX_CTRL_DATA 128
42 #endif
43 
44 void
45 usb_arch_setup(void);
46 
47 void
48 usb_arch_setup_control_endpoint(uint8_t addr);
49 
50 void
51 usb_arch_setup_bulk_endpoint(uint8_t addr);
52 
53 void
54 usb_arch_setup_interrupt_endpoint(uint8_t addr);
55 
56 void
57 usb_arch_disable_endpoint(uint8_t addr);
58 
59 void
60 usb_arch_discard_all_buffers(uint8_t addr);
61 
62 /* Stall a control endpoint. The stall will be cleared when the next
63  SETUP token arrives. */
64 void
65 usb_arch_control_stall(uint8_t addr);
66 
67 /* Set or remove a HALT condition on an endpoint */
68 void
69 usb_arch_halt_endpoint(uint8_t addr, int halt);
70 
71 void
72 usb_arch_set_configuration(uint8_t usb_configuration_value);
73 
74 uint16_t
75 usb_arch_get_ep_status(uint8_t addr);
76 
77 void
78 usb_arch_set_address(uint8_t addr);
79 
80 
81 /* Select what process should be polled when a global event occurs. Intended for the protocol handler. Applications should use usb_set_global_event_process */
82 void
83 usb_arch_set_global_event_process(struct process *p);
84 
85 unsigned int
86 usb_arch_get_global_events(void);
87 
88 /* Return true if not all data has been sent to the host */
89 int
90 usb_arch_send_pending(uint8_t ep_addr);
91 
92 #endif /* __USB_ARCH_H__0Z52ZDP0H6__ */