Renamed all low level Endpoint_Read_*, Endpoint_Write_* and Endpoint_Discard_* functions to use the number of bits instead of a symbolic size (Byte, Word, DWord) so that the function names are applicable and correct across all architectures.
Renamed all low level Pipe_Read_*, Pipe_Write_* and Pipe_Discard_* functions to use the number of bits instead of a symbolic size (Byte, Word, DWord) so that the function names are applicable and correct across all architectures.
This commit is contained in:
parent
2efa79d3ec
commit
899df7d331
46 changed files with 679 additions and 665 deletions
|
|
@ -618,8 +618,8 @@
|
|||
*
|
||||
* \return Next byte in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Endpoint_Read_Byte(void)
|
||||
static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Endpoint_Read_8(void)
|
||||
{
|
||||
return UEDATX;
|
||||
}
|
||||
|
|
@ -628,20 +628,20 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Byte Next byte to write into the the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write into the the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Byte(const uint8_t Byte)
|
||||
static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_8(const uint8_t Data)
|
||||
{
|
||||
UEDATX = Byte;
|
||||
UEDATX = Data;
|
||||
}
|
||||
|
||||
/** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Endpoint_Discard_Byte(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_Byte(void)
|
||||
static inline void Endpoint_Discard_8(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_8(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -653,21 +653,21 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_Word_LE(void)
|
||||
static inline uint16_t Endpoint_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_16_LE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint16_t Word;
|
||||
uint16_t Value;
|
||||
uint8_t Bytes[2];
|
||||
} Data;
|
||||
|
||||
Data.Bytes[0] = UEDATX;
|
||||
Data.Bytes[1] = UEDATX;
|
||||
|
||||
return Data.Word;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Reads two bytes from the currently selected endpoint's bank in big endian format, for OUT
|
||||
|
|
@ -675,21 +675,21 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_Word_BE(void)
|
||||
static inline uint16_t Endpoint_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_16_BE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint16_t Word;
|
||||
uint16_t Value;
|
||||
uint8_t Bytes[2];
|
||||
} Data;
|
||||
|
||||
Data.Bytes[1] = UEDATX;
|
||||
Data.Bytes[0] = UEDATX;
|
||||
|
||||
return Data.Word;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected endpoint's bank in little endian format, for IN
|
||||
|
|
@ -697,13 +697,13 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Word_LE(const uint16_t Word)
|
||||
static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
UEDATX = (Word & 0xFF);
|
||||
UEDATX = (Word >> 8);
|
||||
UEDATX = (Data & 0xFF);
|
||||
UEDATX = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -711,21 +711,21 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Word_BE(const uint16_t Word)
|
||||
static inline void Endpoint_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
UEDATX = (Word >> 8);
|
||||
UEDATX = (Word & 0xFF);
|
||||
UEDATX = (Data >> 8);
|
||||
UEDATX = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Endpoint_Discard_Word(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_Word(void)
|
||||
static inline void Endpoint_Discard_16(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_16(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -738,14 +738,14 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next double word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint32_t Endpoint_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_DWord_LE(void)
|
||||
static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_32_LE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t DWord;
|
||||
uint32_t Value;
|
||||
uint8_t Bytes[4];
|
||||
} Data;
|
||||
|
||||
|
|
@ -754,7 +754,7 @@
|
|||
Data.Bytes[2] = UEDATX;
|
||||
Data.Bytes[3] = UEDATX;
|
||||
|
||||
return Data.DWord;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Reads four bytes from the currently selected endpoint's bank in big endian format, for OUT
|
||||
|
|
@ -762,14 +762,14 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next double word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint32_t Endpoint_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_DWord_BE(void)
|
||||
static inline uint32_t Endpoint_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_32_BE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t DWord;
|
||||
uint32_t Value;
|
||||
uint8_t Bytes[4];
|
||||
} Data;
|
||||
|
||||
|
|
@ -778,7 +778,7 @@
|
|||
Data.Bytes[1] = UEDATX;
|
||||
Data.Bytes[0] = UEDATX;
|
||||
|
||||
return Data.DWord;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected endpoint's bank in little endian format, for IN
|
||||
|
|
@ -786,15 +786,15 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord)
|
||||
static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
UEDATX = (DWord & 0xFF);
|
||||
UEDATX = (DWord >> 8);
|
||||
UEDATX = (DWord >> 16);
|
||||
UEDATX = (DWord >> 24);
|
||||
UEDATX = (Data & 0xFF);
|
||||
UEDATX = (Data >> 8);
|
||||
UEDATX = (Data >> 16);
|
||||
UEDATX = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -802,23 +802,23 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord)
|
||||
static inline void Endpoint_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
UEDATX = (DWord >> 24);
|
||||
UEDATX = (DWord >> 16);
|
||||
UEDATX = (DWord >> 8);
|
||||
UEDATX = (DWord & 0xFF);
|
||||
UEDATX = (Data >> 24);
|
||||
UEDATX = (Data >> 16);
|
||||
UEDATX = (Data >> 8);
|
||||
UEDATX = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Endpoint_Discard_DWord(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_DWord(void)
|
||||
static inline void Endpoint_Discard_32(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_32(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
|
|||
|
|
@ -583,8 +583,8 @@
|
|||
*
|
||||
* \return Next byte in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_Read_Byte(void)
|
||||
static inline uint8_t Pipe_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_Read_8(void)
|
||||
{
|
||||
return UPDATX;
|
||||
}
|
||||
|
|
@ -593,10 +593,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Byte Next byte to write into the the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write into the the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_Byte(const uint8_t Byte)
|
||||
static inline void Pipe_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_8(const uint8_t Data)
|
||||
{
|
||||
UPDATX = Byte;
|
||||
}
|
||||
|
|
@ -605,8 +605,8 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Pipe_Discard_Byte(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_Byte(void)
|
||||
static inline void Pipe_Discard_8(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_8(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -618,21 +618,21 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint16_t Pipe_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Pipe_Read_16_LE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint16_t Word;
|
||||
uint16_t Value;
|
||||
uint8_t Bytes[2];
|
||||
} Data;
|
||||
|
||||
Data.Bytes[0] = UPDATX;
|
||||
Data.Bytes[1] = UPDATX;
|
||||
|
||||
return Data.Word;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT
|
||||
|
|
@ -640,21 +640,21 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint16_t Pipe_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Pipe_Read_16_BE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint16_t Word;
|
||||
uint16_t Value;
|
||||
uint8_t Bytes[2];
|
||||
} Data;
|
||||
|
||||
Data.Bytes[1] = UPDATX;
|
||||
Data.Bytes[0] = UPDATX;
|
||||
|
||||
return Data.Word;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
|
||||
|
|
@ -662,13 +662,13 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
UPDATX = (Word & 0xFF);
|
||||
UPDATX = (Word >> 8);
|
||||
UPDATX = (Data & 0xFF);
|
||||
UPDATX = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -676,21 +676,21 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
UPDATX = (Word >> 8);
|
||||
UPDATX = (Word & 0xFF);
|
||||
UPDATX = (Data >> 8);
|
||||
UPDATX = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Pipe_Discard_Word(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_Word(void)
|
||||
static inline void Pipe_Discard_16(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_16(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -703,14 +703,14 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next double word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint32_t Pipe_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Pipe_Read_32_LE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t DWord;
|
||||
uint32_t Value;
|
||||
uint8_t Bytes[4];
|
||||
} Data;
|
||||
|
||||
|
|
@ -719,7 +719,7 @@
|
|||
Data.Bytes[2] = UPDATX;
|
||||
Data.Bytes[3] = UPDATX;
|
||||
|
||||
return Data.DWord;
|
||||
return Data.Value;
|
||||
}
|
||||
|
||||
/** Reads four bytes from the currently selected pipe's bank in big endian format, for OUT
|
||||
|
|
@ -727,10 +727,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \return Next double word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint32_t Pipe_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Pipe_Read_32_BE(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
|
|
@ -751,15 +751,15 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
UPDATX = (DWord & 0xFF);
|
||||
UPDATX = (DWord >> 8);
|
||||
UPDATX = (DWord >> 16);
|
||||
UPDATX = (DWord >> 24);
|
||||
UPDATX = (Data & 0xFF);
|
||||
UPDATX = (Data >> 8);
|
||||
UPDATX = (Data >> 16);
|
||||
UPDATX = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -767,23 +767,23 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
UPDATX = (DWord >> 24);
|
||||
UPDATX = (DWord >> 16);
|
||||
UPDATX = (DWord >> 8);
|
||||
UPDATX = (DWord & 0xFF);
|
||||
UPDATX = (Data >> 24);
|
||||
UPDATX = (Data >> 16);
|
||||
UPDATX = (Data >> 8);
|
||||
UPDATX = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
*
|
||||
* \ingroup Group_PipePrimitiveRW_AVR8
|
||||
*/
|
||||
static inline void Pipe_Discard_DWord(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_DWord(void)
|
||||
static inline void Pipe_Discard_32(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_32(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ bool USB_RemoteWakeupEnabled;
|
|||
|
||||
void USB_Device_ProcessControlRequest(void)
|
||||
{
|
||||
USB_ControlRequest.bmRequestType = Endpoint_Read_Byte();
|
||||
USB_ControlRequest.bRequest = Endpoint_Read_Byte();
|
||||
USB_ControlRequest.wValue = Endpoint_Read_Word_LE();
|
||||
USB_ControlRequest.wIndex = Endpoint_Read_Word_LE();
|
||||
USB_ControlRequest.wLength = Endpoint_Read_Word_LE();
|
||||
USB_ControlRequest.bmRequestType = Endpoint_Read_8();
|
||||
USB_ControlRequest.bRequest = Endpoint_Read_8();
|
||||
USB_ControlRequest.wValue = Endpoint_Read_16_LE();
|
||||
USB_ControlRequest.wIndex = Endpoint_Read_16_LE();
|
||||
USB_ControlRequest.wLength = Endpoint_Read_16_LE();
|
||||
|
||||
EVENT_USB_Device_ControlRequest();
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ static void USB_Device_GetConfiguration(void)
|
|||
{
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
Endpoint_Write_Byte(USB_ConfigurationNumber);
|
||||
Endpoint_Write_8(USB_ConfigurationNumber);
|
||||
Endpoint_ClearIN();
|
||||
|
||||
Endpoint_ClearStatusStage();
|
||||
|
|
@ -311,7 +311,7 @@ static void USB_Device_GetStatus(void)
|
|||
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
Endpoint_Write_Word_LE(CurrentStatus);
|
||||
Endpoint_Write_16_LE(CurrentStatus);
|
||||
Endpoint_ClearIN();
|
||||
|
||||
Endpoint_ClearStatusStage();
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length,
|
|||
}
|
||||
else
|
||||
{
|
||||
Endpoint_Discard_Byte();
|
||||
Endpoint_Discard_8();
|
||||
|
||||
Length--;
|
||||
BytesInTransfer++;
|
||||
|
|
@ -104,7 +104,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
}
|
||||
else
|
||||
{
|
||||
Endpoint_Write_Byte(0);
|
||||
Endpoint_Write_8(0);
|
||||
|
||||
Length--;
|
||||
BytesInTransfer++;
|
||||
|
|
@ -119,7 +119,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_BE
|
||||
|
|
@ -127,7 +127,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_LE
|
||||
|
|
@ -135,7 +135,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_BE
|
||||
|
|
@ -143,7 +143,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
|
||||
|
|
@ -152,7 +152,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
|
||||
|
|
@ -160,7 +160,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
#endif
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
|
||||
|
|
@ -178,7 +178,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
|
||||
|
|
@ -186,7 +186,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_8())
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
|
||||
|
|
@ -194,7 +194,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_8())
|
||||
#include "Template/Template_Endpoint_RW.c"
|
||||
#endif
|
||||
|
||||
|
|
@ -203,38 +203,38 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_LE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_BE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_LE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
|
||||
#include "Template/Template_Endpoint_Control_R.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_BE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
|
||||
#include "Template/Template_Endpoint_Control_R.c"
|
||||
|
||||
#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_LE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_BE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
#endif
|
||||
|
||||
|
|
@ -242,25 +242,25 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Endpoint_Control_W.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_8())
|
||||
#include "Template/Template_Endpoint_Control_R.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_8())
|
||||
#include "Template/Template_Endpoint_Control_R.c"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
|
|||
|
||||
Pipe_Unfreeze();
|
||||
|
||||
Pipe_Write_Byte(USB_ControlRequest.bmRequestType);
|
||||
Pipe_Write_Byte(USB_ControlRequest.bRequest);
|
||||
Pipe_Write_Word_LE(USB_ControlRequest.wValue);
|
||||
Pipe_Write_Word_LE(USB_ControlRequest.wIndex);
|
||||
Pipe_Write_Word_LE(USB_ControlRequest.wLength);
|
||||
Pipe_Write_8(USB_ControlRequest.bmRequestType);
|
||||
Pipe_Write_8(USB_ControlRequest.bRequest);
|
||||
Pipe_Write_16_LE(USB_ControlRequest.wValue);
|
||||
Pipe_Write_16_LE(USB_ControlRequest.wIndex);
|
||||
Pipe_Write_16_LE(USB_ControlRequest.wLength);
|
||||
|
||||
Pipe_ClearSETUP();
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
|
|||
|
||||
while (Pipe_BytesInPipe() && DataLen)
|
||||
{
|
||||
*(DataStream++) = Pipe_Read_Byte();
|
||||
*(DataStream++) = Pipe_Read_8();
|
||||
DataLen--;
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ uint8_t USB_Host_SendControlRequest(void* const BufferPtr)
|
|||
|
||||
while (DataLen && (Pipe_BytesInPipe() < USB_ControlPipeSize))
|
||||
{
|
||||
Pipe_Write_Byte(*(DataStream++));
|
||||
Pipe_Write_8(*(DataStream++));
|
||||
DataLen--;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
}
|
||||
else
|
||||
{
|
||||
Pipe_Write_Byte(0);
|
||||
Pipe_Write_8(0);
|
||||
|
||||
Length--;
|
||||
BytesInTransfer++;
|
||||
|
|
@ -128,7 +128,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Write_Stream_BE
|
||||
|
|
@ -137,7 +137,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*BufferPtr)
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(*BufferPtr)
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_LE
|
||||
|
|
@ -146,7 +146,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_8()
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_BE
|
||||
|
|
@ -155,7 +155,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_Byte()
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_8()
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
|
||||
|
|
@ -165,7 +165,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Write_PStream_BE
|
||||
|
|
@ -174,7 +174,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(pgm_read_byte(BufferPtr))
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
#endif
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE
|
||||
|
|
@ -194,7 +194,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_8(eeprom_read_byte(BufferPtr))
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE
|
||||
|
|
@ -203,7 +203,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) 0
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_8())
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
|
||||
#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE
|
||||
|
|
@ -212,7 +212,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
|
|||
#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
|
||||
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
|
||||
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
|
||||
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_8())
|
||||
#include "Template/Template_Pipe_RW.c"
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@
|
|||
#define ENDPOINT_DETAILS_EP6 256, 2
|
||||
#endif
|
||||
|
||||
#define ENDPOINT_HSB_ADDRESS_SPACE_SIZE (64 * 1024UL)
|
||||
|
||||
/* Inline Functions: */
|
||||
static inline uint32_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST
|
||||
ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -359,7 +361,7 @@
|
|||
{
|
||||
AVR32_USBB.uerst |= (AVR32_USBB_EPRST0_MASK << EndpointNumber);
|
||||
AVR32_USBB.uerst &= ~(AVR32_USBB_EPRST0_MASK << EndpointNumber);
|
||||
USB_EndpointFIFOPos[EndpointNumber] = &AVR32_USBB_SLAVE[EndpointNumber * 0x10000];
|
||||
USB_EndpointFIFOPos[EndpointNumber] = &AVR32_USBB_SLAVE[EndpointNumber * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Enables the currently selected endpoint so that data can be sent and received through it to
|
||||
|
|
@ -523,7 +525,7 @@
|
|||
static inline void Endpoint_ClearSETUP(void)
|
||||
{
|
||||
(&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].rxstpic = true;
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * 0x10000];
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the
|
||||
|
|
@ -536,7 +538,7 @@
|
|||
{
|
||||
(&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].txinic = true;
|
||||
(&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].fifoconc = true;
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * 0x10000];
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint
|
||||
|
|
@ -549,7 +551,7 @@
|
|||
{
|
||||
(&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].rxoutic = true;
|
||||
(&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].fifoconc = true;
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * 0x10000];
|
||||
USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Stalls the current endpoint, indicating to the host that a logical problem occurred with the
|
||||
|
|
@ -620,34 +622,34 @@
|
|||
|
||||
/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR32
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \return Next byte in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Endpoint_Read_Byte(void)
|
||||
static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Endpoint_Read_8(void)
|
||||
{
|
||||
return *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
}
|
||||
|
||||
/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_AVR32
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Byte Next byte to write into the the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write into the the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Byte(const uint8_t Byte)
|
||||
static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_8(const uint8_t Data)
|
||||
{
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = Byte;
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = Data;
|
||||
}
|
||||
|
||||
/** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Endpoint_Discard_Byte(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_Byte(void)
|
||||
static inline void Endpoint_Discard_8(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_8(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -659,10 +661,10 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \return Next word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_Word_LE(void)
|
||||
static inline uint16_t Endpoint_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_16_LE(void)
|
||||
{
|
||||
uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
|
|
@ -675,10 +677,10 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \return Next word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_Word_BE(void)
|
||||
static inline uint16_t Endpoint_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Endpoint_Read_16_BE(void)
|
||||
{
|
||||
uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
|
|
@ -691,13 +693,13 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Word_LE(const uint16_t Word)
|
||||
static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -705,21 +707,21 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_Word_BE(const uint16_t Word)
|
||||
static inline void Endpoint_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Word >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Endpoint_Discard_Word(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_Word(void)
|
||||
static inline void Endpoint_Discard_16(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_16(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -732,10 +734,10 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \return Next double word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint32_t Endpoint_Read_DWord_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_DWord_LE(void)
|
||||
static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_32_LE(void)
|
||||
{
|
||||
uint32_t Byte3 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
uint32_t Byte2 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
|
|
@ -750,10 +752,10 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \return Next double word in the currently selected endpoint's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline uint32_t Endpoint_Read_DWord_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_DWord_BE(void)
|
||||
static inline uint32_t Endpoint_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Endpoint_Read_32_BE(void)
|
||||
{
|
||||
uint32_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
uint32_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
|
||||
|
|
@ -768,15 +770,15 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord)
|
||||
static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 24);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 16);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 24);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
|
||||
|
|
@ -784,23 +786,23 @@
|
|||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected endpoint's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected endpoint's FIFO buffer.
|
||||
*/
|
||||
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord)
|
||||
static inline void Endpoint_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 16);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (DWord >> 24);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 16);
|
||||
*(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
|
||||
*
|
||||
* \ingroup Group_EndpointPrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Endpoint_Discard_DWord(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_DWord(void)
|
||||
static inline void Endpoint_Discard_32(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Endpoint_Discard_32(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@
|
|||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define PIPE_HSB_ADDRESS_SPACE_SIZE (64 * 1024UL)
|
||||
|
||||
/* External Variables: */
|
||||
extern volatile uint8_t USB_SelectedPipe;
|
||||
extern volatile uint8_t* USB_PipeFIFOPos[];
|
||||
|
|
@ -158,13 +161,6 @@
|
|||
* bank.
|
||||
*/
|
||||
#define PIPE_BANK_DOUBLE AVR32_USBB_UPCFG0_PBK_DOUBLE
|
||||
|
||||
/** Mask for the bank mode selection for the \ref Pipe_ConfigurePipe() macro. This indicates that the pipe
|
||||
* should have three banks, which requires more USB FIFO memory but results in faster transfers as one
|
||||
* USB device (the AVR or the attached device) can access one bank while the other accesses the remaining
|
||||
* banks.
|
||||
*/
|
||||
#define PIPE_BANK_TRIPLE AVR32_USBB_UPCFG0_PBK_TRIPLE
|
||||
//@}
|
||||
|
||||
/** Default size of the default control pipe's bank, until altered by the Endpoint0Size value
|
||||
|
|
@ -251,7 +247,7 @@
|
|||
{
|
||||
AVR32_USBB.uprst |= (AVR32_USBB_PRST0_MASK << PipeNumber);
|
||||
AVR32_USBB.uprst &= ~(AVR32_USBB_PRST0_MASK << PipeNumber);
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * 0x10000];
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Enables the currently selected pipe so that data can be sent and received through it to and from
|
||||
|
|
@ -524,7 +520,7 @@
|
|||
static inline void Pipe_ClearSETUP(void)
|
||||
{
|
||||
(&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].txstpic = true;
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * 0x10000];
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Acknowledges the reception of a setup IN request from the attached device on the currently selected
|
||||
|
|
@ -537,7 +533,7 @@
|
|||
{
|
||||
(&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].rxinic = true;
|
||||
(&AVR32_USBB.UPCON0CLR)[USB_SelectedPipe].fifoconc = true;
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * 0x10000];
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing
|
||||
|
|
@ -550,7 +546,7 @@
|
|||
{
|
||||
(&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].txoutic = true;
|
||||
(&AVR32_USBB.UPCON0CLR)[USB_SelectedPipe].fifoconc = true;
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * 0x10000];
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Determines if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on
|
||||
|
|
@ -602,7 +598,7 @@
|
|||
static inline void Pipe_ClearStall(void)
|
||||
{
|
||||
(&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].rxstalldic = true;
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * 0x10000];
|
||||
USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
|
||||
}
|
||||
|
||||
/** Reads one byte from the currently selected pipe's bank, for OUT direction pipes.
|
||||
|
|
@ -611,8 +607,8 @@
|
|||
*
|
||||
* \return Next byte in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_Read_Byte(void)
|
||||
static inline uint8_t Pipe_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t Pipe_Read_8(void)
|
||||
{
|
||||
return *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
}
|
||||
|
|
@ -621,20 +617,20 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Byte Next byte to write into the the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write into the the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_Byte(const uint8_t Byte)
|
||||
static inline void Pipe_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_8(const uint8_t Data)
|
||||
{
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = Byte;
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = Data;
|
||||
}
|
||||
|
||||
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.
|
||||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Pipe_Discard_Byte(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_Byte(void)
|
||||
static inline void Pipe_Discard_8(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_8(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -646,10 +642,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \return Next word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint16_t Pipe_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Pipe_Read_16_LE(void)
|
||||
{
|
||||
uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
|
|
@ -662,10 +658,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \return Next word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next two bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint16_t Pipe_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t Pipe_Read_16_BE(void)
|
||||
{
|
||||
uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
|
|
@ -678,13 +674,13 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_LE(const uint16_t Data)
|
||||
{
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -692,21 +688,21 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] Word Next word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_16_BE(const uint16_t Data)
|
||||
{
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Word >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
|
||||
}
|
||||
|
||||
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Pipe_Discard_Word(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_Word(void)
|
||||
static inline void Pipe_Discard_16(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_16(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
@ -719,10 +715,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \return Next double word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint32_t Pipe_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Pipe_Read_32_LE(void)
|
||||
{
|
||||
uint32_t Byte3 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
uint32_t Byte2 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
|
|
@ -737,10 +733,10 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \return Next double word in the currently selected pipe's FIFO buffer.
|
||||
* \return Next four bytes in the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline uint32_t Pipe_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||
static inline uint32_t Pipe_Read_32_BE(void)
|
||||
{
|
||||
uint32_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
uint32_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
|
||||
|
|
@ -755,15 +751,15 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_LE(const uint32_t Data)
|
||||
{
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 24);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 16);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 24);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
|
||||
}
|
||||
|
||||
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
|
||||
|
|
@ -771,23 +767,23 @@
|
|||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*
|
||||
* \param[in] DWord Next double word to write to the currently selected pipe's FIFO buffer.
|
||||
* \param[in] Data Data to write to the currently selected pipe's FIFO buffer.
|
||||
*/
|
||||
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)
|
||||
static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Write_32_BE(const uint32_t Data)
|
||||
{
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 16);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (DWord >> 24);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 16);
|
||||
*(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 24);
|
||||
}
|
||||
|
||||
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
|
||||
*
|
||||
* \ingroup Group_PipePrimitiveRW_UC3
|
||||
*/
|
||||
static inline void Pipe_Discard_DWord(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_DWord(void)
|
||||
static inline void Pipe_Discard_32(void) ATTR_ALWAYS_INLINE;
|
||||
static inline void Pipe_Discard_32(void)
|
||||
{
|
||||
uint8_t Dummy;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue