- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software without specific, written prior permission.
The author disclaim all warranties with regard to this
* Main source file for the GenericHIDHost demo. This file contains the main tasks of
* the demo and is responsible for the initial application hardware configuration.
*/
* Main source file for the GenericHIDHost demo. This file contains the main tasks of
* the demo and is responsible for the initial application hardware configuration.
*/
#include "GenericHIDHost.h"
/** Main program entry point. This routine configures the hardware required by the application, then
#include "GenericHIDHost.h"
/** Main program entry point. This routine configures the hardware required by the application, then
/* Read in HID report data */
Pipe_Read_Stream_LE(&ReportINData, sizeof(ReportINData));
/* Read in HID report data */
Pipe_Read_Stream_LE(&ReportINData, sizeof(ReportINData));
/* Print report data through the serial port */
for (uint16_t CurrByte = 0; CurrByte < sizeof(ReportINData); CurrByte++)
printf_P(PSTR("0x%02X "), ReportINData[CurrByte]);
/* Print report data through the serial port */
for (uint16_t CurrByte = 0; CurrByte < sizeof(ReportINData); CurrByte++)
printf_P(PSTR("0x%02X "), ReportINData[CurrByte]);
/* Not all HID devices have an OUT endpoint (some require OUT reports to be sent over the
* control endpoint instead) - check to see if the OUT endpoint has been initialized */
if (Pipe_IsConfigured() && (ReportType == REPORT_TYPE_OUT))
/* Not all HID devices have an OUT endpoint (some require OUT reports to be sent over the
* control endpoint instead) - check to see if the OUT endpoint has been initialized */
if (Pipe_IsConfigured() && (ReportType == REPORT_TYPE_OUT))
/* If the report index is used, send it before the report data */
if (ReportIndex)
Pipe_Write_Byte(ReportIndex);
/* Write out HID report data */
/* If the report index is used, send it before the report data */
if (ReportIndex)
Pipe_Write_Byte(ReportIndex);
/* Write out HID report data */
/* Get and process the configuration descriptor data */
if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
{
/* Get and process the configuration descriptor data */
if ((ErrorCode = ProcessConfigurationDescriptor()) != SuccessfulConfigRead)
{
puts_P(PSTR(ESC_FG_RED "Invalid Device.\r\n"));
printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
puts_P(PSTR(ESC_FG_RED "Invalid Device.\r\n"));
printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);