Add flag default
This commit is contained in:
parent
e6c771a989
commit
fc097fa6ac
|
@ -584,14 +584,14 @@ void usb_lld_start(USBDriver *usbp) {
|
||||||
/* Force VBUS detect so the device thinks it is plugged into a host */
|
/* Force VBUS detect so the device thinks it is plugged into a host */
|
||||||
USB->PWR = USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN | USB_USB_PWR_VBUS_DETECT;
|
USB->PWR = USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN | USB_USB_PWR_VBUS_DETECT;
|
||||||
#else
|
#else
|
||||||
#ifdef usb_vbus_detect
|
#if RP_USE_EXTERNAL_VBUS_DETECT == TRUE
|
||||||
/* If VBUS is detected by pin without USB VBUS DET pin,
|
/* If VBUS is detected by pin without USB VBUS DET pin,
|
||||||
* define usb_vbus_detect which returns true if VBUS is enabled.
|
* define usb_vbus_detect which returns true if VBUS is enabled.
|
||||||
*/
|
*/
|
||||||
if (usb_vbus_detect) {
|
if (usb_vbus_detect()) {
|
||||||
USB->PWR = USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN | USB_USB_PWR_VBUS_DETECT;
|
USB->PWR = USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN | USB_USB_PWR_VBUS_DETECT;
|
||||||
}
|
}
|
||||||
#endif /* usb_vbus_detect */
|
#endif /* RP_USE_EXTERNAL_VBUS_DETECT */
|
||||||
#endif /* RP_USB_FORCE_VBUS_DETECT */
|
#endif /* RP_USB_FORCE_VBUS_DETECT */
|
||||||
|
|
||||||
/* Reset procedure enforced on driver start.*/
|
/* Reset procedure enforced on driver start.*/
|
||||||
|
|
|
@ -33,10 +33,6 @@
|
||||||
/* Driver constants. */
|
/* Driver constants. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#if !defined(RP_USB_USE_USBD1)
|
|
||||||
#error "RP_USB_USE_USBD1 not defined in registry"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Maximum endpoint address.
|
* @brief Maximum endpoint address.
|
||||||
*/
|
*/
|
||||||
|
@ -57,6 +53,56 @@
|
||||||
*/
|
*/
|
||||||
#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS
|
#define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Driver pre-compile time settings. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief USBD1 driver enable switch.
|
||||||
|
*/
|
||||||
|
#if !defined(RP_USB_USE_USBD1) || defined(__DOXYGEN__)
|
||||||
|
#define RP_USB_USE_USBD1 FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Force to set VBUS detect register.
|
||||||
|
* @details If you want to use non VBUS DETECT pin for this purpose,
|
||||||
|
set this flag to FALSE and define bool usb_vbus_detect(void) function
|
||||||
|
which returns true to force VBUS DETECT.
|
||||||
|
See RP_USE_EXTERNAL_VBUS_DETECT.
|
||||||
|
*/
|
||||||
|
#if !defined(RP_USB_FORCE_VBUS_DETECT) || defined(__DOXYGEN__)
|
||||||
|
#define RP_USB_FORCE_VBUS_DETECT TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Use custom VBUS detection.
|
||||||
|
@details If RP_USB_FORCE_VBUS_DETECT is FALSE, this flag can be TRUE
|
||||||
|
to detect custom function to detect VBUS.
|
||||||
|
*/
|
||||||
|
#if !defined(RP_USE_EXTERNAL_VBUS_DETECT) || defined(__DOXYGEN__)
|
||||||
|
#define RP_USE_EXTERNAL_VBUS_DETECT FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if RP_USE_EXTERNAL_VBUS_DETECT == TRUE
|
||||||
|
extern bool usb_vbus_detect(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the SOF interrupt.
|
||||||
|
*/
|
||||||
|
#if !defined(RP_USB_USE_SOF_INTR) || defined(__DOXYGEN__)
|
||||||
|
#define RP_USB_USE_SOF_INTR FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the error data sequence interrupt.
|
||||||
|
* @details This flag is useful if you develop low level driver.
|
||||||
|
*/
|
||||||
|
#if !defined(RP_USB_USE_ERROR_DATA_SEQ_INTR) || defined(__DOXYGEN__)
|
||||||
|
#define RP_USB_USE_ERROR_DATA_SEQ_INTR FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver data structures and types. */
|
/* Driver data structures and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -75,6 +75,7 @@
|
||||||
*/
|
*/
|
||||||
#define RP_USB_USE_USBD1 TRUE
|
#define RP_USB_USE_USBD1 TRUE
|
||||||
#define RP_USB_FORCE_VBUS_DETECT TRUE
|
#define RP_USB_FORCE_VBUS_DETECT TRUE
|
||||||
|
#define RP_USE_EXTERNAL_VBUS_DETECT FALSE
|
||||||
#define RP_USB_USE_SOF_INTR FALSE
|
#define RP_USB_USE_SOF_INTR FALSE
|
||||||
#define RP_USB_USE_ERROR_DATA_SEQ_INTR TRUE
|
#define RP_USB_USE_ERROR_DATA_SEQ_INTR TRUE
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@
|
||||||
*/
|
*/
|
||||||
#define RP_USB_USE_USBD1 TRUE
|
#define RP_USB_USE_USBD1 TRUE
|
||||||
#define RP_USB_FORCE_VBUS_DETECT TRUE
|
#define RP_USB_FORCE_VBUS_DETECT TRUE
|
||||||
|
#define RP_USE_EXTERNAL_VBUS_DETECT FALSE
|
||||||
#define RP_USB_USE_SOF_INTR TRUE
|
#define RP_USB_USE_SOF_INTR TRUE
|
||||||
#define RP_USB_USE_ERROR_DATA_SEQ_INTR TRUE
|
#define RP_USB_USE_ERROR_DATA_SEQ_INTR TRUE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue