@ -89,7 +89,7 @@
* should have one single bank , which requires less USB FIFO memory but results in slower transfers as
* only one USB device ( the AVR or the attached device ) can access the pipe ' s bank at the one time .
*/
# define PIPE_BANK_SINGLE 0
# define PIPE_BANK_SINGLE (0 << EPBK0)
/** Mask for the bank mode selection for the Pipe_ConfigurePipe() macro. This indicates that the pipe
* should have two banks , which requires more USB FIFO memory but results in faster transfers as one
@ -143,8 +143,8 @@
* elapsed and the pipe is ready for the next packet from the attached device to be read out from its
* FIFO buffer ( if received ) .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*/
@ -157,10 +157,11 @@
* has elapsed and the pipe is ready for a packet to be written to the pipe ' s FIFO buffer and sent
* to the attached device ( if required ) .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector . */
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*/
# define PIPE_INT_OUT UPIENX, (1 << TXOUTE), UPINTX, (1 << TXOUTI)
/** Interrupt definition for the pipe SETUP bank ready interrupt (for CONTROL type pipes). Should be
@ -169,8 +170,8 @@
* This interrupt will fire if enabled on an CONTROL type pipe when the pipe is ready for a new
* control request .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*/
@ -182,8 +183,8 @@
* This interrupt will fire if enabled on a particular pipe if an error occurs on that pipe , such
* as a CRC mismatch error .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*
@ -197,8 +198,8 @@
* This interrupt will fire if enabled on a particular pipe if an attached device returns a NAK in
* response to a sent packet .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*
@ -212,8 +213,8 @@
* This interrupt will fire if enabled on a particular pipe if an attached device returns a STALL on the
* currently selected pipe . This will also fire if the pipe is an isochronous pipe and a CRC error occurs .
*
* This interrupt must be enabl ed on * each * pipe which requires it ( after the pipe is selected ) , and
* will fire the common pipe interrupt vector .
* \ note This interrupt must be enabl ed and clear ed on * each * pipe which requires it ( after the pipe
* is selected ) , and will fire the common pipe interrupt vector .
*
* \ see ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector .
*/
@ -401,19 +402,21 @@
/* Inline Functions: */
/** Reads one byte from the currently selected pipe's bank, for OUT direction pipes. */
static inline uint8_t Pipe_Read_Byte ( void ) ATTR_WARN_UNUSED_RESULT ;
static inline uint8_t Pipe_Read_Byte ( void ) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE ;
static inline uint8_t Pipe_Read_Byte ( void )
{
return UPDATX ;
}
/** Writes one byte from the currently selected pipe's bank, for IN direction pipes. */
static inline void Pipe_Write_Byte ( const uint8_t Byte ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Write_Byte ( const uint8_t Byte )
{
UPDATX = Byte ;
}
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes. */
static inline void Pipe_Discard_Byte ( void ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Discard_Byte ( void )
{
uint8_t Dummy ;
@ -424,7 +427,7 @@
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
* direction pipes .
*/
static inline uint16_t Pipe_Read_Word_LE ( void ) ATTR_WARN_UNUSED_RESULT ;
static inline uint16_t Pipe_Read_Word_LE ( void ) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE ;
static inline uint16_t Pipe_Read_Word_LE ( void )
{
uint16_t Data ;
@ -438,7 +441,7 @@
/** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT
* direction pipes .
*/
static inline uint16_t Pipe_Read_Word_BE ( void ) ATTR_WARN_UNUSED_RESULT ;
static inline uint16_t Pipe_Read_Word_BE ( void ) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE ;
static inline uint16_t Pipe_Read_Word_BE ( void )
{
uint16_t Data ;
@ -452,6 +455,7 @@
/** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
* direction pipes .
*/
static inline void Pipe_Write_Word_LE ( const uint16_t Word ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Write_Word_LE ( const uint16_t Word )
{
UPDATX = ( Word & 0xFF ) ;
@ -461,6 +465,7 @@
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
* direction pipes .
*/
static inline void Pipe_Write_Word_BE ( const uint16_t Word ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Write_Word_BE ( const uint16_t Word )
{
UPDATX = ( Word > > 8 ) ;
@ -468,6 +473,7 @@
}
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes. */
static inline void Pipe_Ignore_Word ( void ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Ignore_Word ( void )
{
uint8_t Dummy ;
@ -479,7 +485,7 @@
/** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
* direction pipes .
*/
static inline uint32_t Pipe_Read_DWord_LE ( void ) ATTR_WARN_UNUSED_RESULT ;
static inline uint32_t Pipe_Read_DWord_LE ( void ) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE ;
static inline uint32_t Pipe_Read_DWord_LE ( void )
{
union
@ -499,7 +505,7 @@
/** Reads four bytes from the currently selected pipe's bank in big endian format, for OUT
* direction pipes .
*/
static inline uint32_t Pipe_Read_DWord_BE ( void ) ATTR_WARN_UNUSED_RESULT ;
static inline uint32_t Pipe_Read_DWord_BE ( void ) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE ;
static inline uint32_t Pipe_Read_DWord_BE ( void )
{
union
@ -519,6 +525,7 @@
/** Writes four bytes to the currently selected pipe's bank in little endian format, for IN
* direction pipes .
*/
static inline void Pipe_Write_DWord_LE ( const uint32_t DWord ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Write_DWord_LE ( const uint32_t DWord )
{
Pipe_Write_Word_LE ( DWord ) ;
@ -528,6 +535,7 @@
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
* direction pipes .
*/
static inline void Pipe_Write_DWord_BE ( const uint32_t DWord ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Write_DWord_BE ( const uint32_t DWord )
{
Pipe_Write_Word_BE ( DWord > > 16 ) ;
@ -535,6 +543,7 @@
}
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes. */
static inline void Pipe_Ignore_DWord ( void ) ATTR_ALWAYS_INLINE ;
static inline void Pipe_Ignore_DWord ( void )
{
uint8_t Dummy ;
@ -761,7 +770,7 @@
void Pipe_ClearPipes ( void ) ;
/* Inline Functions: */
static inline uint8_t Pipe_BytesToEPSizeMask ( uint16_t Bytes ) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS INLINE;
static inline uint8_t Pipe_BytesToEPSizeMask ( uint16_t Bytes ) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS _ INLINE;
static inline uint8_t Pipe_BytesToEPSizeMask ( uint16_t Bytes )
{
if ( Bytes < = 8 )