}\r
else if ((Command == 'B') || (Command == 'g'))\r
{\r
- /* Delegate the block write/read to a seperate function for clarity */\r
+ /* Delegate the block write/read to a separate function for clarity */\r
ReadWriteMemoryBlock(Command);\r
}\r
else if (Command == 'R')\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
EndAddr = Address[1].Word;\r
}\r
\r
-/** Handler for a Memory Program command issued by the host. This routine handles the preperations needed\r
+/** Handler for a Memory Program command issued by the host. This routine handles the preparations needed\r
* to write subsequent data from the host into the specified memory.\r
*/\r
static void ProcessMemProgCommand(void)\r
}\r
}\r
\r
-/** Handler for a Memory Read command issued by the host. This routine handles the preperations needed\r
+/** Handler for a Memory Read command issued by the host. This routine handles the preparations needed\r
* to read subsequent data from the specified memory out to the host, as well as implementing the memory\r
* blank check command.\r
*/\r
/** Minor bootloader version number. */\r
#define BOOTLOADER_VERSION_REV 0\r
\r
- /** Complete bootloder version number expressed as a packed byte, constructed from the \r
+ /** Complete bootloader version number expressed as a packed byte, constructed from the \r
* two individual bootloader version macros.\r
*/\r
#define BOOTLOADER_VERSION ((BOOTLOADER_VERSION_MINOR << 4) | BOOTLOADER_VERSION_REV)\r
*/\r
#define DFU_FILLER_BYTES_SIZE 26\r
\r
- /** DFU class command request to detatch from the host. */\r
+ /** DFU class command request to detach from the host. */\r
#define DFU_DETATCH 0x00\r
\r
/** DFU class command request to send data from the host to the bootloader. */\r
/** Type define for a non-returning function pointer to the loaded application. */\r
typedef void (*AppPtr_t)(void) ATTR_NO_RETURN;\r
\r
- /** Type define for a strucuture containing a complete DFU command issued by the host. */\r
+ /** Type define for a structure containing a complete DFU command issued by the host. */\r
typedef struct\r
{\r
uint8_t Command; /**< Single byte command to perform, one of the COMMAND_* macro values */\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
#define DTYPE_DFUFunctional 0x21\r
\r
/** DFU attribute mask, indicating that the DFU device will detach and re-attach when a DFU_DETACH\r
- * command is issued, rather than the host issing a USB Reset.\r
+ * command is issued, rather than the host issuing a USB Reset.\r
*/\r
#define ATTR_WILL_DETATCH (1 << 3)\r
\r
- /** DFU attribute mask, indicating that the DFU device can communicate during the manefestation phase\r
+ /** DFU attribute mask, indicating that the DFU device can communicate during the manifestation phase\r
* (memory programming phase).\r
*/\r
#define ATTR_MANEFESTATION_TOLLERANT (1 << 2)\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit */\r
\r
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array */\r
- uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each seperate audio channel */\r
+ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */\r
\r
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */\r
} USB_AudioFeatureUnit_t;\r
uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals\r
* such as the speaker and microphone of a phone handset\r
*/\r
- uint8_t TotalChannels; /**< Total number of seperate audio channels within this interface (right, left, etc.) */\r
+ uint8_t TotalChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */\r
uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal */\r
\r
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */\r
/* Clear the sample reload timer */\r
TIFR0 |= (1 << OCF0A);\r
\r
- /* Retreive the signed 16-bit left and right audio samples */\r
+ /* Retrieve the signed 16-bit left and right audio samples */\r
int16_t LeftSample_16Bit = (int16_t)Endpoint_Read_Word_LE();\r
int16_t RightSample_16Bit = (int16_t)Endpoint_Read_Word_LE();\r
\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit */\r
\r
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array */\r
- uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each seperate audio channel */\r
+ uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */\r
\r
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */\r
} USB_AudioFeatureUnit_t;\r
uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals\r
* such as the speaker and microphone of a phone handset\r
*/\r
- uint8_t TotalChannels; /**< Total number of seperate audio channels within this interface (right, left, etc.) */\r
+ uint8_t TotalChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */\r
uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal */\r
\r
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */\r
*\r
* These values are set by the host via a class-specific request, however they are not required to be used accurately.\r
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical\r
- * serial link characteristics and instead sends and recieves data in endpoint streams.\r
+ * serial link characteristics and instead sends and receives data in endpoint streams.\r
*/\r
CDC_Line_Coding_t LineCoding = { BaudRateBPS: 9600,\r
CharFormat: OneStopBit,\r
/** String to print through the virtual serial port when the joystick is pressed upwards. */\r
char JoystickUpString[] = "Joystick Up\r\n";\r
\r
-/** String to print through the virtual serial port when the joystick is pressed downwards. */\r
+/** String to print through the virtual serial port when the joystick is pressed downward. */\r
char JoystickDownString[] = "Joystick Down\r\n";\r
\r
/** String to print through the virtual serial port when the joystick is pressed left. */\r
#define CONTROL_LINE_IN_RING (1 << 3)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a framing error has ocurred on the virtual serial port.\r
+ * to indicate that a framing error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_FRAMEERROR (1 << 4)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a parity error has ocurred on the virtual serial port.\r
+ * to indicate that a parity error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_PARITYERROR (1 << 5)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a data overrun error has ocurred on the virtual serial port.\r
+ * to indicate that a data overrun error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)\r
\r
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the\r
* CDCDevice_LineCodingParity_t enum\r
*/\r
- uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */\r
+ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */\r
} CDC_Line_Coding_t;\r
\r
/** Type define for a CDC notification, sent to the host via the CDC notification endpoint to indicate a\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
*\r
* These values are set by the host via a class-specific request, however they are not required to be used accurately.\r
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical\r
- * serial link characteristics and instead sends and recieves data in endpoint streams.\r
+ * serial link characteristics and instead sends and receives data in endpoint streams.\r
*/\r
CDC_Line_Coding_t LineCoding1 = { BaudRateBPS: 9600,\r
CharFormat: OneStopBit,\r
*\r
* These values are set by the host via a class-specific request, however they are not required to be used accurately.\r
* It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical\r
- * serial link characteristics and instead sends and recieves data in endpoint streams.\r
+ * serial link characteristics and instead sends and receives data in endpoint streams.\r
*/\r
CDC_Line_Coding_t LineCoding2 = { BaudRateBPS: 9600,\r
CharFormat: OneStopBit,\r
/** String to print through the first virtual serial port when the joystick is pressed upwards. */\r
char JoystickUpString[] = "Joystick Up\r\n";\r
\r
-/** String to print through the first virtual serial port when the joystick is pressed downwards. */\r
+/** String to print through the first virtual serial port when the joystick is pressed downward. */\r
char JoystickDownString[] = "Joystick Down\r\n";\r
\r
/** String to print through the first virtual serial port when the joystick is pressed left. */\r
Endpoint_ClearCurrentBank();\r
}\r
\r
-/** Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echos back\r
+/** Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echoes back\r
* all data sent to it from the host.\r
*/\r
TASK(CDC2_Task)\r
/* Check to see if any data has been received */\r
if (Endpoint_ReadWriteAllowed())\r
{\r
- /* Create a temp buffer big enough to hold the incomming endpoint packet */\r
+ /* Create a temp buffer big enough to hold the incoming endpoint packet */\r
uint8_t Buffer[Endpoint_BytesInEndpoint()];\r
\r
- /* Remember how large the incomming packet is */\r
+ /* Remember how large the incoming packet is */\r
uint16_t DataLength = Endpoint_BytesInEndpoint();\r
\r
- /* Read in the incomming packet into the buffer */\r
+ /* Read in the incoming packet into the buffer */\r
Endpoint_Read_Stream_LE(&Buffer, DataLength);\r
\r
/* Finalize the stream transfer to send the last packet */\r
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the\r
* CDCDevice_LineCodingParity_t enum\r
*/\r
- uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */\r
+ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */\r
} CDC_Line_Coding_t;\r
\r
/* Enums: */\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
\r
if (Endpoint_ReadWriteAllowed())\r
{\r
- /* Create a tempoary buffer to hold the read in report from the host */\r
+ /* Create a temporary buffer to hold the read in report from the host */\r
uint8_t GenericData[GENERIC_REPORT_SIZE];\r
\r
/* Read Generic Report Data */\r
\r
if (Endpoint_ReadWriteAllowed())\r
{\r
- /* Create a tempoary buffer to hold the report to send to the host */\r
+ /* Create a temporary buffer to hold the report to send to the host */\r
uint8_t GenericData[GENERIC_REPORT_SIZE];\r
\r
/* Create Generic Report Data */\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
uint8_t IdleCount = 0;\r
\r
/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle\r
- * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request \r
+ * milliseconds. This is separate to the IdleCount timer and is incremented and compared as the host may request \r
* the current idle period via a Get Idle HID class request, thus its value must be preserved.\r
*/\r
uint16_t IdleMSRemaining = 0;\r
/* Read in the LED report from the host */\r
uint8_t LEDStatus = Endpoint_Read_Byte();\r
\r
- /* Process the incomming LED report */\r
+ /* Process the incoming LED report */\r
ProcessLEDReport(LEDStatus);\r
\r
/* Clear the endpoint data */\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
} USB_AudioStreamEndpoint_Std_t;\r
\r
/** Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either\r
- * a physical input jack, or a logical jack (recieving input data internally, or from the host via an endpoint).\r
+ * a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint).\r
*/\r
typedef struct\r
{\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */\r
CommandStatusWrapper_t CommandStatus = { Signature: CSW_SIGNATURE };\r
\r
-/** Flag to asyncronously abort any in-progress data transfers upon the reception of a mass storage reset command. */\r
+/** Flag to asynchronously abort any in-progress data transfers upon the reception of a mass storage reset command. */\r
volatile bool IsMassStoreReset = false;\r
\r
/** Main program entry point. This routine configures the hardware required by the application, then\r
/* Return command status block to the host */\r
ReturnCommandStatus();\r
\r
- /* Check if a Mass Storage Reset ocurred */\r
+ /* Check if a Mass Storage Reset occurred */\r
if (IsMassStoreReset)\r
{\r
/* Reset the data endpoint banks */\r
#define INCLUDE_FROM_SCSI_C\r
#include "SCSI.h"\r
\r
-/** Structure to hold the SCSI reponse data to a SCSI INQUIRY command. This gives information about the device's\r
+/** Structure to hold the SCSI response data to a SCSI INQUIRY command. This gives information about the device's\r
* features and capabilities.\r
*/\r
SCSI_Inquiry_Response_t InquiryData = \r
{\r
bool CommandSuccess = false;\r
\r
- /* Run the apropriate SCSI command hander function based on the passed command */\r
+ /* Run the appropriate SCSI command hander function based on the passed command */\r
switch (CommandBlock.SCSICommandData[0])\r
{\r
case SCSI_CMD_INQUIRY:\r
return true;\r
}\r
\r
-/** Command processing for an issued SCSI SEND DIAGNOSTIC command. This command peforms a quick check of the Dataflash ICs on the\r
+/** Command processing for an issued SCSI SEND DIAGNOSTIC command. This command performs a quick check of the Dataflash ICs on the\r
* board, and indicates if they are present and functioning correctly. Only the Self-Test portion of the diagnostic command is\r
* supported.\r
*\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
uint8_t IdleCount = 0;\r
\r
/** Current Idle period remaining. When the IdleCount value is set, this tracks the remaining number of idle\r
- * milliseconds. This is seperate to the IdleCount timer and is incremented and compared as the host may request \r
+ * milliseconds. This is separate to the IdleCount timer and is incremented and compared as the host may request \r
* the current idle period via a Get Idle HID class request, thus its value must be preserved.\r
*/\r
uint16_t IdleMSRemaining = 0;\r
* to the output Ethernet frame if the host is requesting the IP or MAC address of the\r
* virtual server device on the network.\r
*\r
- * \param InDataStart Pointer to the start of the incomming packet's ARP header\r
+ * \param InDataStart Pointer to the start of the incoming packet's ARP header\r
* \param OutDataStart Pointer to the start of the outgoing packet's ARP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise\r
/** Processes a DHCP packet inside an Ethernet frame, and writes the appropriate response\r
* to the output Ethernet frame if the host is requesting or accepting an IP address.\r
*\r
- * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header\r
- * \param DHCPHeaderInStart Pointer to the start of the incomming packet's DHCP header\r
+ * \param IPHeaderInStart Pointer to the start of the incoming packet's IP header\r
+ * \param DHCPHeaderInStart Pointer to the start of the incoming packet's DHCP header\r
* \param DHCPHeaderOutStart Pointer to the start of the outgoing packet's DHCP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise\r
memcpy(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t));\r
DHCPHeaderOUT->Cookie = SwapEndian_32(DHCP_MAGIC_COOKIE);\r
\r
- /* Alter the incomming IP packet header so that the corrected IP source and destinations are used - this means that\r
+ /* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that\r
when the response IP header is generated, it will use the corrected addresses and not the null/broatcast addresses */\r
IPHeaderIN->SourceAddress = ClientIPAddress;\r
IPHeaderIN->DestinationAddress = ServerIPAddress;\r
\r
- /* Process the incomming DHCP packet options */\r
+ /* Process the incoming DHCP packet options */\r
while (DHCPOptionsINStart[0] != DHCP_OPTION_END)\r
{ \r
/* Find the Message Type DHCP option, to determine the type of DHCP packet */\r
uint8_t HardwareAddressLength; /**< Length in bytes of a hardware (MAC) address on the network */\r
uint8_t Hops; /**< Number of hops required to reach the server, unused */\r
\r
- uint32_t TransactionID; /**< Unique ID of the DHCP packet, for postive matching between sent and recieved packets */\r
+ uint32_t TransactionID; /**< Unique ID of the DHCP packet, for positive matching between sent and received packets */\r
\r
uint16_t ElapsedSeconds; /**< Elapsed seconds since the request was made */\r
uint16_t Flags; /**< BOOTP packet flags */\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
/** \file\r
*\r
* Ethernet frame packet handling routines. This protocol handles the processing of raw Ethernet\r
- * frames sent and receieved, deferring the processing of subpacket protocols to the appropriate\r
+ * frames sent and received, deferring the processing of subpacket protocols to the appropriate\r
* protocol handlers, such as DHCP or ARP.\r
*/\r
\r
#include "Ethernet.h"\r
\r
/* Global Variables: */\r
-/** Ethernet Frame buffer structure, to hold the incomming Ethernet frame from the host. */\r
+/** Ethernet Frame buffer structure, to hold the incoming Ethernet frame from the host. */\r
Ethernet_Frame_Info_t FrameIN;\r
\r
/** Ethernet Frame buffer structure, to hold the outgoing Ethernet frame to the host. */\r
const IP_Address_t ClientIPAddress = {CLIENT_IP_ADDRESS};\r
\r
\r
-/** Processes an incomming Ethernet frame, and writes the appropriate response to the output Ethernet\r
+/** Processes an incoming Ethernet frame, and writes the appropriate response to the output Ethernet\r
* frame buffer if the sub protocol handlers create a valid response.\r
*/\r
void Ethernet_ProcessPacket(void)\r
{\r
DecodeEthernetFrameHeader(FrameIN.FrameData);\r
\r
- /* Cast the incomming Ethernet frame to the Ethernet header type */\r
+ /* Cast the incoming Ethernet frame to the Ethernet header type */\r
Ethernet_Frame_Header_t* FrameINHeader = (Ethernet_Frame_Header_t*)&FrameIN.FrameData;\r
Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData;\r
\r
break;\r
}\r
\r
- /* Protcol processing routine has filled a response, complete the ethernet frame header */\r
+ /* Protocol processing routine has filled a response, complete the ethernet frame header */\r
if (RetSize > 0)\r
{\r
/* Fill out the response Ethernet frame header */\r
*/\r
#define MAC_COMPARE(MAC1, MAC2) (memcmp(MAC1, MAC2, sizeof(MAC_Address_t)) == 0)\r
\r
- /** Maximum size of an incomming or outgoing Ethernet frame in bytes */\r
+ /** Maximum size of an incoming or outgoing Ethernet frame in bytes */\r
#define ETHERNET_FRAME_SIZE_MAX 1500\r
\r
/** Minimum size of an Ethernet packet in bytes, to conform to the Ethernet V2 packet standard */\r
/** Processes an ICMP packet inside an Ethernet frame, and writes the appropriate response\r
* to the output Ethernet frame if the host is issuing a ICMP ECHO request.\r
*\r
- * \param InDataStart Pointer to the start of the incomming packet's ICMP header\r
+ * \param InDataStart Pointer to the start of the incoming packet's ICMP header\r
* \param OutDataStart Pointer to the start of the outgoing packet's ICMP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise\r
/** Processes an IP packet inside an Ethernet frame, and writes the appropriate response\r
* to the output Ethernet frame if one is created by a subprotocol handler.\r
*\r
- * \param InDataStart Pointer to the start of the incomming packet's IP header\r
+ * \param InDataStart Pointer to the start of the incoming packet's IP header\r
* \param OutDataStart Pointer to the start of the outgoing packet's IP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no\r
/** Protocol IP address of the virtual server machine */\r
#define SERVER_IP_ADDRESS { 10, 0, 0, 2}\r
\r
- /** Protocol IP address of the broadcase address */\r
+ /** Protocol IP address of the broadcast address */\r
#define BROADCAST_IP_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF}\r
\r
/** Default Time To Live (TTL) value for sent packets, indicating the maximum allowable hops until their destination is reached */\r
uint8_t TypeOfService; /**< Special service type identifier, indicating delay/throughput/reliability levels */\r
uint16_t TotalLength; /**< Total length of the IP packet, in bytes */\r
\r
- uint16_t Identification; /**< Idenfication value for identifying fragmented packets */\r
+ uint16_t Identification; /**< Identification value for identifying fragmented packets */\r
unsigned int FragmentOffset : 13; /**< Offset of this IP fragment */\r
unsigned int Flags : 3; /**< Fragment flags, to indicate if a packet is fragmented */\r
\r
*/\r
\r
/* Protocol decoders for Ethernet, TCP, IP, ICMP and ARP. Each of these routines\r
- accepts a header to the appropriate protocol and prints out pertient information\r
+ accepts a header to the appropriate protocol and prints out pertinent information\r
on the packet through the serial port.\r
\r
To disable printing of a specific protocol, define the token NO_DECODE_{Protocol}\r
/** \file\r
*\r
* Protocol decoding routines, for the plain-text decoding of Ethernet frames for debugging purposes.\r
- * Enabled protocol decoders will print incomming Ethernet frame contents through the USART in a human\r
+ * Enabled protocol decoders will print incoming Ethernet frame contents through the USART in a human\r
* readable format.\r
*\r
* Note that the USART is a slow transmission medium, and will slow down packet processing considerably.\r
#include "Ethernet.h"\r
\r
/* Macros: */\r
- /** Physical MAC Address of the USB netowork adapter */\r
+ /** Physical MAC Address of the USB network adapter */\r
#define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00}\r
\r
/** Implemented RNDIS Version Major */\r
}\r
\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
- * the status LEDs and stops all the relevent tasks.\r
+ * the status LEDs and stops all the relevant tasks.\r
*/\r
EVENT_HANDLER(USB_Disconnect)\r
{\r
}\r
\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
- * of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevent tasks.\r
+ * of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.\r
*/\r
EVENT_HANDLER(USB_ConfigurationChanged)\r
{\r
}\r
\r
/** Task to manage the sending and receiving of encapsulated RNDIS data and notifications. This removes the RNDIS\r
- * wrapper from recieved Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper\r
+ * wrapper from received Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper\r
* to a frame in the FrameOUT global before sending the buffer contents to the host.\r
*/\r
TASK(RNDIS_Task)\r
{\r
/* Task to hand off TCP packets to and from the listening applications. */\r
\r
- /* Run each application in sequence, to process incomming and generate outgoing packets */\r
+ /* Run each application in sequence, to process incoming and generate outgoing packets */\r
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)\r
{\r
/* Find the corresponding port entry in the port table */\r
*/\r
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))\r
{\r
- /* Note, Port number should be specified in BIG endian to simplfy network code */\r
+ /* Note, Port number should be specified in BIG endian to simplify network code */\r
\r
/* Check to see if the port entry is already in the port state table */\r
for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)\r
*/\r
uint8_t TCP_GetPortState(uint16_t Port)\r
{\r
- /* Note, Port number should be specified in BIG endian to simplfy network code */\r
+ /* Note, Port number should be specified in BIG endian to simplify network code */\r
\r
for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)\r
{\r
*/\r
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State)\r
{\r
- /* Note, Port number should be specified in BIG endian to simplfy network code */\r
+ /* Note, Port number should be specified in BIG endian to simplify network code */\r
\r
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)\r
{\r
*/\r
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)\r
{\r
- /* Note, Port number should be specified in BIG endian to simplfy network code */\r
+ /* Note, Port number should be specified in BIG endian to simplify network code */\r
\r
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)\r
{\r
*/\r
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)\r
{\r
- /* Note, Port number should be specified in BIG endian to simplfy network code */\r
+ /* Note, Port number should be specified in BIG endian to simplify network code */\r
\r
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)\r
{\r
/** Processes a TCP packet inside an Ethernet frame, and writes the appropriate response\r
* to the output Ethernet frame if one is created by a application handler.\r
*\r
- * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header\r
- * \param TCPHeaderInStart Pointer to the start of the incomming packet's TCP header\r
+ * \param IPHeaderInStart Pointer to the start of the incoming packet's IP header\r
+ * \param TCPHeaderInStart Pointer to the start of the incoming packet's TCP header\r
* \param TCPHeaderOutStart Pointer to the start of the outgoing packet's TCP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no\r
\r
bool PacketResponse = false;\r
\r
- /* Check if the destination port is open and allows incomming connections */\r
+ /* Check if the destination port is open and allows incoming connections */\r
if (TCP_GetPortState(TCPHeaderIN->DestinationPort) == TCP_Port_Open)\r
{\r
/* Detect SYN from host to start a connection */\r
}\r
else\r
{\r
- /* Process the incomming TCP packet based on the current connection state for the sender and port */\r
+ /* Process the incoming TCP packet based on the current connection state for the sender and port */\r
switch (TCP_GetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort))\r
{\r
case TCP_Connection_Listen:\r
}\r
else\r
{\r
- /* Buffer is currently in use by the application, defer processing of the incomming packet */\r
+ /* Buffer is currently in use by the application, defer processing of the incoming packet */\r
return NO_PROCESS;\r
}\r
}\r
{\r
uint32_t Checksum = 0;\r
\r
- /* TCP/IP checksums are the addition of the one's compliment of each word including the IP psudo-header,\r
+ /* TCP/IP checksums are the addition of the one's compliment of each word including the IP pseudo-header,\r
complimented */\r
\r
Checksum += ((uint16_t*)&SourceAddress)[0];\r
unsigned char Reserved : 4; /**< Reserved, must be all 0 */\r
unsigned char DataOffset : 4; /**< Offset of the data from the start of the header, in 4 byte chunks */\r
uint8_t Flags; /**< TCP packet flags */\r
- uint16_t WindowSize; /**< Current data window size (bytes remaning in reception buffer) */\r
+ uint16_t WindowSize; /**< Current data window size (bytes remaining in reception buffer) */\r
\r
uint16_t Checksum; /**< TCP checksum */\r
uint16_t UrgentPointer; /**< Urgent data pointer */\r
/** Processes a UDP packet inside an Ethernet frame, and writes the appropriate response\r
* to the output Ethernet frame if a subprotocol handler has created a response packet.\r
*\r
- * \param IPHeaderInStart Pointer to the start of the incomming packet's IP header\r
- * \param UDPHeaderInStart Pointer to the start of the incomming packet's UDP header\r
+ * \param IPHeaderInStart Pointer to the start of the incoming packet's IP header\r
+ * \param UDPHeaderInStart Pointer to the start of the incoming packet's UDP header\r
* \param UDPHeaderOutStart Pointer to the start of the outgoing packet's UDP header\r
*\r
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
*/\r
\r
/* Buffer Configuration: */\r
- /* Buffer length - select static size of created ringbuffers: */\r
- #define BUFF_STATICSIZE 128 // Set to the static ringbuffer size for all ringbuffers (place size after define)\r
+ /* Buffer length - select static size of created ring buffers: */\r
+ #define BUFF_STATICSIZE 128 // Set to the static ring buffer size for all ring buffers (place size after define)\r
\r
/* Volatile mode - uncomment to make buffers volatile, for use in ISRs, etc: */\r
#define BUFF_VOLATILE // Uncomment to cause all ring buffers to become volatile (and atomic if multi-byte) in access\r
// #define BUFF_DROPNEW // Uncomment to cause full ring buffers to drop the new character when full\r
// #define BUFF_NODROPCHECK // Uncomment to ignore full ring buffer checks - checking left to user!\r
\r
- /* Underflow behaviour - select behaviour when Buffer_GetElement is called with an empty ringbuffer: */\r
- //#define BUFF_EMPTYRETURNSZERO // Uncomment to return 0 when an empty ringbuffer is read\r
- #define BUFF_NOEMPTYCHECK // Uncomment to disable checking of empty ringbuffers - checking left to user!\r
+ /* Underflow behaviour - select behaviour when Buffer_GetElement is called with an empty ring buffer: */\r
+ //#define BUFF_EMPTYRETURNSZERO // Uncomment to return 0 when an empty ring buffer is read\r
+ #define BUFF_NOEMPTYCHECK // Uncomment to disable checking of empty ring buffers - checking left to user!\r
\r
/* Buffer storage type - set the datatype for the stored data */\r
#define BUFF_DATATYPE uint8_t // Change to the data type that is going to be stored into the buffer\r
LEDs_Init();\r
ReconfigureUSART();\r
\r
- /* Ringbuffer Initialization */\r
+ /* Ring buffer Initialization */\r
Buffer_Initialize(&Rx_Buffer);\r
Buffer_Initialize(&Tx_Buffer);\r
\r
/* Includes: */\r
#include <avr/io.h>\r
#include <avr/wdt.h>\r
- #include <avr/interrupt.h>
+ #include <avr/interrupt.h>\r
#include <avr/power.h>\r
\r
#include "Descriptors.h"\r
#define CONTROL_LINE_IN_RING (1 << 3)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a framing error has ocurred on the virtual serial port.\r
+ * to indicate that a framing error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_FRAMEERROR (1 << 4)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a parity error has ocurred on the virtual serial port.\r
+ * to indicate that a parity error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_PARITYERROR (1 << 5)\r
\r
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,\r
- * to indicate that a data overrun error has ocurred on the virtual serial port.\r
+ * to indicate that a data overrun error has occurred on the virtual serial port.\r
*/\r
#define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)\r
\r
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the\r
* CDCDevice_LineCodingParity_t enum\r
*/\r
- uint8_t DataBits; /**< Bits of data per charater of the virtual serial port */\r
+ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */\r
} CDC_Line_Coding_t;\r
\r
/** Type define for a CDC notification, sent to the host via the CDC notification endpoint to indicate a\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"CDC Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
uint16_t BufferLength = Pipe_BytesInPipe();\r
uint8_t Buffer[BufferLength];\r
\r
- /* Read in the pipe data to the tempoary buffer */\r
+ /* Read in the pipe data to the temporary buffer */\r
Pipe_Read_Stream_LE(Buffer, BufferLength);\r
\r
/* Clear the pipe after it is read, ready for the next packet */\r
DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */\r
InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */\r
NoCDCInterfaceFound = 4, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */\r
- NoEndpointFound = 5, /**< Cmpatible CDC endpoints were not found in the device's CDC interface */\r
+ NoEndpointFound = 5, /**< Compatible CDC endpoints were not found in the device's CDC interface */\r
};\r
\r
/* Configuration Descriptor Comparison Functions: */\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Generic HID Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Keyboard Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Protocol).\r\n"));\r
{\r
ParseSuccessful = 0, /**< HID report descriptor parsed successfully */\r
ParseError = 1, /**< Failed to fully process the HID report descriptor */\r
- ParseControlError = 2, /**< Control error occured while trying to read the device HID descriptor */\r
+ ParseControlError = 2, /**< Control error occurred while trying to read the device HID descriptor */\r
};\r
\r
/* Type Defines: */\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Keyboard Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
break; \r
}\r
\r
- /* All LEDs off - ready to indicate keypresses */\r
+ /* All LEDs off - ready to indicate key presses */\r
UpdateStatus(Status_USBReady);\r
\r
puts_P(PSTR("Keyboard Enumerated.\r\n"));\r
/* Check each HID report item in turn, looking for keyboard scan code reports */\r
for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)\r
{\r
- /* Create a tempoary item pointer to the next report item */\r
+ /* Create a temporary item pointer to the next report item */\r
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];\r
\r
/* Check if the current report item is a keyboard scancode */\r
/* Indicate USB not ready */\r
UpdateStatus(Status_USBNotReady);\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"MassStore Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
break;\r
}\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = MassStore_GetMaxLUN(&MassStore_MaxLUNIndex)) != HOST_SENDCONTROL_Successful)\r
{ \r
ShowDiskReadError(PSTR("Get Max LUN"), ErrorCode);\r
}\r
\r
/* Get sense data from the device - many devices will not accept any other commands until the sense data\r
- * is read - both on startup and after a failed command */\r
+ * is read - both on start-up and after a failed command */\r
SCSI_Request_Sense_Response_t SenseData;\r
if ((ErrorCode = MassStore_RequestSense(0, &SenseData)) != 0)\r
{\r
LEDs_SetAllLEDs(LEDMask);\r
}\r
\r
-/** Indicates that a communication error has ocurred with the attached Mass Storage Device,\r
+/** Indicates that a communication error has occurred with the attached Mass Storage Device,\r
* printing error codes to the serial port and waiting until the device is removed before\r
* continuing.\r
*\r
Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */\r
Status_HardwareError = 4, /**< Hardware error while enumerating the attached USB device */\r
Status_Busy = 5, /**< Busy reading or writing to the attached Mass Storage device */\r
- Status_SCSICommandError = 6, /**< Error sending or recieving a command to or from the attached SCSI device */\r
+ Status_SCSICommandError = 6, /**< Error sending or receiving a command to or from the attached SCSI device */\r
};\r
\r
/* Task Definitions: */\r
* to a FAT library to give file-level access to an attached device's contents.\r
*\r
* \note Many Mass Storage devices on the market are non-compliant to the\r
- * specifications and thus can proove difficult to interface with. It\r
- * may be neccesary to retry the functions in the module several times\r
+ * specifications and thus can prove difficult to interface with. It\r
+ * may be necessary to retry the functions in the module several times\r
* after they have returned and error to successfully send the command\r
* to the device. Some devices may also need to have the stream function\r
* timeout period extended beyond 100ms (some badly designed devices exceeding\r
\r
/* Globals: */\r
/** Current CBW to send to the device. This is automatically filled by the routines\r
- * in this file and is not externally accessable.\r
+ * in this file and is not externally accessible.\r
*/\r
static CommandBlockWrapper_t SCSICommandBlock;\r
\r
/** Current CSW received from the device. This is automatically filled by the routines\r
- * in this file and is externally accessable so that the return codes may be checked.\r
+ * in this file and is externally accessible so that the return codes may be checked.\r
*/\r
CommandStatusWrapper_t SCSICommandStatus;\r
\r
/** Current Tag value used in issued CBWs to the device. This is automatically incremented\r
- * by the routines in this file, and is not externally accessable.\r
+ * by the routines in this file, and is not externally accessible.\r
*/\r
static uint32_t MassStore_Tag = 1;\r
\r
/* Check to see if a new frame has been issued (1ms elapsed) */\r
if (USB_INT_HasOccurred(USB_INT_HSOFI))\r
{\r
- /* Clear the flag and decrement the timout period counter */\r
+ /* Clear the flag and decrement the timeout period counter */\r
USB_INT_Clear(USB_INT_HSOFI);\r
TimeoutMSRem--;\r
\r
/** Command Block Wrapper signature byte, for verification of valid CBW blocks */\r
#define CBW_SIGNATURE 0x43425355UL\r
\r
- /** Command Statuc Wrapper signature byte, for verification of valid CSW blocks */\r
+ /** Command Static Wrapper signature byte, for verification of valid CSW blocks */\r
#define CSW_SIGNATURE 0x53425355UL\r
\r
/** Data direction mask for the Flags field of a CBW, indicating Host-to-Device transfer direction */\r
{\r
uint32_t Signature; /**< Command status signature, always equal to CSW_SIGNATURE */\r
uint32_t Tag; /**< Current CBW tag, to positively associate a CBW with a CSW */\r
- uint32_t DataTransferResidue; /**< Length of data not transfered */\r
+ uint32_t DataTransferResidue; /**< Length of data not transferred */\r
uint8_t Status; /**< Command status, a value from the MassStorageHost_CommandStatusCodes_t enum */\r
} CommandStatusWrapper_t;\r
\r
/** Type define for a SCSI Sense structure. Structures of this type are filled out by the\r
* device via the MassStore_RequestSense() function, indicating the current sense data of the\r
- * device (giving explitic error codes for the last issued command). For details of the\r
+ * device (giving explicit error codes for the last issued command). For details of the\r
* structure contents, refer to the SCSI specifications.\r
*/\r
typedef struct\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Mouse Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Protocol).\r\n"));\r
{\r
ParseSuccessful = 0, /**< HID report descriptor parsed successfully */\r
ParseError = 1, /**< Failed to fully process the HID report descriptor */\r
- ParseControlError = 2, /**< Control error occured while trying to read the device HID descriptor */\r
+ ParseControlError = 2, /**< Control error occurred while trying to read the device HID descriptor */\r
};\r
\r
/* Type Defines: */\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Mouse Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control Error (Set Configuration).\r\n"));\r
break; \r
}\r
\r
- /* All LEDs off - ready to indicate keypresses */\r
+ /* All LEDs off - ready to indicate key presses */\r
UpdateStatus(Status_USBReady);\r
\r
puts_P(PSTR("Mouse Enumerated.\r\n"));\r
/* Check each HID report item in turn, looking for mouse X/Y/button reports */\r
for (uint8_t ReportNumber = 0; ReportNumber < HIDReportInfo.TotalReportItems; ReportNumber++)\r
{\r
- /* Create a tempoary item pointer to the next report item */\r
+ /* Create a temporary item pointer to the next report item */\r
HID_ReportItem_t* ReportItem = &HIDReportInfo.ReportItems[ReportNumber];\r
\r
bool FoundData;\r
/* Check to see if a new frame has been issued (1ms elapsed) */\r
if (USB_INT_HasOccurred(USB_INT_HSOFI))\r
{\r
- /* Clear the flag and decrement the timout period counter */\r
+ /* Clear the flag and decrement the timeout period counter */\r
USB_INT_Clear(USB_INT_HSOFI);\r
TimeoutMSRem--;\r
\r
(params * sizeof(PIMA_SendBlock.Params[0])))\r
\r
/* Type Defines: */\r
- /** Type define for a PIMA container, use to send commands and receieve responses to and from an\r
+ /** Type define for a PIMA container, use to send commands and receive responses to and from an\r
* attached Still Image device.\r
*/\r
typedef struct\r
/* Initialize USB Subsystem */\r
USB_Init();\r
\r
- /* Startup message */\r
+ /* Start-up message */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"Still Image Host Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
for(;;);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occured while\r
+/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
wLength: 0,\r
};\r
\r
- /* Send the request, display error and wait for device detatch if request fails */\r
+ /* Send the request, display error and wait for device detach if request fails */\r
if (USB_Host_SendControlRequest(NULL) != HOST_SENDCONTROL_Successful)\r
{\r
puts_P(PSTR("Control error.\r\n"));\r
/* Send the GETDEVICEINFO block */\r
SImage_SendBlockHeader();\r
\r
- /* Recieve the response data block */\r
+ /* Receive the response data block */\r
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)\r
{\r
ShowCommandError(ErrorCode, false);\r
UnicodeToASCII(DeviceInfoPos, DeviceVersion);\r
printf_P(PSTR(" Device Version: %s\r\n"), DeviceVersion);\r
\r
- /* Recieve the final response block from the device */\r
+ /* Receive the final response block from the device */\r
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)\r
{\r
ShowCommandError(ErrorCode, false);\r
/* Send the OPENSESSION block, open a session with an ID of 0x0001 */\r
SImage_SendBlockHeader();\r
\r
- /* Recieve the response block from the device */\r
+ /* Receive the response block from the device */\r
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)\r
{\r
ShowCommandError(ErrorCode, false);\r
/* Send the CLOSESESSION block, close the session with an ID of 0x0001 */\r
SImage_SendBlockHeader();\r
\r
- /* Recieve the response block from the device */\r
+ /* Receive the response block from the device */\r
if ((ErrorCode = SImage_RecieveBlockHeader()) != PIPE_RWSTREAM_ERROR_NoError)\r
{\r
ShowCommandError(ErrorCode, false);\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
/* Turn on interrupts */\r
sei();\r
\r
- /* Startup message via USART */\r
+ /* Start-up message via USART */\r
puts_P(PSTR(ESC_RESET ESC_BG_WHITE ESC_INVERSE_ON ESC_ERASE_DISPLAY\r
"LUFA Demo running.\r\n" ESC_INVERSE_OFF));\r
\r
*/\r
TASK(TestApp_CheckTemp)\r
{\r
- static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on startup\r
+ static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on start-up\r
\r
/* Task runs every 10000 ticks, 10 seconds for this demo */\r
if (Scheduler_HasDelayElapsed(10000, &DelayCounter))\r
/* Set flag, indicating that current pressed state has been handled */\r
IsPressed = true;\r
\r
- /* First start of the USB interface permenantly blocks the joystick task */\r
+ /* First start of the USB interface permanently blocks the joystick task */\r
if (BlockingJoystickTask == false)\r
{\r
Scheduler_SetTaskMode(TestApp_CheckJoystick, TASK_STOP);\r
* - KeyboardHost, MouseHost and GenericHIDHost demos now save and restore the currently selected pipe inside the pipe ISR\r
* - Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOINT and INTERRUPT_CONTROL_ENDPOINT compile\r
* time options\r
+ * - All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected\r
*\r
* \section Sec_ChangeLog090401 Version 090401\r
*\r
/** \file\r
*\r
* This file contains macros which are common to all library elements, and which may be useful in user code. It\r
- * also includes other common headees, such as Atomic.h, FunctionAttributes.h and BoardTypes.h.\r
+ * also includes other common headers, such as Atomic.h, FunctionAttributes.h and BoardTypes.h.\r
*/\r
\r
#ifndef __COMMON_H__\r
\r
/* Public Interface - May be used in end-application: */\r
/* Macros: */ \r
- /** Macro for encasing other multi-statment macros. This should be used along with an opening brace\r
+ /** Macro for encasing other multi-statement macros. This should be used along with an opening brace\r
* before the start of any multi-statement macro, so that the macros contents as a whole are treated\r
- * as a discreete block and not as a list of seperate statements which may cause problems when used as\r
- * a block (such as inline IF statments).\r
+ * as a discrete block and not as a list of separate statements which may cause problems when used as\r
+ * a block (such as inline IF statements).\r
*/\r
#define MACROS do\r
\r
- /** Macro for encasing other multi-statment macros. This should be used along with a preceeding closing\r
+ /** Macro for encasing other multi-statement macros. This should be used along with a preceding closing\r
* brace at the end of any multi-statement macro, so that the macros contents as a whole are treated\r
- * as a discreete block and not as a list of seperate statements which may cause problems when used as\r
- * a block (such as inline IF statments).\r
+ * as a discrete block and not as a list of separate statements which may cause problems when used as\r
+ * a block (such as inline IF statements).\r
*/\r
#define MACROE while (0)\r
\r
- /** Defines a volatile NOP statment which cannot be optimized out by the compiler, and thus can always\r
+ /** Defines a volatile NOP statement which cannot be optimized out by the compiler, and thus can always\r
* be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimizer\r
* removes/reorders code to the point where break points cannot reliably be set.\r
*/\r
#define JTAG_DEBUG_POINT() asm volatile ("NOP" ::)\r
\r
- /** Defines an explicit JTAG break point in the resulting binary via the ASM BREAK statment. When\r
+ /** Defines an explicit JTAG break point in the resulting binary via the ASM BREAK statement. When\r
* a JTAG is used, this causes the program execution to halt when reached until manually resumed. */\r
#define JTAG_DEBUG_BREAK() asm volatile ("BREAK" ::)\r
\r
*\r
* This file contains macros for applying GCC specific attributes to functions to control various optimizer\r
* and code generation features of the compiler. Attributes may be placed in the function prototype in any\r
- * order, and multiple attributes can be specified for a single function via a space seperated list.\r
+ * order, and multiple attributes can be specified for a single function via a space separated list.\r
*\r
* \note Do not include this file directly, rather include the Common.h header file instead to gain this file's\r
* functionality.\r
/* Public Interface - May be used in end-application: */\r
/* Macros: */\r
/** Indicates to the compiler that the function can not ever return, so that any stack restoring or\r
- * return code may be ommited by the compiler in the resulting binary.\r
+ * return code may be omitted by the compiler in the resulting binary.\r
*/\r
#define ATTR_NO_RETURN __attribute__ ((noreturn))\r
\r
- /** Places the function in one of the initilization sections, which execute before the main function\r
+ /** Places the function in one of the initialization sections, which execute before the main function\r
* of the application. The init function number can be specified as "x", as an integer. Refer to the\r
* avr-libc manual for more information on the initialization sections.\r
*/\r
#define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\r
\r
/** Indicates that the specified parameters of the function are pointers which should never be NULL.\r
- * When applied as a 1-based comma seperated list the compiler will emmit a warning if the specified\r
+ * When applied as a 1-based comma separated list the compiler will emit a warning if the specified\r
* parameters are known at compiler time to be NULL at the point of calling the function.\r
*/\r
#define ATTR_NON_NULL_PTR_ARG(...) __attribute__ ((nonnull (__VA_ARGS__)))\r
\r
- /** Removes any preample or postample from the function. When used, the function will not have any\r
+ /** Removes any preamble or postamble from the function. When used, the function will not have any\r
* register or stack saving code. This should be used with caution, and when used the programmer\r
* is responsible for maintaining stack and register integrity.\r
*/\r
#if !defined(__DOXYGEN__)\r
static inline void Joystick_Init(void)\r
{\r
- // TODO: Initialize joystick port pins as inputs with pullups\r
+ // TODO: Initialize joystick port pins as inputs with pull-ups\r
};\r
\r
static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;\r
#error The selected board does not contain a HWB.\r
#endif\r
\r
- /* Psudo-Functions for Doxygen: */\r
+ /* Pseudo-Functions for Doxygen: */\r
#if defined(__DOXYGEN__)\r
/** Initializes the HWB driver, so that the current button position can be read. This sets the appropriate\r
* I/O pin to an input with pull-up enabled.\r
#error The selected board does not contain a joystick.\r
#endif\r
\r
- /* Psudo-Functions for Doxygen: */\r
+ /* Pseudo-Functions for Doxygen: */\r
#if defined(__DOXYGEN__)\r
/** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate\r
* I/O pins to inputs with their pull-ups enabled.\r
#include "Board/LEDs.h"\r
#endif\r
\r
- /* Psudo-Functions for Doxygen: */\r
+ /* Pseudo-Functions for Doxygen: */\r
#if defined(__DOXYGEN__)\r
/** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port\r
* I/O pins as outputs, and sets the LEDs to default to off.\r
/** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.\r
* This must be called before any other temperature sensor routines.\r
*\r
- * The ADC itself (not the ADC channel) must be configured seperately before calling the temperature\r
+ * The ADC itself (not the ADC channel) must be configured separately before calling the temperature\r
* sensor functions.\r
*/\r
#define Temperature_Init() ADC_SetupChannel(TEMP_ADC_CHANNEL);\r
\r
/* Function Prototypes: */\r
/** Performs a complete ADC on the temperature sensor channel, and converts the result into a\r
- * valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celcius.\r
+ * valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celsius.\r
*\r
- * \return Signed temperature in degrees Celcius\r
+ * \return Signed temperature in degrees Celsius\r
*/\r
int8_t Temperature_GetTemperature(void) ATTR_WARN_UNUSED_RESULT;\r
\r
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength\r
#endif\r
\r
- /** Creates a prototype for or begins a descriptor comparitor routine. Descriptor comparitor routines are \r
+ /** Creates a prototype for or begins a descriptor comparator routine. Descriptor comparator routines are \r
* small search routines which are passed a pointer to the current sub descriptor in the configuration\r
* descriptor, and which analyse the sub descriptor to determine whether or not it matches the routine's\r
- * search parameters. Comparitor routines provide a powerful way to scan through the config descriptor\r
+ * search parameters. Comparator routines provide a powerful way to scan through the config descriptor\r
* for certain descriptors matching unique criteria.\r
*\r
- * Comparitor routines are passed in a single pointer named CurrentDescriptor, and should return a value\r
+ * Comparator routines are passed in a single pointer named CurrentDescriptor, and should return a value\r
* of a member of the DSEARCH_Return_ErrorCodes_t enum.\r
*/\r
#define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor)\r
*\r
* \param DSize Pointer to an int storing the remaining bytes in the configuration descriptor\r
* \param DPos Pointer to the current position in the configuration descriptor\r
- * \param DSearch Name of the comparitor search function to use on the configuration descriptor\r
+ * \param DSearch Name of the comparator search function to use on the configuration descriptor\r
*\r
* \return Value of one of the members of the DSEARCH_Comp_Return_ErrorCodes_t enum\r
*\r
/** Enum for return values of USB_Host_GetNextDescriptorComp() */\r
enum DSEARCH_Comp_Return_ErrorCodes_t\r
{\r
- Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to decriptor which matches\r
+ Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to descriptor which matches\r
* search criteria of the given comparator function. */\r
Descriptor_Search_Comp_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */\r
Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */\r
bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)\r
ATTR_NON_NULL_PTR_ARG(1, 2);\r
\r
- /** Retreives the given report item's value out of the Value member of the report item's\r
+ /** Retrieves the given report item's value out of the Value member of the report item's\r
* HID_ReportItem_t structure and places it into the correct position in the HID report\r
* buffer. The report buffer is assumed to have the appropriate bits cleared before calling\r
* this function (i.e., the buffer should be explicitly cleared before report values are added).\r
/** HID_ReportItem_t.ItemFlags flag for buffered bytes. */\r
#define IOF_BUFFEREDBYTES (1 << 8)\r
\r
- /** HID_ReportItem_t.ItemFlags flag for bitfield data. */\r
+ /** HID_ReportItem_t.ItemFlags flag for bit field data. */\r
#define IOF_BITFIELD (0 << 8)\r
\r
/* Private Interface - For use in library only: */\r
/* Macros: */\r
/** Raises a given event name, with the specified parameters. For events with no parameters the\r
* only argument to the macro is the event name, events with parameters list the parameter values\r
- * after the name as a comma seperated list.\r
+ * after the name as a comma separated list.\r
*\r
* When a given event is fired, its corresponding event handler code is executed.\r
*\r
*/\r
#define RAISE_EVENT(e, ...) Event_ ## e (__VA_ARGS__)\r
\r
- /** Indicates that a given module can raise a given event. This is the equivelent of putting the\r
+ /** Indicates that a given module can raise a given event. This is the equivalent of putting the\r
* event function's prototype into the module, but in a cleaner way. Each event which may be\r
* fired via the RAISE_EVENT macro in the module should have an accompanying RAISES_EVENT\r
* prototype in the module's header file.\r
*\r
* Only one event handler may be defined in any user project for each individual event. Events may\r
* or may not have parameters - for each event, refer to its documentation elsewhere in this module\r
- * to determine the presense and purpose of any event parameters.\r
+ * to determine the presence and purpose of any event parameters.\r
*\r
* Usage Example:\r
* \code\r
*/\r
#define EVENT_HANDLER(e) void Event_ ## e e ## _P\r
\r
- /** Indicates that a given module handles an event. This is the equivelent of putting the\r
+ /** Indicates that a given module handles an event. This is the equivalent of putting the\r
* event function's prototype into the module, but in a cleaner way. Each event which may be\r
* handled via the EVENT_HANDLER macro in the module should have an accompanying HANDLES_EVENT\r
* prototype in the module's header file.\r
*/\r
#define HANDLES_EVENT(e) EVENT_HANDLER(e)\r
\r
- /* Psudo-Functions for Doxygen: */\r
+ /* Pseudo-Functions for Doxygen: */\r
#if defined(__DOXYGEN__)\r
/** Event for VBUS level change. This event fires when the VBUS line of the USB AVR changes from\r
* high to low or vice-versa.\r
* has been attached (but not yet fully enumerated), or when in device mode and the device is connected\r
* to a host, beginning the enumeration process.\r
*\r
- * When in device mode, this can be used to progmatically start the USB management task to reduce\r
+ * When in device mode, this can be used to programmatically start the USB management task to reduce\r
* CPU usage.\r
*\r
* \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
* attached and enumerated device has been disconnected, or when in device mode and the device is\r
* disconnected from the host.\r
*\r
- * When in device mode, this can be used to progmatically stop the USB management task to reduce\r
+ * When in device mode, this can be used to programmatically stop the USB management task to reduce\r
* CPU usage.\r
*\r
* \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
\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 USB_DeviceConnect event and so can be used to programatically start the USB management\r
+ * the standard USB_DeviceConnect event and so can be used to programmatically start the USB management\r
* task to reduce CPU consumption.\r
*\r
* \note This event only exists on USB AVR models which supports host mode.\r
\r
/** Event for USB device removal. This event fires when a the USB interface is in host mode, and\r
* a USB device has been removed the USB interface whether or not it has been enumerated. This\r
- * can be used to programatically stop the USB management task to reduce CPU consumption.\r
+ * can be used to programmatically stop the USB management task to reduce CPU consumption.\r
*\r
* \note This event only exists on USB AVR models which supports host mode.\r
*\r
/** \file\r
*\r
* Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains\r
- * strucutures and macros for the easy creation of standard USB descriptors in USB device projects.\r
+ * structures and macros for the easy creation of standard USB descriptors in USB device projects.\r
*\r
* All standard descriptors have their elements named in an identical manner to the official USB specification,\r
* however slightly more verbose alternate (non-standard) names are also supplied if the macro\r
uint16_t ReleaseNumber; /**< Product release (version) number. */\r
\r
uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The\r
- * host will request this string via a seperate\r
+ * host will request this string via a separate\r
* control request for the string descriptor.\r
*\r
* \note If no string supplied, use NO_DESCRIPTOR.\r
* \see ManufacturerStrIndex structure entry.\r
*/\r
uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal\r
- * serial number, in uppercase Unicoded ASCII.\r
+ * serial number, in uppercase Unicode ASCII.\r
*\r
* \see ManufacturerStrIndex structure entry.\r
*/\r
\r
/** Type define for a standard interface association descriptor.\r
*\r
- * This descriptor has been added as a suppliment to the USB2.0 standard, in the ECN located at\r
+ * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at\r
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound\r
* devices with multiple interfaces related to the same function to have the multiple interfaces bound\r
* together at the point of enumeration, loading one generic driver for all the interfaces in the single\r
* maximum packet size that the endpoint can receive at a time.\r
*/\r
\r
- uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpont\r
+ uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint\r
* if it is an INTERRUPT or ISOCHRONOUS type.\r
*/\r
#else\r
#define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)\r
\r
/** Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred,\r
- * but the interrupt vector is not neccesarily enabled), otherwise returns false.\r
+ * but the interrupt vector is not necessarily enabled), otherwise returns false.\r
*/\r
#define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false)\r
\r
*/\r
extern volatile bool USB_IsConnected;\r
\r
- /** Indicates if the USB interface is currently initialized but not neccesarily connected to a host\r
+ /** Indicates if the USB interface is currently initialized but not necessarily connected to a host\r
* or device (i.e. if USB_Init() has been run). If this is false, all other library globals are invalid.\r
*\r
* \note This variable should be treated as read-only in the user application, and never manually\r
* The USB task must be serviced within 50mS in all modes, when needed. The task may be serviced \r
* at all times, or (for minimum CPU consumption):\r
*\r
- * - In device mode, it may be disabled at startup, enabled on the firing of the USB_Connect event\r
+ * - In device mode, it may be disabled at start-up, enabled on the firing of the USB_Connect event\r
* and disabled again on the firing of the USB_Disconnect event.\r
*\r
- * - In host mode, it may be disabled at startup, enabled on the firing of the USB_DeviceAttached\r
+ * - In host mode, it may be disabled at start-up, enabled on the firing of the USB_DeviceAttached\r
* event and disabled again on the firing of the USB_DeviceUnattached event.\r
*\r
* \see Events.h for more information on the USB events.\r
\r
/** Indicates if the device is currently suspended by the host. While suspended, the device is\r
* to enter a low power state until resumed by the host. While suspended no USB traffic to or\r
- * from the device can ocurr (except for Remote Wakeup requests).\r
+ * from the device can occur (except for Remote Wakeup requests).\r
*\r
* This macro returns true if the USB communications have been suspended by the host, false\r
* otherwise.\r
*\r
* Functions, macros and enums related to endpoint management when in USB Device mode. This\r
* module contains the endpoint management macros, as well as endpoint interrupt and data\r
- * send/recieve functions for various datatypes.\r
+ * send/recieve functions for various data types.\r
*/\r
\r
#ifndef __ENDPOINT_H__\r
\r
/** Returns true if the currently selected endpoint may be read from (if data is waiting in the endpoint\r
* bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an\r
- * IN direction). This function will return false if an error has occured in the endpoint, or if\r
+ * IN direction). This function will return false if an error has occurred in the endpoint, or if\r
* the endpoint is an OUT direction and no packet has been received, or if the endpoint is an IN\r
* direction and the endpoint bank is full.\r
*/\r
*/\r
#define Endpoint_ClearSetupOUT() MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE\r
\r
- /** Stalls the current endpoint, indicating to the host that a logical problem occured with the\r
+ /** Stalls the current endpoint, indicating to the host that a logical problem occurred with the\r
* indicated endpoint and that the current transfer sequence should be aborted. This provides a\r
* way for devices to indicate invalid commands to the host so that the current transfer can be\r
- * aborted and the host can begin its own recovery seqeuence.\r
+ * aborted and the host can begin its own recovery sequence.\r
*\r
* The currently selected endpoint remains stalled until either the Endpoint_ClearStall() macro\r
* is called, or the host issues a CLEAR FEATURE request to the device for the currently selected\r
/** Clears the stall on the currently selected endpoint. */\r
#define Endpoint_ClearStall() MACROS{ UECONX |= (1 << STALLRQC); }MACROE\r
\r
- /** Returns true if the currently selected endpoint is stalled, false othewise. */\r
+ /** Returns true if the currently selected endpoint is stalled, false otherwise. */\r
#define Endpoint_IsStalled() ((UECONX & (1 << STALLRQ)) ? true : false)\r
\r
/** Resets the data toggle of the currently selected endpoint. */\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \note This routine should not be used on CONTROL type endpoints.\r
*\r
* \param Length Number of bytes to send via the currently selected endpoint.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \note This routine should not be used on CONTROL type endpoints.\r
*\r
* \param Buffer Pointer to the source data buffer to read from.\r
* \param Length Number of bytes to read for the currently selected endpoint into the buffer.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \note This routine should not be used on CONTROL type endpoints.\r
*\r
* \param Buffer Pointer to the source data buffer to read from.\r
* \param Length Number of bytes to read for the currently selected endpoint into the buffer.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \note This routine should not be used on CONTROL type endpoints.\r
*\r
* \param Buffer Pointer to the destination data buffer to write to.\r
* \param Length Number of bytes to send via the currently selected endpoint.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \note This routine should not be used on CONTROL type endpoints.\r
*\r
* \param Buffer Pointer to the destination data buffer to write to.\r
* \param Length Number of bytes to send via the currently selected endpoint.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.\r
*/\r
#define Endpoint_Ignore_DWord() Endpoint_Discard_DWord()\r
\r
/** Alias for Endpoint_Read_Word_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Read_Word() Endpoint_Read_Word_LE() \r
\r
/** Alias for Endpoint_Write_Word_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Write_Word(Word) Endpoint_Write_Word_LE(Word)\r
\r
/** Alias for Endpoint_Read_DWord_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Read_DWord() Endpoint_Read_DWord_LE()\r
\r
/** Alias for Endpoint_Write_DWord_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Write_DWord(DWord) Endpoint_Write_DWord_LE(DWord)\r
\r
/** Alias for Endpoint_Read_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#if !defined(NO_STREAM_CALLBACKS)\r
#define Endpoint_Read_Stream(Buffer, Length, Callback) Endpoint_Read_Stream_LE(Buffer, Length, Callback)\r
#endif\r
\r
/** Alias for Endpoint_Write_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#if !defined(NO_STREAM_CALLBACKS)\r
#define Endpoint_Write_Stream(Buffer, Length, Callback) Endpoint_Write_Stream_LE(Buffer, Length, Callback)\r
#endif\r
\r
/** Alias for Endpoint_Read_Control_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Read_Control_Stream(Data, Length) Endpoint_Read_Control_Stream_LE(Data, Length)\r
\r
/** Alias for Endpoint_Write_Control_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Endpoint_Write_Control_Stream(Data, Length) Endpoint_Write_Control_Stream_LE(Data, Length) \r
\r
\r
for (uint8_t MSRem = 10; MSRem != 0; MSRem--)\r
{\r
- /* Workaround for powerless-pullup devices. After a USB bus reset,\r
- all disconnection interrupts are supressed while a USB frame is\r
+ /* Workaround for powerless-pull-up devices. After a USB bus reset,\r
+ all disconnection interrupts are suppressed while a USB frame is\r
looked for - if it is found within 10ms, the device is still\r
present. */\r
\r
*/\r
#define USB_Host_ResumeBus() MACROS{ UHCON |= (1 << SOFEN); }MACROE \r
\r
- /** Suspends the USB bus, preventing any communications from occuring between the host and attached\r
+ /** Suspends the USB bus, preventing any communications from occurring between the host and attached\r
* device until the bus has been resumed. This stops the transmission of the 1MS Start Of Frame\r
* messages to the device.\r
*/\r
* event.\r
*/\r
HOST_ENUMERROR_WaitStage = 1, /**< One of the delays between enumeration steps failed\r
- * to complete successfuly, due to a timeout or other\r
+ * to complete successfully, due to a timeout or other\r
* error.\r
*/\r
HOST_ENUMERROR_NoDeviceDetected = 2, /**< No device was detected, despite the USB data lines\r
* indicating the attachment of a device.\r
*/\r
HOST_ENUMERROR_ControlError = 3, /**< One of the enumeration control requests failed to\r
- * complete successfuly.\r
+ * complete successfully.\r
*/\r
HOST_ENUMERROR_PipeConfigError = 4, /**< The default control pipe (address 0) failed to\r
* configure correctly.\r
HOST_SENDCONTROL_DeviceDisconnect = 1, /**< The attached device was disconnected during the\r
* request transfer.\r
*/\r
- HOST_SENDCONTROL_PipeError = 2, /**< An error occured in the pipe while sending the request. */\r
+ HOST_SENDCONTROL_PipeError = 2, /**< An error occurred in the pipe while sending the request. */\r
HOST_SENDCONTROL_SetupStalled = 3, /**< The attached device stalled the request, usually\r
* indicating that the request is unsupported on the device.\r
*/\r
* host mode indicates that VBUS should be applied and a session started.\r
*\r
* There are two different methods of sending a SRP - either pulses on the VBUS line, or by\r
- * pulsing the Data + line via the internal pullup resistor. The SRP mode is given as the\r
+ * pulsing the Data + line via the internal pull-up resistor. The SRP mode is given as the\r
* "type" parameter, and can be either USB_OTG_SRP_VBUS or USB_OTG_STP_DATA.\r
*/\r
#define USB_OTG_DEV_Initiate_SRP(type) MACROS{ OTGCON = ((OTGCON & ~(1 << SRPSEL)) | (type | (1 << SRPREQ))); }MACROE\r
*\r
* Functions, macros and enums related to pipe management when in USB Host mode. This\r
* module contains the pipe management macros, as well as pipe interrupt and data\r
- * send/recieve functions for various datatypes.\r
+ * send/recieve functions for various data types.\r
*/\r
\r
#ifndef __PIPE_H__\r
/** Returns true if the master pipe error flag is set for the currently selected pipe, indicating that\r
* some sort of hardware error has occurred on the pipe.\r
*\r
- * \see Pipe_GetErrorFlags() macro for information on retreiving the exact error flag.\r
+ * \see Pipe_GetErrorFlags() macro for information on retrieving the exact error flag.\r
*/\r
#define Pipe_IsError() ((UPINTX & (1 << PERRI)) ? true : false)\r
\r
* flag for the pipe. */\r
#define Pipe_ClearErrorFlags() MACROS{ UPERRX = 0; }MACROE\r
\r
- /** Returns a mask of the hardware error flags which have occured on the currently selected pipe. This\r
+ /** Returns a mask of the hardware error flags which have occurred on the currently selected pipe. This\r
* value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred.\r
*/\r
#define Pipe_GetErrorFlags() UPERRX\r
\r
/** Returns true if the currently selected pipe may be read from (if data is waiting in the pipe\r
* bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT\r
- * direction). This function will return false if an error has occured in the pipe, or if the pipe\r
+ * direction). This function will return false if an error has occurred in the pipe, or if the pipe\r
* is an IN direction and no packet has been received, or if the pipe is an OUT direction and the\r
* pipe bank is full.\r
*/\r
#define Pipe_ClearSetupOUT() MACROS{ UPINTX &= ~(1 << TXOUTI); UPINTX &= ~(1 << FIFOCON); }MACROE\r
\r
/** Returns true if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on\r
- * the currently selected pipe. This ocurrs when the host sends a packet to the device, but the device\r
+ * the currently selected pipe. This occurs when the host sends a packet to the device, but the device\r
* is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been\r
- * received, it must be cleard using Pipe_ClearNAKReceived() before the previous (or any other) packet\r
+ * received, it must be cleared using Pipe_ClearNAKReceived() before the previous (or any other) packet\r
* can be re-sent.\r
*/\r
#define Pipe_IsNAKReceived() ((UPINTX & (1 << NAKEDI)) ? true : false)\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \param Buffer Pointer to the source data buffer to read from.\r
* \param Length Number of bytes to read for the currently selected pipe into the buffer.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \param Buffer Pointer to the source data buffer to read from.\r
* \param Length Number of bytes to read for the currently selected pipe into the buffer.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \param Length Number of bytes to send via the currently selected pipe.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \param Buffer Pointer to the source data buffer to write to.\r
* \param Length Number of bytes to read for the currently selected pipe to read from.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.\r
*/\r
*\r
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token\r
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
- * and this function has the Callback parameter ommitted.\r
+ * and this function has the Callback parameter omitted.\r
*\r
* \param Buffer Pointer to the source data buffer to write to.\r
* \param Length Number of bytes to read for the currently selected pipe to read from.\r
- * \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback\r
+ * \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback\r
*\r
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.\r
*/\r
#define Pipe_Ignore_DWord() Pipe_Discard_DWord()\r
\r
/** Alias for Pipe_Read_Word_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Pipe_Read_Word() Pipe_Read_Word_LE()\r
\r
/** Alias for Pipe_Write_Word_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Pipe_Write_Word(Word) Pipe_Write_Word_LE(Word)\r
\r
/** Alias for Pipe_Read_DWord_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Pipe_Read_DWord() Pipe_Read_DWord_LE()\r
\r
/** Alias for Pipe_Write_DWord_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#define Pipe_Write_DWord(DWord) Pipe_Write_DWord_LE(DWord)\r
\r
/** Alias for Pipe_Read_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#if !defined(NO_STREAM_CALLBACKS)\r
#define Pipe_Read_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)\r
#endif\r
\r
/** Alias for Pipe_Write_Stream_LE(). By default USB transfers use little endian format, thus\r
- * the command with no endianness specifier indicates little endian mode.\r
+ * the command with no endianness specified indicates little endian mode.\r
*/\r
#if !defined(NO_STREAM_CALLBACKS)\r
#define Pipe_Write_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)\r
* The constants NUM_BLOCKS, BLOCK_SIZE and NUM_HANDLES must be defined in the project makefile (and passed to the\r
* preprocessor via the -D GCC switch) for this library to compile.\r
*\r
- * NUM_BLOCKS indicates the number of memory blocks in the memory psudoheap which can be chaned together and handed\r
+ * NUM_BLOCKS indicates the number of memory blocks in the memory psudoheap which can be chained together and handed\r
* to the application via a memory handle. NUM_HANDLES is the maximum number of memory handles (pointing to one or\r
- * more chained memory blocks) which can be handed out simultaneously before requring a handle (and its associated\r
+ * more chained memory blocks) which can be handed out simultaneously before requiring a handle (and its associated\r
* memory) to be freed. BLOCK_SIZE gives the number of bytes in each memory block.\r
*/\r
\r
/* Public Interface - May be used in end-application: */\r
/* Macros: */\r
/** Macro to dereference a given memory handle into the given type. The given type should be a pointer\r
- * if the memory is to contain an array of items, or should be a standard type (such as a primative or\r
+ * if the memory is to contain an array of items, or should be a standard type (such as a primitive or\r
* structure) if the memory is to hold a single item of a single type. */\r
#define DEREF(handle, type) (*(type*)handle)\r
\r
\r
/** \file\r
*\r
- * Simple round-robbin cooperative scheduler for use in basic projects where non realtime tasks need\r
+ * Simple round-robbin cooperative scheduler for use in basic projects where non real-time tasks need\r
* to be executed. Each task is executed in sequence, and can be enabled or disabled individually or as a group.\r
*\r
- * For a task to yield it must return, thus each task should have persistant data marked with the static attribute.\r
+ * For a task to yield it must return, thus each task should have persistent data marked with the static attribute.\r
*\r
* Usage Example:\r
* \code\r
#define Scheduler_Start() Scheduler_GoSchedule(TOTAL_TASKS);\r
\r
/** Initializes the scheduler so that the scheduler functions can be called before the scheduler itself\r
- * is started. This must be exeucted before any scheduler function calls other than Scheduler_Start(),\r
- * and can be ommitted if no such functions could be called before the scheduler is started.\r
+ * is started. This must be executed before any scheduler function calls other than Scheduler_Start(),\r
+ * and can be omitted if no such functions could be called before the scheduler is started.\r
*/\r
#define Scheduler_Init() Scheduler_InitScheduler(TOTAL_TASKS);\r
\r
*\r
* Usage Example:\r
* \code\r
- * static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on startup\r
+ * static SchedulerDelayCounter_t DelayCounter = 10000; // Force immediate run on start-up\r
* \r
* // Task runs every 10000 ticks, 10 seconds for this demo\r
* if (Scheduler_HasDelayElapsed(10000, &DelayCounter))\r
/* Macros: */\r
#if (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \\r
defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__)) || defined(__DOXYGEN__)\r
- /** Maximum number of bits which can be stored into a bit buffer. The memory usage is one eigth of this value per buffer. */\r
+ /** Maximum number of bits which can be stored into a bit buffer. The memory usage is one eighth of this value per buffer. */\r
#define MAX_BITS 8192\r
#else\r
#define MAX_BITS 1024\r
\r
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h\r
* documentation) by the application code so that the address and size of a requested descriptor can be given\r
- * to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function\r
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function\r
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the\r
* USB host.\r
*/\r
/** Circular buffer to hold the read bits from track 3 of the inserted magnetic card. */\r
BitBuffer_t Track3Data;\r
\r
-/** Delay counter between sucessive key strokes. This is to prevent the OS from ignoring multiple keys in a short\r
+/** Delay counter between successive key strokes. This is to prevent the OS from ignoring multiple keys in a short\r
* period of time due to key repeats. Two milliseconds works for most OSes.\r
*/\r
uint8_t KeyDelayRemaining;\r
/* Set the flag indicating that a null report must eventually be sent to release all pressed keys */\r
MustRelease = true;\r
\r
- /* Only send the next key on odd reports, so that they are interpersed with null reports to release keys */\r
+ /* Only send the next key on odd reports, so that they are interspersed with null reports to release keys */\r
if (OddReport)\r
{\r
/* Set the report key code to the key code for the next data bit */\r
return false;\r
}\r
\r
-/** Task to read out data from inserted magnetic cards and place the seperate track data into their respective\r
+/** Task to read out data from inserted magnetic cards and place the separate track data into their respective\r
* data buffers for later sending to the host as keyboard key presses.\r
*/\r
TASK(Magstripe_Read)\r
{\r
- /* Arrays to hold the buffer pointers, clock and data bit masks for the seperate card tracks */\r
+ /* Arrays to hold the buffer pointers, clock and data bit masks for the separate card tracks */\r
const struct\r
{\r
BitBuffer_t* Buffer;\r
}\r
\r
/** Task for the magnetic card reading and keyboard report generation. This task waits until a card is inserted,\r
- * then reads off the card data and sends it to the host as a series of keyboard keypresses via keyboard reports.\r
+ * then reads off the card data and sends it to the host as a series of keyboard key presses via keyboard reports.\r
*/\r
TASK(USB_Keyboard_Report)\r
{\r