Fix up references to functions in the Endpoint/Pipe documentation.
\r
/** Event for USB device attachment. This event fires when a the USB interface is in host mode, and\r
* a USB device has been connected to the USB interface. This is interrupt driven, thus fires before\r
- * the standard \ref EVENT_USB_Device_Connect event and so can be used to programmatically start the USB\r
+ * the standard \ref EVENT_USB_Device_Connect() event and so can be used to programmatically start the USB\r
* management task to reduce CPU consumption.\r
*\r
* \note This event only exists on USB AVR models which supports host mode.\r
*/\r
uint8_t Endpoint_Write_Stream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Write_Stream_LE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Write_Stream_LE().\r
*\r
* \ingroup Group_EndpointStreamRW\r
*\r
*/\r
uint8_t Endpoint_Write_EStream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Endpoint_Write_Stream_LE.\r
+ /** FLASH buffer source version of \ref Endpoint_Write_Stream_LE().\r
*\r
* \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
*\r
*/\r
uint8_t Endpoint_Write_Stream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Write_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Write_Stream_BE().\r
*\r
* \ingroup Group_EndpointStreamRW\r
*\r
*/\r
uint8_t Endpoint_Write_EStream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Endpoint_Write_Stream_BE.\r
+ /** FLASH buffer source version of \ref Endpoint_Write_Stream_BE().\r
*\r
* \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
*\r
*/\r
uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Read_Stream_LE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Read_Stream_LE().\r
*\r
* \ingroup Group_EndpointStreamRW\r
*\r
*/\r
uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Read_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Read_Stream_BE().\r
*\r
* \ingroup Group_EndpointStreamRW\r
*\r
*/\r
uint8_t Endpoint_Write_Control_EStream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_LE.\r
+ /** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_LE().\r
*\r
* \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
* to clear the status stage when using this routine in a control transaction.\r
*/\r
uint8_t Endpoint_Write_Control_Stream_BE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Write_Control_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Write_Control_Stream_BE().\r
*\r
* \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
* to clear the status stage when using this routine in a control transaction.\r
*/\r
uint8_t Endpoint_Write_Control_EStream_BE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_BE.\r
+ /** FLASH buffer source version of \ref Endpoint_Write_Control_Stream_BE().\r
*\r
* \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
* to clear the status stage when using this routine in a control transaction.\r
*/\r
uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_LE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_LE().\r
*\r
* \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
* to clear the status stage when using this routine in a control transaction.\r
*/\r
uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); \r
\r
- /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Endpoint_Read_Control_Stream_BE().\r
*\r
* \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
* to clear the status stage when using this routine in a control transaction.\r
*/\r
uint8_t Pipe_Write_Stream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1); \r
\r
- /** EEPROM buffer source version of \ref Pipe_Write_Stream_LE.\r
+ /** EEPROM buffer source version of \ref Pipe_Write_Stream_LE().\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
*/\r
uint8_t Pipe_Write_EStream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Pipe_Write_Stream_LE.\r
+ /** FLASH buffer source version of \ref Pipe_Write_Stream_LE().\r
*\r
* \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
*\r
*/\r
uint8_t Pipe_Write_Stream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Pipe_Write_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Pipe_Write_Stream_BE().\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
*/\r
uint8_t Pipe_Write_EStream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** FLASH buffer source version of \ref Pipe_Write_Stream_BE.\r
+ /** FLASH buffer source version of \ref Pipe_Write_Stream_BE().\r
*\r
* \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
*\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
- * \param[out] Buffer Pointer to the source data buffer to write to.\r
+ * \param[out] Buffer Pointer to the source data buffer to write to.\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
*/\r
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Pipe_Read_Stream_LE.\r
+ /** EEPROM buffer source version of \ref Pipe_Read_Stream_LE().\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
- * \param[out] Buffer Pointer to the source data buffer to write to.\r
+ * \param[out] Buffer Pointer to the source data buffer to write to.\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
- * \param[out] Buffer Pointer to the source data buffer to write to.\r
+ * \param[out] Buffer Pointer to the source data buffer to write to.\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
*/\r
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length _CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** EEPROM buffer source version of \ref Pipe_Read_Stream_BE.\r
+ /** EEPROM buffer source version of \ref Pipe_Read_Stream_BE().\r
*\r
* \ingroup Group_PipeStreamRW\r
*\r
- * \param[out] Buffer Pointer to the source data buffer to write to.\r
+ * \param[out] Buffer Pointer to the source data buffer to write to.\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
#define INCLUDE_FROM_V2PROTOCOL_C\r
#include "V2Protocol.h"\r
\r
+uint32_t CurrentAddress;\r
+\r
+\r
/* Table of masks for SPI_Init() from a given PARAM_SCK_DURATION value */\r
static const uint8_t SPIMaskFromSCKDuration[MAX_SPI_SETTINGS] =\r
{\r
case CMD_GET_PARAMETER:\r
V2Protocol_Command_GetSetParam(V2Command);\r
break;\r
+ case CMD_LOAD_ADDRESS:\r
+ V2Protocol_Command_LoadAddress();\r
+ break;\r
case CMD_SPI_MULTI:\r
V2Protocol_Command_SPIMulti();\r
break; \r
Endpoint_WaitUntilReady();\r
\r
V2Protocol_ReconfigureSPI();\r
+ CurrentAddress = 0;\r
\r
Endpoint_Write_Byte(CMD_SIGN_ON);\r
Endpoint_Write_Byte(STATUS_CMD_OK);\r
Endpoint_ClearIN();\r
}\r
\r
+static void V2Protocol_Command_LoadAddress(void)\r
+{\r
+ CurrentAddress = Endpoint_Read_DWord_LE();\r
+\r
+ Endpoint_ClearOUT();\r
+ Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);\r
+ Endpoint_WaitUntilReady();\r
+\r
+ Endpoint_Write_Byte(CMD_LOAD_ADDRESS);\r
+ Endpoint_Write_Byte(STATUS_CMD_OK);\r
+ Endpoint_ClearIN();\r
+}\r
+\r
static void V2Protocol_Command_SPIMulti(void)\r
{\r
uint8_t TxBytes = Endpoint_Read_Byte();\r
static void V2Protocol_Command_Unknown(uint8_t V2Command);\r
static void V2Protocol_Command_SignOn(void);\r
static void V2Protocol_Command_GetSetParam(uint8_t V2Command);\r
+ static void V2Protocol_Command_LoadAddress(void);\r
static void V2Protocol_Command_SPIMulti(void);\r
#endif