Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lufa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Erik Strand
lufa
Commits
deed746d
Commit
deed746d
authored
Jun 17, 2010
by
Dean Camera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed SERIAL_STREAM_ASSERT() macro to STDOUT_ASSERT().
Minor tweaks to the library documentation.
parent
69dc32c5
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
917 additions
and
910 deletions
+917
-910
LUFA/Common/Attributes.h
LUFA/Common/Attributes.h
+4
-4
LUFA/Common/Common.h
LUFA/Common/Common.h
+12
-12
LUFA/Doxygen.conf
LUFA/Doxygen.conf
+1
-1
LUFA/Drivers/Board/Buttons.h
LUFA/Drivers/Board/Buttons.h
+1
-1
LUFA/Drivers/Board/Dataflash.h
LUFA/Drivers/Board/Dataflash.h
+2
-2
LUFA/Drivers/Board/Joystick.h
LUFA/Drivers/Board/Joystick.h
+1
-1
LUFA/Drivers/Board/LEDs.h
LUFA/Drivers/Board/LEDs.h
+7
-7
LUFA/Drivers/Board/Temperature.h
LUFA/Drivers/Board/Temperature.h
+1
-1
LUFA/Drivers/Misc/TerminalCodes.h
LUFA/Drivers/Misc/TerminalCodes.h
+4
-1
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
+7
-7
LUFA/Drivers/Peripheral/SPI.h
LUFA/Drivers/Peripheral/SPI.h
+5
-5
LUFA/Drivers/Peripheral/Serial.h
LUFA/Drivers/Peripheral/Serial.h
+7
-7
LUFA/Drivers/Peripheral/SerialStream.h
LUFA/Drivers/Peripheral/SerialStream.h
+2
-2
LUFA/Drivers/USB/Class/Common/Audio.h
LUFA/Drivers/USB/Class/Common/Audio.h
+78
-78
LUFA/Drivers/USB/Class/Common/CDC.h
LUFA/Drivers/USB/Class/Common/CDC.h
+26
-26
LUFA/Drivers/USB/Class/Common/HID.h
LUFA/Drivers/USB/Class/Common/HID.h
+20
-20
LUFA/Drivers/USB/Class/Common/MIDI.h
LUFA/Drivers/USB/Class/Common/MIDI.h
+41
-39
LUFA/Drivers/USB/Class/Common/MassStorage.h
LUFA/Drivers/USB/Class/Common/MassStorage.h
+17
-15
LUFA/Drivers/USB/Class/Common/RNDIS.h
LUFA/Drivers/USB/Class/Common/RNDIS.h
+12
-12
LUFA/Drivers/USB/Class/Common/StillImage.h
LUFA/Drivers/USB/Class/Common/StillImage.h
+26
-26
LUFA/Drivers/USB/Class/Device/Audio.h
LUFA/Drivers/USB/Class/Device/Audio.h
+25
-25
LUFA/Drivers/USB/Class/Device/CDC.h
LUFA/Drivers/USB/Class/Device/CDC.h
+40
-40
LUFA/Drivers/USB/Class/Device/HID.h
LUFA/Drivers/USB/Class/Device/HID.h
+20
-20
LUFA/Drivers/USB/Class/Device/MIDI.h
LUFA/Drivers/USB/Class/Device/MIDI.h
+19
-19
LUFA/Drivers/USB/Class/Device/MassStorage.h
LUFA/Drivers/USB/Class/Device/MassStorage.h
+17
-17
LUFA/Drivers/USB/Class/Device/RNDIS.h
LUFA/Drivers/USB/Class/Device/RNDIS.h
+23
-23
LUFA/Drivers/USB/Class/Host/CDC.h
LUFA/Drivers/USB/Class/Host/CDC.h
+49
-49
LUFA/Drivers/USB/Class/Host/HID.h
LUFA/Drivers/USB/Class/Host/HID.h
+43
-43
LUFA/Drivers/USB/Class/Host/HIDParser.h
LUFA/Drivers/USB/Class/Host/HIDParser.h
+21
-21
LUFA/Drivers/USB/Class/Host/MIDI.h
LUFA/Drivers/USB/Class/Host/MIDI.h
+24
-24
LUFA/Drivers/USB/Class/Host/MassStorage.h
LUFA/Drivers/USB/Class/Host/MassStorage.h
+58
-58
LUFA/Drivers/USB/Class/Host/Printer.h
LUFA/Drivers/USB/Class/Host/Printer.h
+33
-33
LUFA/Drivers/USB/Class/Host/RNDIS.h
LUFA/Drivers/USB/Class/Host/RNDIS.h
+47
-47
LUFA/Drivers/USB/Class/Host/StillImage.h
LUFA/Drivers/USB/Class/Host/StillImage.h
+51
-51
LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
+29
-29
LUFA/Drivers/USB/HighLevel/Events.h
LUFA/Drivers/USB/HighLevel/Events.h
+3
-3
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
+14
-14
LUFA/Drivers/USB/HighLevel/USBTask.h
LUFA/Drivers/USB/HighLevel/USBTask.h
+2
-2
LUFA/Drivers/USB/LowLevel/DevChapter9.h
LUFA/Drivers/USB/LowLevel/DevChapter9.h
+3
-3
LUFA/Drivers/USB/LowLevel/Device.h
LUFA/Drivers/USB/LowLevel/Device.h
+1
-1
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/Drivers/USB/LowLevel/Endpoint.h
+33
-33
LUFA/Drivers/USB/LowLevel/Host.h
LUFA/Drivers/USB/LowLevel/Host.h
+10
-10
LUFA/Drivers/USB/LowLevel/OTG.h
LUFA/Drivers/USB/LowLevel/OTG.h
+17
-16
LUFA/Drivers/USB/LowLevel/Pipe.h
LUFA/Drivers/USB/LowLevel/Pipe.h
+46
-46
LUFA/Drivers/USB/USB.h
LUFA/Drivers/USB/USB.h
+2
-3
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/ChangeLog.txt
+1
-0
LUFA/Scheduler/Scheduler.h
LUFA/Scheduler/Scheduler.h
+12
-13
No files found.
LUFA/Common/Attributes.h
View file @
deed746d
...
...
@@ -124,15 +124,15 @@
/** Places the function in one of the initialization sections, which execute before the main function
* of the application. Refer to the avr-libc manual for more information on the initialization sections.
*
* \param[in]
x Initialization section number where the function should be placed
* \param[in]
SectionIndex Initialization section number where the function should be placed.
*/
#define ATTR_INIT_SECTION(
x) __attribute__ ((naked, section (".init" #
x )))
#define ATTR_INIT_SECTION(
SectionIndex) __attribute__ ((naked, section (".init" #SectionInde
x )))
/** Marks a function as an alias for another function.
*
* \param[in]
x Name of the function which the given function name should alias
* \param[in]
Func Name of the function which the given function name should alias.
*/
#define ATTR_ALIAS(
x) __attribute__ ((alias( #x
)))
#define ATTR_ALIAS(
Func) __attribute__ ((alias( #Func
)))
#endif
/** @} */
LUFA/Common/Common.h
View file @
deed746d
...
...
@@ -99,17 +99,17 @@
*/
#define JTAG_DEBUG_ASSERT(x) MACROS{ if (!(x)) { JTAG_DEBUG_BREAK(); } }MACROE
/** Macro for testing condition "x" and writing debug data to the serial stream if false. As a
* prerequisite for this macro, the serial stream should be configured via the Peripheral/SerialStream driver.
/** Macro for testing condition "x" and writing debug data to the stdout stream if false. The stdout stream
* must be pre-initialized before this macro is run and linked to an output device, such as the AVR's USART
* peripheral.
*
* The serial output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion
* {x} failed."
* The output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion {x} failed."
*
* \ingroup Group_Debugging
*/
#define S
ERIAL_STREAM
_ASSERT(x) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \
"Assertion \"%s\" failed.\r\n"), \
__FILE__, __func__, __LINE__, #x); } \
#define S
TDOUT
_ASSERT(x) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \
"Assertion \"%s\" failed.\r\n"), \
__FILE__, __func__, __LINE__, #x); } \
}MACROE
/* Inline Functions: */
...
...
@@ -118,7 +118,7 @@
*
* \ingroup Group_BitManip
*
* \param[in] Byte Byte of data whose bits are to be reversed
* \param[in] Byte Byte of data whose bits are to be reversed
.
*/
static
inline
uint8_t
BitReverse
(
uint8_t
Byte
)
ATTR_WARN_UNUSED_RESULT
ATTR_CONST
;
static
inline
uint8_t
BitReverse
(
uint8_t
Byte
)
...
...
@@ -134,7 +134,7 @@
*
* \ingroup Group_BitManip
*
* \param[in] Word Word of data whose bytes are to be swapped
* \param[in] Word Word of data whose bytes are to be swapped
.
*/
static
inline
uint16_t
SwapEndian_16
(
uint16_t
Word
)
ATTR_WARN_UNUSED_RESULT
ATTR_CONST
;
static
inline
uint16_t
SwapEndian_16
(
uint16_t
Word
)
...
...
@@ -146,7 +146,7 @@
*
* \ingroup Group_BitManip
*
* \param[in] DWord Double word of data whose bytes are to be swapped
* \param[in] DWord Double word of data whose bytes are to be swapped
.
*/
static
inline
uint32_t
SwapEndian_32
(
uint32_t
DWord
)
ATTR_WARN_UNUSED_RESULT
ATTR_CONST
;
static
inline
uint32_t
SwapEndian_32
(
uint32_t
DWord
)
...
...
@@ -161,8 +161,8 @@
*
* \ingroup Group_BitManip
*
* \param[in,out] Data Pointer to a number containing an even number of bytes to be reversed
* \param[in] Bytes Length of the data in bytes
* \param[in,out] Data Pointer to a number containing an even number of bytes to be reversed
.
* \param[in] Bytes Length of the data in bytes
.
*/
static
inline
void
SwapEndian_n
(
void
*
Data
,
uint8_t
Bytes
);
static
inline
void
SwapEndian_n
(
void
*
Data
,
uint8_t
Bytes
)
...
...
LUFA/Doxygen.conf
View file @
deed746d
...
...
@@ -636,7 +636,7 @@ EXCLUDE_PATTERNS =
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS
=
__
*
EXCLUDE_SYMBOLS
=
_
*
_
_
*
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
...
...
LUFA/Drivers/Board/Buttons.h
View file @
deed746d
...
...
@@ -108,7 +108,7 @@
/** Returns a mask indicating which board buttons are currently pressed.
*
* \return Mask indicating which board buttons are currently pressed
* \return Mask indicating which board buttons are currently pressed
.
*/
static
inline
uint8_t
Buttons_GetStatus
(
void
)
ATTR_WARN_UNUSED_RESULT
;
#endif
...
...
LUFA/Drivers/Board/Dataflash.h
View file @
deed746d
...
...
@@ -218,8 +218,8 @@
/** Sends a set of page and buffer address bytes to the currently selected dataflash IC, for use with
* dataflash commands which require a complete 24-byte address.
*
* \param[in] PageAddress Page address within the selected dataflash IC
* \param[in] BufferByte Address within the dataflash's buffer
* \param[in] PageAddress Page address within the selected dataflash IC
.
* \param[in] BufferByte Address within the dataflash's buffer
.
*/
static
inline
void
Dataflash_SendAddressBytes
(
uint16_t
PageAddress
,
const
uint16_t
BufferByte
);
...
...
LUFA/Drivers/Board/Joystick.h
View file @
deed746d
...
...
@@ -99,7 +99,7 @@
* currently facing in (multiple bits can be set).
*
* \return Mask indicating the joystick direction - see corresponding board specific Joystick.h file
* for direction masks
* for direction masks
.
*/
static
inline
uint8_t
Joystick_GetStatus
(
void
)
ATTR_WARN_UNUSED_RESULT
;
#endif
...
...
LUFA/Drivers/Board/LEDs.h
View file @
deed746d
...
...
@@ -140,41 +140,41 @@
/** Turns on the LEDs specified in the given LED mask.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
.
*/
static
inline
void
LEDs_TurnOnLEDs
(
const
uint8_t
LEDMask
);
/** Turns off the LEDs specified in the given LED mask.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
.
*/
static
inline
void
LEDs_TurnOffLEDs
(
const
uint8_t
LEDMask
);
/** Turns off all LEDs not specified in the given LED mask, and turns on all the LEDs in the given LED
* mask.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
.
*/
static
inline
void
LEDs_SetAllLEDs
(
const
uint8_t
LEDMask
);
/** Turns off all LEDs in the LED mask that are not set in the active mask, and turns on all the LEDs
* specified in both the LED and active masks.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
* \param[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
.
* \param[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off
.
*/
static
inline
void
LEDs_ChangeLEDs
(
const
uint8_t
LEDMask
,
const
uint8_t
ActiveMask
);
/** Toggles all LEDs in the LED mask, leaving all others in their current states.
*
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file)
.
*/
static
inline
void
LEDs_ToggleLEDs
(
const
uint8_t
LEDMask
);
/** Returns the status of all the board LEDs; set LED masks in the return value indicate that the
* corresponding LED is on.
*
* \return Mask of the board LEDs which are currently turned on
* \return Mask of the board LEDs which are currently turned on
.
*/
static
inline
uint8_t
LEDs_GetLEDs
(
void
)
ATTR_WARN_UNUSED_RESULT
;
#endif
...
...
LUFA/Drivers/Board/Temperature.h
View file @
deed746d
...
...
@@ -103,7 +103,7 @@
/** Performs a complete ADC on the temperature sensor channel, and converts the result into a
* valid temperature between \ref TEMP_MIN_TEMP and \ref TEMP_MAX_TEMP in degrees Celsius.
*
* \return Signed temperature
in degrees Celsius
* \return Signed temperature
value in degrees Celsius.
*/
int8_t
Temperature_GetTemperature
(
void
)
ATTR_WARN_UNUSED_RESULT
;
...
...
LUFA/Drivers/Misc/TerminalCodes.h
View file @
deed746d
...
...
@@ -63,7 +63,10 @@
/* Public Interface - May be used in end-application: */
/* Macros: */
#if !defined(DISABLE_TERMINAL_CODES)
/** Creates an ANSII escape sequence with the payload specified by "c". */
/** Creates an ANSI escape sequence with the payload specified by "c".
*
* \param[in] c Payload to encode as an ANSI escape sequence, a ESC_* mask.
*/
#define ANSI_ESCAPE_SEQUENCE(c) "\33[" c
#else
#define ANSI_ESCAPE_SEQUENCE(c)
...
...
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
View file @
deed746d
...
...
@@ -203,7 +203,7 @@
* The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
* prescaler masks.
*
* \param[in] Mode Mask of ADC settings, including adjustment, prescale, mode and reference
* \param[in] Mode Mask of ADC settings, including adjustment, prescale, mode and reference
.
*/
static
inline
void
ADC_Init
(
uint8_t
Mode
);
...
...
@@ -221,14 +221,14 @@
/** Indicates if the current ADC conversion is completed, or still in progress.
*
* \return Boolean false if the reading is still taking place, or true if the conversion is
* complete and ready to be read out with \ref ADC_GetResult()
* complete and ready to be read out with \ref ADC_GetResult()
.
*/
static
inline
bool
ADC_IsReadingComplete
(
void
);
/** Retrieves the conversion value of the last completed ADC conversion and clears the reading
* completion flag.
*
* \return The result of the last ADC conversion
* \return The result of the last ADC conversion
as an unsigned value.
*/
static
inline
uint16_t
ADC_GetResult
(
void
);
#else
...
...
@@ -254,7 +254,7 @@
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
* \param[in] Channel ADC channel number to set up for conversions
* \param[in] Channel ADC channel number to set up for conversions
.
*/
static
inline
void
ADC_SetupChannel
(
const
uint8_t
Channel
)
{
...
...
@@ -297,7 +297,7 @@
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
* \param[in] Channel ADC channel number to set up for conversions
* \param[in] Channel ADC channel number to set up for conversions
.
*/
static
inline
void
ADC_DisableChannel
(
const
uint8_t
Channel
)
{
...
...
@@ -338,7 +338,7 @@
* conversions. If the ADC is in single conversion mode (or the channel to convert from is to be changed),
* this function must be called each time a conversion is to take place.
*
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
.
*/
static
inline
void
ADC_StartReading
(
const
uint16_t
MUXMask
)
{
...
...
@@ -361,7 +361,7 @@
* to \ref ADC_StartReading() to select the channel and begin the automated conversions, and
* the results read directly from the \ref ADC_GetResult() instead to reduce overhead.
*
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
* \param[in] MUXMask Mask comprising of an ADC channel mask, reference mask and adjustment mask
.
*/
static
inline
uint16_t
ADC_GetChannelReading
(
const
uint16_t
MUXMask
)
ATTR_WARN_UNUSED_RESULT
;
static
inline
uint16_t
ADC_GetChannelReading
(
const
uint16_t
MUXMask
)
...
...
LUFA/Drivers/Peripheral/SPI.h
View file @
deed746d
...
...
@@ -111,7 +111,7 @@
* SPI routines.
*
* \param[in] SPIOptions SPI Options, a mask consisting of one of each of the SPI_SPEED_*,
* SPI_SCK_*, SPI_SAMPLE_* and SPI_MODE_* masks
* SPI_SCK_*, SPI_SAMPLE_* and SPI_MODE_* masks
.
*/
static
inline
void
SPI_Init
(
const
uint8_t
SPIOptions
)
{
...
...
@@ -138,9 +138,9 @@
/** 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
* \param[in] Byte Byte to send through the SPI interface
.
*
* \return Response byte from the attached SPI device
* \return Response byte from the attached SPI device
.
*/
static
inline
uint8_t
SPI_TransferByte
(
const
uint8_t
Byte
)
ATTR_ALWAYS_INLINE
;
static
inline
uint8_t
SPI_TransferByte
(
const
uint8_t
Byte
)
...
...
@@ -153,7 +153,7 @@
/** 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] Byte Byte to send through the SPI interface
* \param[in] Byte Byte to send through the SPI interface
.
*/
static
inline
void
SPI_SendByte
(
const
uint8_t
Byte
)
ATTR_ALWAYS_INLINE
;
static
inline
void
SPI_SendByte
(
const
uint8_t
Byte
)
...
...
@@ -165,7 +165,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.
*
* \return The response byte from the attached SPI device
* \return The response byte from the attached SPI device
.
*/
static
inline
uint8_t
SPI_ReceiveByte
(
void
)
ATTR_ALWAYS_INLINE
ATTR_WARN_UNUSED_RESULT
;
static
inline
uint8_t
SPI_ReceiveByte
(
void
)
...
...
LUFA/Drivers/Peripheral/Serial.h
View file @
deed746d
...
...
@@ -80,7 +80,7 @@
#if defined(__DOXYGEN__)
/** Indicates whether a character has been received through the USART.
*
* \return Boolean true if a character has been received, false otherwise
* \return Boolean true if a character has been received, false otherwise
.
*/
static
inline
bool
Serial_IsCharReceived
(
void
);
#else
...
...
@@ -90,13 +90,13 @@
/* Function Prototypes: */
/** Transmits a given string located in program space (FLASH) through the USART.
*
* \param[in] FlashStringPtr Pointer to a string located in program space
* \param[in] FlashStringPtr Pointer to a string located in program space
.
*/
void
Serial_TxString_P
(
const
char
*
FlashStringPtr
)
ATTR_NON_NULL_PTR_ARG
(
1
);
/** Transmits a given string located in SRAM memory through the USART.
*
* \param[in] StringPtr Pointer to a string located in SRAM space
* \param[in] StringPtr Pointer to a string located in SRAM space
.
*/
void
Serial_TxString
(
const
char
*
StringPtr
)
ATTR_NON_NULL_PTR_ARG
(
1
);
...
...
@@ -104,8 +104,8 @@
/** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to
* standard 8-bit, no parity, 1 stop bit settings suitable for most applications.
*
* \param[in] BaudRate Serial baud rate, in bits per second
* \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
* \param[in] BaudRate Serial baud rate, in bits per second
.
* \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
.
*/
static
inline
void
Serial_Init
(
const
uint32_t
BaudRate
,
const
bool
DoubleSpeed
)
{
...
...
@@ -134,7 +134,7 @@
/** Transmits a given byte through the USART.
*
* \param[in] DataByte Byte to transmit through the USART
* \param[in] DataByte Byte to transmit through the USART
.
*/
static
inline
void
Serial_TxByte
(
const
char
DataByte
)
{
...
...
@@ -144,7 +144,7 @@
/** Receives a byte from the USART.
*
* \return Byte received from the USART
* \return Byte received from the USART
.
*/
static
inline
char
Serial_RxByte
(
void
)
{
...
...
LUFA/Drivers/Peripheral/SerialStream.h
View file @
deed746d
...
...
@@ -84,8 +84,8 @@
/** Initializes the serial stream (and regular USART driver) so that both the stream and regular
* USART driver functions can be used. Must be called before any stream or regular USART functions.
*
* \param[in] BaudRate Baud rate to configure the USART to
* \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
* \param[in] BaudRate Baud rate to configure the USART to
.
* \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate
.
*/
static
inline
void
SerialStream_Init
(
const
uint32_t
BaudRate
,
const
bool
DoubleSpeed
)
{
...
...
LUFA/Drivers/USB/Class/Common/Audio.h
View file @
deed746d
...
...
@@ -79,22 +79,22 @@
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
#define DTYPE_AudioEndpoint 0x25
/** Audio class descriptor subtype value for a Audio class
specific header descriptor. */
/** Audio class descriptor subtype value for a Audio class
-
specific header descriptor. */
#define DSUBTYPE_Header 0x01
/** Audio class descriptor subtype value for an Output Terminal Audio class
specific descriptor. */
/** Audio class descriptor subtype value for an Output Terminal Audio class
-
specific descriptor. */
#define DSUBTYPE_InputTerminal 0x02
/** Audio class descriptor subtype value for an Input Terminal Audio class
specific descriptor. */
/** Audio class descriptor subtype value for an Input Terminal Audio class
-
specific descriptor. */
#define DSUBTYPE_OutputTerminal 0x03
/** Audio class descriptor subtype value for a Feature Unit Audio class
specific descriptor. */
/** Audio class descriptor subtype value for a Feature Unit Audio class
-
specific descriptor. */
#define DSUBTYPE_FeatureUnit 0x06
/** Audio class descriptor subtype value for a general Audio class
specific descriptor. */
/** Audio class descriptor subtype value for a general Audio class
-
specific descriptor. */
#define DSUBTYPE_General 0x01
/** Audio class descriptor subtype value for an Audio class
specific descriptor indicating the format of an audio stream. */
/** Audio class descriptor subtype value for an Audio class
-
specific descriptor indicating the format of an audio stream. */
#define DSUBTYPE_Format 0x02
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
...
...
@@ -225,175 +225,175 @@
*/
#define AUDIO_SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
/** Mask for the attributes parameter of an Audio class
specific Endpoint descriptor, indicating that the endpoint
/** Mask for the attributes parameter of an Audio class
-
specific Endpoint descriptor, indicating that the endpoint
* accepts only filled endpoint packets of audio samples.
*/
#define EP_ACCEPTS_ONLY_FULL_PACKETS (1 << 7)
/** Mask for the attributes parameter of an Audio class
specific Endpoint descriptor, indicating that the endpoint
/** Mask for the attributes parameter of an Audio class
-
specific Endpoint descriptor, indicating that the endpoint
* will accept partially filled endpoint packets of audio samples.
*/
#define EP_ACCEPTS_SMALL_PACKETS (0 << 7)
/* Type Defines: */
/** \brief Audio
Class S
pecific Interface Descriptor.
/** \brief Audio
class-s
pecific Interface Descriptor.
*
* Type define for an Audio class
specific interface descriptor. This follows a regular interface descriptor to
* Type define for an Audio class
-
specific interface descriptor. This follows a regular interface descriptor to
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
* details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint16_t
ACSpecification
;
/**< Binary coded decimal value, indicating the supported Audio Class specification version */
uint16_t
TotalLength
;
/**< Total length of the Audio class
specific descriptors, including this descriptor
*/
uint16_t
ACSpecification
;
/**< Binary coded decimal value, indicating the supported Audio Class specification version
.
*/
uint16_t
TotalLength
;
/**< Total length of the Audio class
-specific descriptors, including this descriptor.
*/
uint8_t
InCollection
;
/**< Total number of audio class interfaces within this device */
uint8_t
InterfaceNumbers
[
1
];
/**< Interface numbers of each audio interface */
uint8_t
InCollection
;
/**< Total number of audio class interfaces within this device
.
*/
uint8_t
InterfaceNumbers
[
1
];
/**< Interface numbers of each audio interface
.
*/
}
USB_Audio_Interface_AC_t
;
/** \brief Audio
Class S
pecific Feature Unit Descriptor.
/** \brief Audio
class-s
pecific Feature Unit Descriptor.
*
* Type define for an Audio class
specific Feature Unit descriptor. This indicates to the host what features
* Type define for an Audio class
-
specific Feature Unit descriptor. This indicates to the host what features
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
* specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
UnitID
;
/**< ID value of this feature unit - must be a unique value within the device */
uint8_t
SourceID
;
/**< Source ID value of the audio source input into this feature unit */
uint8_t
UnitID
;
/**< ID value of this feature unit - must be a unique value within the device
.
*/
uint8_t
SourceID
;
/**< Source ID value of the audio source input into this feature unit
.
*/
uint8_t
ControlSize
;
/**< Size of each element in the ChanelControlls array */
uint8_t
ChannelControls
[
3
];
/**< Feature masks for the control channel, and each separate audio channel */
uint8_t
ControlSize
;
/**< Size of each element in the ChanelControlls array
.
*/
uint8_t
ChannelControls
[
3
];
/**< Feature masks for the control channel, and each separate audio channel
.
*/
uint8_t
FeatureUnitStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device */
uint8_t
FeatureUnitStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device
.
*/
}
USB_Audio_FeatureUnit_t
;
/** \brief Audio
Class S
pecific Input Terminal Descriptor.
/** \brief Audio
class-s
pecific Input Terminal Descriptor.
*
* Type define for an Audio class
specific input terminal descriptor. This indicates to the host that the device
* Type define for an Audio class
-
specific input terminal descriptor. This indicates to the host that the device
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
TerminalID
;
/**< ID value of this terminal unit - must be a unique value within the device */
uint16_t
TerminalType
;
/**< Type of terminal, a TERMINAL_* mask */
uint8_t
TerminalID
;
/**< ID value of this terminal unit - must be a unique value within the device
.
*/
uint16_t
TerminalType
;
/**< Type of terminal, a TERMINAL_* mask
.
*/
uint8_t
AssociatedOutputTerminal
;
/**< ID of associated output terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset
* such as the speaker and microphone of a phone handset
.
*/
uint8_t
TotalChannels
;
/**< Total number of separate audio channels within this interface (right, left, etc.) */
uint16_t
ChannelConfig
;
/**< CHANNEL_* masks indicating what channel layout is supported by this terminal */
uint16_t
ChannelConfig
;
/**< CHANNEL_* masks indicating what channel layout is supported by this terminal
.
*/
uint8_t
ChannelStrIndex
;
/**< Index of a string descriptor describing this channel within the device */
uint8_t
TerminalStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device */
uint8_t
ChannelStrIndex
;
/**< Index of a string descriptor describing this channel within the device
.
*/
uint8_t
TerminalStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device
.
*/
}
USB_Audio_InputTerminal_t
;
/** \brief Audio
Class S
pecific Output Terminal Descriptor.
/** \brief Audio
class-s
pecific Output Terminal Descriptor.
*
* Type define for an Audio class
specific output terminal descriptor. This indicates to the host that the device
* Type define for an Audio class
-
specific output terminal descriptor. This indicates to the host that the device
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
* a USB endpoint). See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
TerminalID
;
/**< ID value of this terminal unit - must be a unique value within the device */
uint16_t
TerminalType
;
/**< Type of terminal, a TERMINAL_* mask */
uint8_t
TerminalID
;
/**< ID value of this terminal unit - must be a unique value within the device
.
*/
uint16_t
TerminalType
;
/**< Type of terminal, a TERMINAL_* mask
.
*/
uint8_t
AssociatedInputTerminal
;
/**< ID of associated input terminal, for physically grouped terminals
* such as the speaker and microphone of a phone handset
* such as the speaker and microphone of a phone handset
.
*/
uint8_t
SourceID
;
/**< ID value of the unit this terminal's audio is sourced from */
uint8_t
SourceID
;
/**< ID value of the unit this terminal's audio is sourced from
.
*/
uint8_t
TerminalStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device */
uint8_t
TerminalStrIndex
;
/**< Index of a string descriptor describing this descriptor within the device
.
*/
}
USB_Audio_OutputTerminal_t
;
/** \brief Audio
Class S
pecific Streaming Audio Interface Descriptor.
/** \brief Audio
class-s
pecific Streaming Audio Interface Descriptor.
*
* Type define for an Audio class
specific streaming interface descriptor. This indicates to the host
* Type define for an Audio class
-
specific streaming interface descriptor. This indicates to the host
* how audio streams within the device are formatted. See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
TerminalLink
;
/**< ID value of the output terminal this descriptor is describing */
uint8_t
TerminalLink
;
/**< ID value of the output terminal this descriptor is describing
.
*/
uint8_t
FrameDelay
;
/**< Delay in frames resulting from the complete sample processing from input to output */
uint16_t
AudioFormat
;
/**< Format of the audio stream, see Audio Device Formats specification */
uint8_t
FrameDelay
;
/**< Delay in frames resulting from the complete sample processing from input to output
.
*/
uint16_t
AudioFormat
;
/**< Format of the audio stream, see Audio Device Formats specification
.
*/
}
USB_Audio_Interface_AS_t
;
/** \brief 24-Bit Audio Frequency Structure.
*
* Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
* this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
* this this structure is used to build up the value instead. Fill this structure with the
\ref AUDIO_
SAMPLE_FREQ() macro.
*/
typedef
struct
{
uint16_t
LowWord
;
/**< Low 16 bits of the 24-bit value */
uint8_t
HighByte
;
/**< Upper 8 bits of the 24-bit value */
uint16_t
LowWord
;
/**< Low 16 bits of the 24-bit value
.
*/
uint8_t
HighByte
;
/**< Upper 8 bits of the 24-bit value
.
*/
}
USB_Audio_SampleFreq_t
;
/** \brief Audio
Class S
pecific Format Descriptor.
/** \brief Audio
class-s
pecific Format Descriptor.
*
* Type define for an Audio class
specific audio format descriptor. This is used to give the host full details
* Type define for an Audio class
-
specific audio format descriptor. This is used to give the host full details
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
* in the device's audio streams. See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
FormatType
;
/**< Format of the audio stream, see Audio Device Formats specification */
uint8_t
Channels
;
/**< Total number of discrete channels in the stream */
uint8_t
FormatType
;
/**< Format of the audio stream, see Audio Device Formats specification
.
*/
uint8_t
Channels
;
/**< Total number of discrete channels in the stream
.
*/
uint8_t
SubFrameSize
;
/**< Size in bytes of each channel's sample data in the stream */
uint8_t
BitResolution
;
/**< Bits of resolution of each channel's samples in the stream */
uint8_t
SubFrameSize
;
/**< Size in bytes of each channel's sample data in the stream
.
*/
uint8_t
BitResolution
;
/**< Bits of resolution of each channel's samples in the stream
.
*/
uint8_t
SampleFrequencyType
;
/**< Total number of sample frequencies supported by the device */
USB_Audio_SampleFreq_t
SampleFrequencies
[
AUDIO_TOTAL_SAMPLE_RATES
];
/**< Sample frequencies supported by the device */
uint8_t
SampleFrequencyType
;
/**< Total number of sample frequencies supported by the device
.
*/
USB_Audio_SampleFreq_t
SampleFrequencies
[
AUDIO_TOTAL_SAMPLE_RATES
];
/**< Sample frequencies supported by the device
.
*/
}
USB_Audio_Format_t
;
/** \brief Audio
Class S
pecific Streaming Endpoint Descriptor.
/** \brief Audio
class-s
pecific Streaming Endpoint Descriptor.
*
* Type define for an Audio class
specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class
specific extensions. See the USB Audio specification for more details.
* Type define for an Audio class
-
specific endpoint descriptor. This contains a regular endpoint
* descriptor with a few Audio-class
-
specific extensions. See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Endpoint_t
Endpoint
;
/**< Standard endpoint descriptor describing the audio endpoint */
USB_Descriptor_Endpoint_t
Endpoint
;
/**< Standard endpoint descriptor describing the audio endpoint
.
*/
uint8_t
Refresh
;
/**< Always set to zero */
uint8_t
SyncEndpointNumber
;
/**< Endpoint address to send synchronization information to, if needed (zero otherwise) */
uint8_t
Refresh
;
/**< Always set to zero
for Audio class devices.
*/
uint8_t
SyncEndpointNumber
;
/**< Endpoint address to send synchronization information to, if needed (zero otherwise)
.
*/
}
USB_Audio_StreamEndpoint_Std_t
;
/** \brief Audio
Class S
pecific Extended Endpoint Descriptor.
/** \brief Audio
class-s
pecific Extended Endpoint Descriptor.
*
* Type define for an Audio class
specific extended endpoint descriptor. This contains extra information
* Type define for an Audio class
-
specific extended endpoint descriptor. This contains extra information
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
* class
specific extended endpoint descriptor. See the USB Audio specification for more details.
* class
-
specific extended endpoint descriptor. See the USB Audio specification for more details.
*/
typedef
struct
{
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length */
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
specific descriptors
*/
USB_Descriptor_Header_t
Header
;
/**< Regular descriptor header containing the descriptor's type and length
.
*/
uint8_t
Subtype
;
/**< Sub type value used to distinguish between audio class
-specific descriptors.
*/
uint8_t
Attributes
;
/**< Audio class
specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS
*/
uint8_t
Attributes
;
/**< Audio class
-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS.
*/
uint8_t
LockDelayUnits
;
/**< Units used for the LockDelay field, see Audio class specification */
uint16_t
LockDelay
;
/**< Time required to internally lock endpoint's internal clock recovery circuitry */