diff options
author | Michael Walker <walkerstop@gmail.com> | 2018-05-01 03:26:28 -0700 |
---|---|---|
committer | Michael Walker <walkerstop@gmail.com> | 2018-05-01 03:26:28 -0700 |
commit | 0fbddccd80d3f7f27d2d9286b5e280b53a9e8bd0 (patch) | |
tree | 555dd3b1f4cb1a11a1aef96755e26717f7579d88 | |
parent | 46233064c5527da13c9ea1668a41659a7f8e9a45 (diff) | |
download | ChibiOS-Contrib-0fbddccd80d3f7f27d2d9286b5e280b53a9e8bd0.tar.gz ChibiOS-Contrib-0fbddccd80d3f7f27d2d9286b5e280b53a9e8bd0.tar.bz2 ChibiOS-Contrib-0fbddccd80d3f7f27d2d9286b5e280b53a9e8bd0.zip |
disable voltage inrush regulator
-rw-r--r-- | os/common/ext/CMSIS/KINETIS/MK66F18.h | 9 | ||||
-rw-r--r-- | os/hal/ports/KINETIS/LLD/hal_usb_lld.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/os/common/ext/CMSIS/KINETIS/MK66F18.h b/os/common/ext/CMSIS/KINETIS/MK66F18.h index b795a23..b564626 100644 --- a/os/common/ext/CMSIS/KINETIS/MK66F18.h +++ b/os/common/ext/CMSIS/KINETIS/MK66F18.h @@ -12032,7 +12032,8 @@ typedef struct { #define SIM_SOPT1_USBSSTBY(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBSSTBY_SHIFT)) & SIM_SOPT1_USBSSTBY_MASK) #define SIM_SOPT1_USBREGEN_MASK (0x80000000U) #define SIM_SOPT1_USBREGEN_SHIFT (31U) -#define SIM_SOPT1_USBREGEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBREGEN_SHIFT)) & SIM_SOPT1_USBREGEN_MASK) +#define SIM_SOPT1_USBREGEN_SET(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT1_USBREGEN_SHIFT)) & SIM_SOPT1_USBREGEN_MASK) +#define SIM_SOPT1_USBREGEN SIM_SOPT1_USBREGEN_SET(1) /*! @name SOPT1CFG - SOPT1 Configuration Register */ #define SIM_SOPT1CFG_URWE_MASK (0x1000000U) @@ -12057,7 +12058,8 @@ typedef struct { #define SIM_USBPHYCTL_USB3VOUTTRG(x) (((uint32_t)(((uint32_t)(x)) << SIM_USBPHYCTL_USB3VOUTTRG_SHIFT)) & SIM_USBPHYCTL_USB3VOUTTRG_MASK) #define SIM_USBPHYCTL_USBDISILIM_MASK (0x800000U) #define SIM_USBPHYCTL_USBDISILIM_SHIFT (23U) -#define SIM_USBPHYCTL_USBDISILIM(x) (((uint32_t)(((uint32_t)(x)) << SIM_USBPHYCTL_USBDISILIM_SHIFT)) & SIM_USBPHYCTL_USBDISILIM_MASK) +#define SIM_USBPHYCTL_USBDISILIM_SET(x) (((uint32_t)(((uint32_t)(x)) << SIM_USBPHYCTL_USBDISILIM_SHIFT)) & SIM_USBPHYCTL_USBDISILIM_MASK) +#define SIM_USBPHYCTL_USBDISILIM SIM_USBPHYCTL_USBDISILIM_SET(1) /*! @name SOPT2 - System Options Register 2 */ #define SIM_SOPT2_USBSLSRC_MASK (0x1U) @@ -12065,7 +12067,8 @@ typedef struct { #define SIM_SOPT2_USBSLSRC(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_USBSLSRC_SHIFT)) & SIM_SOPT2_USBSLSRC_MASK) #define SIM_SOPT2_USBREGEN_MASK (0x2U) #define SIM_SOPT2_USBREGEN_SHIFT (1U) -#define SIM_SOPT2_USBREGEN(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_USBREGEN_SHIFT)) & SIM_SOPT2_USBREGEN_MASK) +#define SIM_SOPT2_USBREGEN_SET(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_USBREGEN_SHIFT)) & SIM_SOPT2_USBREGEN_MASK) +#define SIM_SOPT2_USBREGEN SIM_SOPT2_USBREGEN_SET(1) #define SIM_SOPT2_RTCCLKOUTSEL_MASK (0x10U) #define SIM_SOPT2_RTCCLKOUTSEL_SHIFT (4U) #define SIM_SOPT2_RTCCLKOUTSEL(x) (((uint32_t)(((uint32_t)(x)) << SIM_SOPT2_RTCCLKOUTSEL_SHIFT)) & SIM_SOPT2_RTCCLKOUTSEL_MASK) diff --git a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c index 77421c8..7b7aa0e 100644 --- a/os/hal/ports/KINETIS/LLD/hal_usb_lld.c +++ b/os/hal/ports/KINETIS/LLD/hal_usb_lld.c @@ -461,9 +461,15 @@ void usb_lld_start(USBDriver *usbp) { _bdt[i].addr=0;
}
+#if defined(MK66F18)
+ /* Disable the USB current limiter */
+ SIM->USBPHYCTL |= SIM_USBPHYCTL_USBDISILIM;
+#endif
+
/* Enable Clock */
#if KINETIS_USB0_IS_USBOTG
SIM->SCGC4 |= SIM_SCGC4_USBOTG;
+
#else /* KINETIS_USB0_IS_USBOTG */
SIM->SCGC4 |= SIM_SCGC4_USBFS;
#endif /* KINETIS_USB0_IS_USBOTG */
|