aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-12-20 01:11:45 -0800
committerDean Camera <dean@fourwalledcubicle.com>2013-12-20 01:11:45 -0800
commit9965b2ca0a32b06b578f009396aa6071c92ebd88 (patch)
tree91efdca610d043f7cf25bfed835e446a39c0c467 /LUFA
parent70a726b5aa6fb5a87193df1a780050d51110e6cb (diff)
parent25a02432e72542015015b37d4ddfd518f4aea111 (diff)
downloadlufa-9965b2ca0a32b06b578f009396aa6071c92ebd88.tar.gz
lufa-9965b2ca0a32b06b578f009396aa6071c92ebd88.tar.bz2
lufa-9965b2ca0a32b06b578f009396aa6071c92ebd88.zip
Merge pull request #16 from hansmi/master
AVR8: Add option to keep 3.3V regulator enabled.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/DoxygenPages/ChangeLog.txt1
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c3
-rw-r--r--LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h8
3 files changed, 11 insertions, 1 deletions
diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt
index 55150f4d4..75a1c6c6a 100644
--- a/LUFA/DoxygenPages/ChangeLog.txt
+++ b/LUFA/DoxygenPages/ChangeLog.txt
@@ -11,6 +11,7 @@
* - Library Applications:
* - Added new Bulk Vendor low level device demo
* - Added new libUSB host Python and NodeJS application examples for the class driver GenericHID demo (thanks to Laszlo Monda)
+ * - Added new AVR8 USB option to keep 3.3V regulator enabled
*
* <b>Changed:</b>
* - Library Applications:
diff --git a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
index 8faec1df0..dc96c0fe7 100644
--- a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
+++ b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
@@ -112,7 +112,8 @@ void USB_Disable(void)
if (!(USB_Options & USB_OPT_MANUAL_PLL))
USB_PLL_Off();
- USB_REG_Off();
+ if (!(USB_Options & USB_OPT_REG_KEEP_ENABLED))
+ USB_REG_Off();
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
USB_OTGPAD_Off();
diff --git a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h
index 1b72bf13b..fedc04ec1 100644
--- a/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h
+++ b/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h
@@ -133,6 +133,14 @@
*/
#define USB_OPT_REG_ENABLED (0 << 1)
+ /** Option mask for \ref USB_Init() to keep regulator enabled at all times. Indicates that \ref USB_Disable()
+ * should not disable the regulator as it would otherwise. Has no effect if regulator is disabled using
+ * \ref USB_OPT_REG_DISABLED.
+ *
+ * \note See USB AVR data sheet for more information on the internal pad regulator.
+ */
+ #define USB_OPT_REG_KEEP_ENABLED (1 << 3)
+
/** Manual PLL control option mask for \ref USB_Init(). This indicates to the library that the user application
* will take full responsibility for controlling the AVR's PLL (used to generate the high frequency clock
* that the USB controller requires) and ensuring that it is locked at the correct frequency for USB operations.