aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral/XMEGA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-02-12 20:39:57 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-02-12 20:39:57 +0000
commit5051df08d761acada01c4db4ee468e236245bc04 (patch)
tree4d0e07e5409efdf580c23b40036de36d7b9d2e50 /LUFA/Drivers/Peripheral/XMEGA
parent09d2be0dc1630b2ae2403d555c0360f1c4379322 (diff)
downloadlufa-5051df08d761acada01c4db4ee468e236245bc04.tar.gz
lufa-5051df08d761acada01c4db4ee468e236245bc04.tar.bz2
lufa-5051df08d761acada01c4db4ee468e236245bc04.zip
Minor documentation improvements.
Diffstat (limited to 'LUFA/Drivers/Peripheral/XMEGA')
-rw-r--r--LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h20
-rw-r--r--LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h11
2 files changed, 16 insertions, 15 deletions
diff --git a/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h b/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h
index 1d28d309d..dac684f44 100644
--- a/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h
+++ b/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h
@@ -159,9 +159,9 @@
/** Initializes the SPI subsystem, ready for transfers. Must be called before calling any other
* SPI routines.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
- * \param[in] SPIOptions SPI Options, a mask consisting of one of each of the \c SPI_SPEED_*,
- * \c SPI_SCK_*, \c SPI_SAMPLE_*, \c SPI_ORDER_* and \c SPI_MODE_* masks.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in] SPIOptions SPI Options, a mask consisting of one of each of the \c SPI_SPEED_*,
+ * \c SPI_SCK_*, \c SPI_SAMPLE_*, \c SPI_ORDER_* and \c SPI_MODE_* masks.
*/
static inline void SPI_Init(SPI_t* const SPI,
const uint8_t SPIOptions)
@@ -171,7 +171,7 @@
/** Turns off the SPI driver, disabling and returning used hardware to their default configuration.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
*/
static inline void SPI_Disable(SPI_t* const SPI)
{
@@ -180,7 +180,7 @@
/** Retrieves the currently selected SPI mode, once the SPI interface has been configured.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
*
* \return \ref SPI_MODE_MASTER if the interface is currently in SPI Master mode, \ref SPI_MODE_SLAVE otherwise
*/
@@ -192,8 +192,8 @@
/** Sends and receives a byte through the SPI interface, blocking until the transfer is complete.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
- * \param[in] Byte Byte to send through the SPI interface.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in] Byte Byte to send through the SPI interface.
*
* \return Response byte from the attached SPI device.
*/
@@ -210,8 +210,8 @@
/** Sends a byte through the SPI interface, blocking until the transfer is complete. The response
* byte sent to from the attached SPI device is ignored.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
- * \param[in] Byte Byte to send through the SPI interface.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in] Byte Byte to send through the SPI interface.
*/
static inline void SPI_SendByte(SPI_t* const SPI,
const uint8_t Byte) ATTR_ALWAYS_INLINE;
@@ -225,7 +225,7 @@
/** Sends a dummy byte through the SPI interface, blocking until the transfer is complete. The response
* byte from the attached SPI device is returned.
*
- * \param[in, out] SPI Pointer to the base of the SPI peripheral within the device.
+ * \param[in,out] SPI Pointer to the base of the SPI peripheral within the device.
*
* \return The response byte from the attached SPI device.
*/
diff --git a/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h b/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h
index 50352195c..8dd7844b5 100644
--- a/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h
+++ b/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h
@@ -43,7 +43,7 @@
* \section Sec_ModDescription Module Description
* On-chip serial USART driver for the XMEGA AVR microcontrollers.
*
- * \note This file should not be included directly. It is automatically included as needed by the ADC driver
+ * \note This file should not be included directly. It is automatically included as needed by the USART driver
* dispatch header located in LUFA/Drivers/Peripheral/Serial.h.
*
* \section Sec_ExampleUsage Example Usage
@@ -52,13 +52,13 @@
*
* \code
* // Initialize the serial USART driver before first use, with 9600 baud (and no double-speed mode)
- * Serial_Init(9600, false);
+ * Serial_Init(&USARTD, 9600, false);
*
* // Send a string through the USART
- * Serial_TxString("Test String\r\n");
+ * Serial_TxString(&USARTD, "Test String\r\n");
*
* // Receive a byte through the USART
- * uint8_t DataByte = Serial_RxByte();
+ * uint8_t DataByte = Serial_RxByte(&USARTD);
* \endcode
*
* @{
@@ -153,7 +153,7 @@
const uint32_t BaudRate,
const bool DoubleSpeed)
{
- uint32_t BaudValue = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate));
+ uint16_t BaudValue = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate));
USART->BAUDCTRLB = (BaudValue >> 8);
USART->BAUDCTRLA = (BaudValue & 0xFF);
@@ -263,6 +263,7 @@
if (!(Serial_IsCharReceived(USART)))
return -1;
+ USART->STATUS = USART_RXCIF_bm;
return USART->DATA;
}