aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-23 04:01:49 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-23 04:01:49 +0000
commit1e8df8951a3335e4b45ad0c25a82df3d90d785f3 (patch)
treef331b6886dbc830352574d94d7693b9d73af939c /LUFA
parentd540276b448ff70bd70f54b1ce015cbb951c76c0 (diff)
downloadlufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.tar.gz
lufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.tar.bz2
lufa-1e8df8951a3335e4b45ad0c25a82df3d90d785f3.zip
Added V2Protocol handlers to the AVRISP project to enter/exit programming mode, and read/write fuses, lockbits, OSCCAL and Signature bytes.
Added ShutDown functions for all hardware peripheral drivers, so that peripherals can be turned off after use.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h6
-rw-r--r--LUFA/Drivers/Peripheral/SPI.h10
-rw-r--r--LUFA/Drivers/Peripheral/Serial.h13
-rw-r--r--LUFA/Drivers/Peripheral/SerialStream.h8
-rw-r--r--LUFA/ManPages/ChangeLog.txt1
-rw-r--r--LUFA/ManPages/MigrationInformation.txt4
6 files changed, 38 insertions, 4 deletions
diff --git a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
index 4110a508c..edcbc5781 100644
--- a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
+++ b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
@@ -118,11 +118,11 @@
* \param[in] Mode Mask of ADC settings, including adjustment, prescale, mode and reference
*/
static inline void ADC_Init(uint8_t Mode);
-
+
/** Turns off the ADC. If this is called, any further ADC operations will require a call to
* \ref ADC_Init() before the ADC can be used again.
*/
- static inline void ADC_Off(void);
+ static inline void ADC_ShutDown(void);
/** Indicates if the ADC is currently enabled.
*
@@ -145,7 +145,7 @@
#else
#define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE
- #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE
+ #define ADC_ShutDown() MACROS{ ADCSRA = 0; }MACROE
#define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false)
diff --git a/LUFA/Drivers/Peripheral/SPI.h b/LUFA/Drivers/Peripheral/SPI.h
index 6048d86a6..df741d7b8 100644
--- a/LUFA/Drivers/Peripheral/SPI.h
+++ b/LUFA/Drivers/Peripheral/SPI.h
@@ -108,6 +108,16 @@
SPSR &= ~(1 << SPI2X);
}
+ /** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */
+ static inline void SPI_ShutDown(void)
+ {
+ DDRB &= ~((1 << 1) | (1 << 2));
+ PORTB &= ~((1 << 0) | (1 << 3));
+
+ SPCR = 0;
+ SPSR = 0;
+ }
+
/** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.
*
* \param[in] Byte Byte to send through the SPI interface
diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h
index e688cfc02..bde1449e8 100644
--- a/LUFA/Drivers/Peripheral/Serial.h
+++ b/LUFA/Drivers/Peripheral/Serial.h
@@ -118,6 +118,19 @@
UBRR1 = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate));
}
+ /** Turns off the USART driver, disabling and returning used hardware to their default configuration. */
+ static inline void Serial_ShutDown(void)
+ {
+ UCSR1A = 0;
+ UCSR1B = 0;
+ UCSR1C = 0;
+
+ DDRD &= ~(1 << 3);
+ PORTD &= ~(1 << 2);
+
+ UBRR1 = 0;
+ }
+
/** Transmits a given byte through the USART.
*
* \param[in] DataByte Byte to transmit through the USART
diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h
index d3f0014bc..293fda076 100644
--- a/LUFA/Drivers/Peripheral/SerialStream.h
+++ b/LUFA/Drivers/Peripheral/SerialStream.h
@@ -88,6 +88,14 @@
stdout = &USARTStream;
}
+
+ /** Turns off the serial stream (and regular USART driver), disabling and returning used hardware to
+ * their default configuration.
+ */
+ static inline void SerialStream_ShutDown(void)
+ {
+ Serial_ShutDown();
+ }
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index bd2c7d024..058d55c5c 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -15,6 +15,7 @@
* USB_Device_DisableSOFEvents() macros to give bus-synchronised millisecond interrupts when in USB device mode
* - Added new Endpoint_SetEndpointDirection() macro for bi-directional endpoints
* - Added new AVRISP project, a LUFA clone of the Atmel AVRISP-MKII programmer
+ * - Added ShutDown functions for all hardware peripheral drivers, so that peripherals can be turned off after use
*
* <b>Changed:</b>
* - SetIdle requests to the HID device driver with a 0 idle period (send changes only) now only affect the requested
diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt
index 36c7d3580..f65539d56 100644
--- a/LUFA/ManPages/MigrationInformation.txt
+++ b/LUFA/ManPages/MigrationInformation.txt
@@ -11,7 +11,9 @@
* areas relevant to making older projects compatible with the API changes of each new release.
*
* \section Sec_MigrationXXXXXX Migrating from 090810 to XXXXXX
- * No migration information for this version yet.
+ *
+ * <b>Non-USB Library Components</b>
+ * - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library.
*
* \section Sec_Migration090810 Migrating from 090605 to 090810
*