Commit f1076ac4 authored by Dean Camera's avatar Dean Camera

Added const modifiers to device mode class drivers.

Added parameter directions to function parameter documentation.

Added new experimental FAST_STREAM_FUNCTIONS compile time option to speed up stream transfers at the expense of a higher FLASH consumption (needs testing to verify improved throughput).
parent 3cbdcd36
......@@ -206,7 +206,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** Reads or writes a block of EEPROM or FLASH memory to or from the appropriate CDC data endpoint, depending
* on the AVR910 protocol command issued.
*
* \param Command Single character AVR910 protocol command indicating what memory operation to perform
* \param[in] Command Single character AVR910 protocol command indicating what memory operation to perform
*/
static void ReadWriteMemoryBlock(const uint8_t Command)
{
......@@ -343,7 +343,7 @@ static uint8_t FetchNextCommandByte(void)
/** Writes the next response byte to the CDC data IN endpoint, and sends the endpoint back if needed to free up the
* bank when full ready for the next byte in the packet to the host.
*
* \param Response Next response byte to send to the host
* \param[in] Response Next response byte to send to the host
*/
static void WriteNextResponseByte(const uint8_t Response)
{
......
......@@ -84,7 +84,7 @@
* type define so that the same macro can be used for functional descriptors of varying data lengths,
* while allowing the sizeof() operator to return correct results.
*
* \param DataSize Size of the functional descriptor's data payload, in bytes
* \param[in] DataSize Size of the functional descriptor's data payload, in bytes
*/
#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
struct \
......
......@@ -454,7 +454,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** Routine to discard the specified number of bytes from the control endpoint stream. This is used to
* discard unused bytes in the stream from the host, including the memory program block suffix.
*
* \param NumberOfBytes Number of bytes to discard from the host from the control endpoint
* \param[in] NumberOfBytes Number of bytes to discard from the host from the control endpoint
*/
static void DiscardFillerBytes(uint8_t NumberOfBytes)
{
......
......@@ -76,16 +76,16 @@
/** Convenience macro, used to determine if the issued command is the given one-byte long command.
*
* \param dataarr Command byte array to check against
* \param cb1 First command byte to check
* \param[in] dataarr Command byte array to check against
* \param[in] cb1 First command byte to check
*/
#define IS_ONEBYTE_COMMAND(dataarr, cb1) (dataarr[0] == cb1)
/** Convenience macro, used to determine if the issued command is the given two-byte long command.
*
* \param dataarr Command byte array to check against
* \param cb1 First command byte to check
* \param cb2 Second command byte to check
* \param[in] dataarr Command byte array to check against
* \param[in] cb1 First command byte to check
* \param[in] cb2 Second command byte to check
*/
#define IS_TWOBYTE_COMMAND(dataarr, cb1, cb2) ((dataarr[0] == cb1) && (dataarr[1] == cb2))
......
......@@ -131,13 +131,13 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** HID class driver callback function for the creation of HID reports to the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param ReportData Pointer to a buffer where the created report should be stored
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[out] ReportData Pointer to a buffer where the created report should be stored
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, void* ReportData)
{
// Create generic HID report here
......@@ -146,13 +146,13 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInte
/** HID class driver callback function for the processing of HID reports from the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID of the received report from the host
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize)
{
// Process received generic HID report here
}
......@@ -72,9 +72,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize);
#endif
......@@ -133,13 +133,13 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** HID class driver callback function for the creation of HID reports to the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param ReportData Pointer to a buffer where the created report should be stored
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[out] ReportData Pointer to a buffer where the created report should be stored
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, void* ReportData)
{
USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;
......@@ -167,13 +167,13 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInte
/** HID class driver callback function for the processing of HID reports from the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID of the received report from the host
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize)
{
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
}
......@@ -83,9 +83,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize);
#endif
......@@ -134,13 +134,13 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** HID class driver callback function for the creation of HID reports to the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param ReportData Pointer to a buffer where the created report should be stored
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[out] ReportData Pointer to a buffer where the created report should be stored
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, void* ReportData)
{
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
......@@ -168,13 +168,13 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInte
/** HID class driver callback function for the processing of HID reports from the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID of the received report from the host
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize)
{
uint8_t LEDMask = LEDS_NO_LEDS;
uint8_t* LEDReport = (uint8_t*)ReportData;
......
......@@ -86,9 +86,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize);
#endif
......@@ -165,13 +165,13 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** HID class driver callback function for the creation of HID reports to the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param ReportData Pointer to a buffer where the created report should be stored
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[out] ReportData Pointer to a buffer where the created report should be stored
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, void* ReportData)
{
uint8_t JoyStatus_LCL = Joystick_GetStatus();
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
......@@ -226,13 +226,13 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInte
/** HID class driver callback function for the processing of HID reports from the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID of the received report from the host
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize)
{
if (HIDInterfaceInfo == &Keyboard_HID_Interface)
{
......
......@@ -90,9 +90,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize);
#endif
......@@ -43,9 +43,9 @@
* the pre-selected data OUT endpoint. This routine reads in OS sized blocks from the endpoint and writes
* them to the dataflash in Dataflash page sized blocks.
*
* \param MSInterfaceInfo Pointer to a Mass Storage class state structure for the Mass Storage interface being used
* \param BlockAddress Data block starting address for the write sequence
* \param TotalBlocks Number of blocks of data to write
* \param[in] MSInterfaceInfo Pointer to a Mass Storage class state structure for the Mass Storage interface being used
* \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write
*/
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
......@@ -169,9 +169,9 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co
* the pre-selected data IN endpoint. This routine reads in Dataflash page sized blocks from the Dataflash
* and writes them in OS sized blocks to the endpoint.
*
* \param MSInterfaceInfo Pointer to a Mass Storage class state structure for the Mass Storage interface being used
* \param BlockAddress Data block starting address for the read sequence
* \param TotalBlocks Number of blocks of data to read
* \param[in] MSInterfaceInfo Pointer to a Mass Storage class state structure for the Mass Storage interface being used
* \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read
*/
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
......@@ -273,9 +273,9 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, con
* dataflash in Dataflash page sized blocks. This can be linked to FAT libraries to write files to the
* dataflash.
*
* \param BlockAddress Data block starting address for the write sequence
* \param TotalBlocks Number of blocks of data to write
* \param BufferPtr Pointer to the data source RAM buffer
* \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write
* \param[in] BufferPtr Pointer to the data source RAM buffer
*/
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
{
......@@ -365,9 +365,9 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
* and writes them in OS sized blocks to the given buffer. This can be linked to FAT libraries to read
* the files stored on the dataflash.
*
* \param BlockAddress Data block starting address for the read sequence
* \param TotalBlocks Number of blocks of data to read
* \param BufferPtr Pointer to the data destination RAM buffer
* \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read
* \param[out] BufferPtr Pointer to the data destination RAM buffer
*/
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
{
......
......@@ -84,7 +84,7 @@ SCSI_Request_Sense_Response_t SenseData =
* to the appropriate SCSI command handling routine if the issued command is supported by the device, else it returns
* a command failure due to a ILLEGAL REQUEST.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
{
......@@ -142,7 +142,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
/** Command processing for an issued SCSI INQUIRY command. This command returns information about the device's features
* and capabilities to the host.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*
* \return Boolean true if the command completed successfully, false otherwise.
*/
......@@ -184,7 +184,7 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
/** Command processing for an issued SCSI REQUEST SENSE command. This command returns information about the last issued command,
* including the error code and additional error information so that the host can determine why a command failed to complete.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*
* \return Boolean true if the command completed successfully, false otherwise.
*/
......@@ -208,7 +208,7 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf
/** Command processing for an issued SCSI READ CAPACITY (10) command. This command returns information about the device's capacity
* on the selected Logical Unit (drive), as a number of OS-sized blocks.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*
* \return Boolean true if the command completed successfully, false otherwise.
*/
......@@ -231,7 +231,7 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface
* board, and indicates if they are present and functioning correctly. Only the Self-Test portion of the diagnostic command is
* supported.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*
* \return Boolean true if the command completed successfully, false otherwise.
*/
......@@ -296,8 +296,8 @@ static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
* and total number of blocks to process, then calls the appropriate low-level dataflash routine to handle the actual
* reading and writing of the data.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
*
* \return Boolean true if the command completed successfully, false otherwise.
*/
......
......@@ -53,9 +53,9 @@
* is for convenience, as it allows for all three sense values (returned upon request to the host to give information about
* the last command failure) in a quick and easy manner.
*
* \param key New SCSI sense key to set the sense code to
* \param acode New SCSI additional sense key to set the additional sense code to
* \param aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to
* \param[in] key New SCSI sense key to set the sense code to
* \param[in] acode New SCSI additional sense key to set the additional sense code to
* \param[in] aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to
*/
#define SCSI_SET_SENSE(key, acode, aqual) MACROS{ SenseData.SenseKey = key; \
SenseData.AdditionalSenseCode = acode; \
......
......@@ -125,7 +125,7 @@ void EVENT_USB_UnhandledControlPacket(void)
/** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced
*/
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
{
......
......@@ -133,13 +133,13 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** HID class driver callback function for the creation of HID reports to the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param ReportData Pointer to a buffer where the created report should be stored
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
* \param[out] ReportData Pointer to a buffer where the created report should be stored
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID, void* ReportData)
{
USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
......@@ -167,13 +167,13 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInte
/** HID class driver callback function for the processing of HID reports from the host.
*
* \param HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param ReportID Report ID of the received report from the host
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize)
{
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
}
......@@ -85,9 +85,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
const void* ReportData, const uint16_t ReportSize);
#endif
......@@ -47,7 +47,7 @@
* a single typedef struct. A macro is used instead so that functional descriptors can be created
* easily by specifying the size of the payload. This allows sizeof() to work correctly.
*
* \param DataSize Size in bytes of the CDC functional descriptor's data payload
* \param[in] DataSize Size in bytes of the CDC functional descriptor's data payload
*/
#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
struct \
......
......@@ -41,8 +41,8 @@
* to the output Ethernet frame if the host is requesting the IP or MAC address of the
* virtual server device on the network.
*
* \param InDataStart Pointer to the start of the incoming packet's ARP header
* \param OutDataStart Pointer to the start of the outgoing packet's ARP header
* \param[in] InDataStart Pointer to the start of the incoming packet's ARP header
* \param[out] OutDataStart Pointer to the start of the outgoing packet's ARP header
*
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
*/
......
......@@ -40,9 +40,9 @@
/** Processes a DHCP packet inside an Ethernet frame, and writes the appropriate response
* to the output Ethernet frame if the host is requesting or accepting an IP address.
*
* \param IPHeaderInStart Pointer to the start of the incoming packet's IP header
* \param DHCPHeaderInStart Pointer to the start of the incoming packet's DHCP header
* \param DHCPHeaderOutStart Pointer to the start of the outgoing packet's DHCP header
* \param[in] IPHeaderInStart Pointer to the start of the incoming packet's IP header
* \param[in] DHCPHeaderInStart Pointer to the start of the incoming packet's DHCP header
* \param[out] DHCPHeaderOutStart Pointer to the start of the outgoing packet's DHCP header
*
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
*/
......
......@@ -110,8 +110,8 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_
/** Calculates the appropriate ethernet checksum, consisting of the addition of the one's
* compliment of each word, complimented.
*
* \param Data Pointer to the packet buffer data whose checksum must be calculated
* \param Bytes Number of bytes in the data buffer to process
* \param[in] Data Pointer to the packet buffer data whose checksum must be calculated
* \param[in] Bytes Number of bytes in the data buffer to process
*
* \return A 16-bit Ethernet checksum value
*/
......
......@@ -63,8 +63,8 @@
/** Performs a comparison between two MAC addresses, indicating if they are identical.
*
* \param MAC1 First MAC address
* \param MAC2 Second MAC address
* \param[in] MAC1 First MAC address
* \param[in] MAC2 Second MAC address
*
* \return True if the addresses match, false otherwise
*/
......
......@@ -40,9 +40,9 @@
/** Processes an ICMP packet inside an Ethernet frame, and writes the appropriate response
* to the output Ethernet frame if the host is issuing a ICMP ECHO request.
*
* \param FrameIN Pointer to the incomming Ethernet frame information structure
* \param InDataStart Pointer to the start of the incoming packet's ICMP header
* \param OutDataStart Pointer to the start of the outgoing packet's ICMP header
* \param[in] FrameIN Pointer to the incomming Ethernet frame information structure
* \param[in] InDataStart Pointer to the start of the incoming packet's ICMP header
* \param[out] OutDataStart Pointer to the start of the outgoing packet's ICMP header
*
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
*/
......
......@@ -39,9 +39,9 @@
/** Processes an IP packet inside an Ethernet frame, and writes the appropriate response
* to the output Ethernet frame if one is created by a subprotocol handler.
*
* \param FrameIN Pointer to the incomming Ethernet frame information structure
* \param InDataStart Pointer to the start of the incoming packet's IP header
* \param OutDataStart Pointer to the start of the outgoing packet's IP header
* \param[in] FrameIN Pointer to the incomming Ethernet frame information structure
* \param[in] InDataStart Pointer to the start of the incoming packet's IP header
* \param[out] OutDataStart Pointer to the start of the outgoing packet's IP header
*
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no
* response was generated, NO_PROCESS if the packet processing was deferred until the
......
......@@ -59,8 +59,8 @@
/** Performs a comparison between two IP addresses, indicating if they are identical.
*
* \param IP1 First IP address
* \param IP2 Second IP address
* \param[in] IP1 First IP address
* \param[in] IP2 Second IP address
*
* \return True if the addresses match, false otherwise
*/
......
......@@ -51,7 +51,7 @@
/** Decodes an Ethernet frame header and prints its contents to through the USART in a human readable format.
*
* \param InDataStart Pointer to the start of an Ethernet frame header
* \param[in] InDataStart Pointer to the start of an Ethernet frame header
*/
void DecodeEthernetFrameHeader(void* InDataStart)
{
......@@ -93,7 +93,7 @@ void DecodeEthernetFrameHeader(void* InDataStart)
/** Decodes an ARP header and prints its contents to through the USART in a human readable format.
*
* \param InDataStart Pointer to the start of an ARP packet header
* \param[in] InDataStart Pointer to the start of an ARP packet header
*/
void DecodeARPHeader(void* InDataStart)
{
......@@ -143,7 +143,7 @@ void DecodeARPHeader(void* InDataStart)
/** Decodes an IP header and prints its contents to through the USART in a human readable format.
*
* \param InDataStart Pointer to the start of an IP packet header
* \param[in] InDataStart Pointer to the start of an IP packet header
*/
void DecodeIPHeader(void* InDataStart)
{
......@@ -181,7 +181,7 @@ void DecodeIPHeader(void* InDataStart)