conf_usb.h
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 
37 #ifndef _CONF_USB_H_
38 #define _CONF_USB_H_
39 #if defined( __cplusplus )
40 extern "C" {
41 #endif
42 
43 #include "compiler.h"
44 #include "usb_protocol_cdc.h"
45 
51 #define USB_DEVICE_VENDOR_ID USB_VID_ATMEL
53 // #define USB_DEVICE_PRODUCT_ID USB_PID_ATMEL_ASF_CDC // "Communication Device Class ASF example"
54 #define USB_DEVICE_PRODUCT_ID 0x6124 // "Bossa Program Port" - This allows us to keep same serial port number when switching to SAM-BA mode
55 #define USB_DEVICE_MAJOR_VERSION 1
56 #define USB_DEVICE_MINOR_VERSION 0
57 #define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA)
58 #define USB_DEVICE_ATTR \
59  (USB_CONFIG_ATTR_SELF_POWERED)
60 // (USB_CONFIG_ATTR_BUS_POWERED)
61 // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED)
62 // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED)
63 
65 // #define USB_DEVICE_MANUFACTURE_NAME "Manufacture name"
66 // #define USB_DEVICE_PRODUCT_NAME "Product name"
67 // #define USB_DEVICE_SERIAL_NAME "12...EF"
68 
69 
70 
71 #if 0 // USB device low speed (1.5Mbit/s)
72 #define USB_DEVICE_LOW_SPEED
73 //#define USB_DEVICE_HS_SUPPORT
74 #elif 0 // USB device full speed (12Mbit/s)
75 //#define USB_DEVICE_LOW_SPEED
76 //#define USB_DEVICE_HS_SUPPORT
77 #else // USB device high speed (480Mbit/s)
78 //#define USB_DEVICE_LOW_SPEED
79 #define USB_DEVICE_HS_SUPPORT
80 #endif
81 
82 
87 // #define UDC_VBUS_EVENT(b_vbus_high) user_callback_vbus_action(b_vbus_high)
88 // extern void user_callback_vbus_action(bool b_vbus_high);
89 // #define UDC_SOF_EVENT() user_callback_sof_action()
90 // extern void user_callback_sof_action(void);
91 // #define UDC_SUSPEND_EVENT() user_callback_suspend_action()
92 // extern void user_callback_suspend_action(void);
93 // #define UDC_RESUME_EVENT() user_callback_resume_action()
94 // extern void user_callback_resume_action(void);
95 // Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature
96 // #define UDC_REMOTEWAKEUP_ENABLE() user_callback_remotewakeup_enable()
97 // extern void user_callback_remotewakeup_enable(void);
98 // #define UDC_REMOTEWAKEUP_DISABLE() user_callback_remotewakeup_disable()
99 // extern void user_callback_remotewakeup_disable(void);
100 // When a extra string descriptor must be supported
101 // other than manufacturer, product and serial string
102 // #define UDC_GET_EXTRA_STRING()
104 
106 
107 
117 #define UDI_CDC_PORT_NB 1
119 
121 #define UDI_CDC_ENABLE_EXT(port) true
122 // #define UDI_CDC_ENABLE_EXT(port) my_callback_cdc_enable()
123 // extern bool my_callback_cdc_enable(void);
124 //#define UDI_CDC_DISABLE_EXT(port)
125 #define UDI_CDC_DISABLE_EXT(port) d_usartDMA_callback_cdc_disable()
126 extern void d_usartDMA_callback_cdc_disable(void);
127 #define UDI_CDC_RX_NOTIFY(port)
128 // #define UDI_CDC_RX_NOTIFY(port) my_callback_rx_notify(port)
129 // extern void my_callback_rx_notify(uint8_t port);
130 #define UDI_CDC_TX_EMPTY_NOTIFY(port)
131 // #define UDI_CDC_TX_EMPTY_NOTIFY(port) my_callback_tx_empty_notify(port)
132 // extern void my_callback_tx_empty_notify(uint8_t port);
133 // #define UDI_CDC_SET_CODING_EXT(port,cfg)
134 #define UDI_CDC_SET_CODING_EXT(port,cfg) callback_cdc_set_config(port,cfg)
135 extern void callback_cdc_set_config(uint8_t port, usb_cdc_line_coding_t * cfg);
136 // #define UDI_CDC_SET_DTR_EXT(port,set)
137 #define UDI_CDC_SET_DTR_EXT(port,set) callback_cdc_set_dtr(port,set)
138 extern void callback_cdc_set_dtr(uint8_t port, bool b_enable);
139 #define UDI_CDC_SET_RTS_EXT(port,set)
140 // #define UDI_CDC_SET_RTS_EXT(port,set) callback_cdc_set_rts(port,set)
141 // extern void callback_cdc_set_rts(uint8_t port, bool b_enable);
142 
145 //#define UDI_CDC_LOW_RATE
146 
148 #define UDI_CDC_DEFAULT_RATE 921600
149 #define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1
150 #define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE
151 #define UDI_CDC_DEFAULT_DATABITS 8
152 
153 
154 
155 
161 
163 #include "udi_cdc_conf.h"
164 
165 #if defined( __cplusplus )
166 }
167 #endif
168 #endif // _CONF_USB_H_
void callback_cdc_set_dtr(uint8_t port, bool b_enable)
void d_usartDMA_callback_cdc_disable(void)
Definition: d_usartDMA.c:166
void callback_cdc_set_config(uint8_t port, usb_cdc_line_coding_t *cfg)
Commonly used includes, types and macros.
Default CDC configuration for a USB Device with a single interface.
USB Communication Device Class (CDC) protocol definitions.
Line Coding structure.


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04