Contiki-NG
usb-arch.h
1 #ifndef USB_ARCH_H_0Z52ZDP0H6__
2 #define USB_ARCH_H_0Z52ZDP0H6__
3 
4 #include "contiki.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 usb_arch_setup(void);
45 
46 void usb_arch_setup_control_endpoint(uint8_t addr);
47 
48 void usb_arch_setup_bulk_endpoint(uint8_t addr);
49 
50 void usb_arch_setup_interrupt_endpoint(uint8_t addr);
51 
52 void usb_arch_disable_endpoint(uint8_t addr);
53 
54 void usb_arch_discard_all_buffers(uint8_t addr);
55 
56 /* Stall a control endpoint. The stall will be cleared when the next
57  * SETUP token arrives. */
58 void usb_arch_control_stall(uint8_t addr);
59 
60 /* Set or remove a HALT condition on an endpoint */
61 void usb_arch_halt_endpoint(uint8_t addr, int halt);
62 
63 void usb_arch_set_configuration(uint8_t usb_configuration_value);
64 
65 uint16_t usb_arch_get_ep_status(uint8_t addr);
66 
67 void usb_arch_set_address(uint8_t addr);
68 
69 /* Select what process should be polled when a global event occurs. Intended for the protocol handler. Applications should use usb_set_global_event_process */
70 void usb_arch_set_global_event_process(struct process *p);
71 
72 unsigned int usb_arch_get_global_events(void);
73 
74 /* Return true if not all data has been sent to the host */
75 int usb_arch_send_pending(uint8_t ep_addr);
76 
77 #endif /* USB_ARCH_H_0Z52ZDP0H6__ */
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
Definition: uip-nd6.c:107