Renamed SERIAL_STREAM_ASSERT() macro to STDOUT_ASSERT().
Minor tweaks to the library documentation.
This commit is contained in:
parent
69dc32c5f0
commit
deed746d37
47 changed files with 917 additions and 910 deletions
|
|
@ -79,22 +79,22 @@
|
|||
/** Descriptor header constant to indicate a Audio class endpoint descriptor. */
|
||||
#define DTYPE_AudioEndpoint 0x25
|
||||
|
||||
/** Audio class descriptor subtype value for a Audio class specific header descriptor. */
|
||||
/** Audio class descriptor subtype value for a Audio class-specific header descriptor. */
|
||||
#define DSUBTYPE_Header 0x01
|
||||
|
||||
/** Audio class descriptor subtype value for an Output Terminal Audio class specific descriptor. */
|
||||
/** Audio class descriptor subtype value for an Output Terminal Audio class-specific descriptor. */
|
||||
#define DSUBTYPE_InputTerminal 0x02
|
||||
|
||||
/** Audio class descriptor subtype value for an Input Terminal Audio class specific descriptor. */
|
||||
/** Audio class descriptor subtype value for an Input Terminal Audio class-specific descriptor. */
|
||||
#define DSUBTYPE_OutputTerminal 0x03
|
||||
|
||||
/** Audio class descriptor subtype value for a Feature Unit Audio class specific descriptor. */
|
||||
/** Audio class descriptor subtype value for a Feature Unit Audio class-specific descriptor. */
|
||||
#define DSUBTYPE_FeatureUnit 0x06
|
||||
|
||||
/** Audio class descriptor subtype value for a general Audio class specific descriptor. */
|
||||
/** Audio class descriptor subtype value for a general Audio class-specific descriptor. */
|
||||
#define DSUBTYPE_General 0x01
|
||||
|
||||
/** Audio class descriptor subtype value for an Audio class specific descriptor indicating the format of an audio stream. */
|
||||
/** Audio class descriptor subtype value for an Audio class-specific descriptor indicating the format of an audio stream. */
|
||||
#define DSUBTYPE_Format 0x02
|
||||
|
||||
/** Supported channel mask for an Audio class terminal descriptor. See the Audio class specification for more details. */
|
||||
|
|
@ -225,175 +225,175 @@
|
|||
*/
|
||||
#define AUDIO_SAMPLE_FREQ(freq) {LowWord: ((uint32_t)freq & 0x00FFFF), HighByte: (((uint32_t)freq >> 16) & 0x0000FF)}
|
||||
|
||||
/** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
|
||||
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
|
||||
* accepts only filled endpoint packets of audio samples.
|
||||
*/
|
||||
#define EP_ACCEPTS_ONLY_FULL_PACKETS (1 << 7)
|
||||
|
||||
/** Mask for the attributes parameter of an Audio class specific Endpoint descriptor, indicating that the endpoint
|
||||
/** Mask for the attributes parameter of an Audio class-specific Endpoint descriptor, indicating that the endpoint
|
||||
* will accept partially filled endpoint packets of audio samples.
|
||||
*/
|
||||
#define EP_ACCEPTS_SMALL_PACKETS (0 << 7)
|
||||
|
||||
/* Type Defines: */
|
||||
/** \brief Audio Class Specific Interface Descriptor.
|
||||
/** \brief Audio class-specific Interface Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific interface descriptor. This follows a regular interface descriptor to
|
||||
* Type define for an Audio class-specific interface descriptor. This follows a regular interface descriptor to
|
||||
* supply extra information about the audio device's layout to the host. See the USB Audio specification for more
|
||||
* details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
|
||||
uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
|
||||
uint16_t ACSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version. */
|
||||
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
|
||||
|
||||
uint8_t InCollection; /**< Total number of audio class interfaces within this device */
|
||||
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface */
|
||||
uint8_t InCollection; /**< Total number of audio class interfaces within this device. */
|
||||
uint8_t InterfaceNumbers[1]; /**< Interface numbers of each audio interface. */
|
||||
} USB_Audio_Interface_AC_t;
|
||||
|
||||
/** \brief Audio Class Specific Feature Unit Descriptor.
|
||||
/** \brief Audio class-specific Feature Unit Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific Feature Unit descriptor. This indicates to the host what features
|
||||
* Type define for an Audio class-specific Feature Unit descriptor. This indicates to the host what features
|
||||
* are present in the device's audio stream for basic control, such as per-channel volume. See the USB Audio
|
||||
* specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device */
|
||||
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit */
|
||||
uint8_t UnitID; /**< ID value of this feature unit - must be a unique value within the device. */
|
||||
uint8_t SourceID; /**< Source ID value of the audio source input into this feature unit. */
|
||||
|
||||
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array */
|
||||
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel */
|
||||
uint8_t ControlSize; /**< Size of each element in the ChanelControlls array. */
|
||||
uint8_t ChannelControls[3]; /**< Feature masks for the control channel, and each separate audio channel. */
|
||||
|
||||
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
|
||||
uint8_t FeatureUnitStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
|
||||
} USB_Audio_FeatureUnit_t;
|
||||
|
||||
/** \brief Audio Class Specific Input Terminal Descriptor.
|
||||
/** \brief Audio class-specific Input Terminal Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific input terminal descriptor. This indicates to the host that the device
|
||||
* Type define for an Audio class-specific input terminal descriptor. This indicates to the host that the device
|
||||
* contains an input audio source, either from a physical terminal on the device, or a logical terminal (for example,
|
||||
* a USB endpoint). See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
|
||||
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
|
||||
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
|
||||
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
|
||||
uint8_t AssociatedOutputTerminal; /**< ID of associated output terminal, for physically grouped terminals
|
||||
* such as the speaker and microphone of a phone handset
|
||||
* such as the speaker and microphone of a phone handset.
|
||||
*/
|
||||
uint8_t TotalChannels; /**< Total number of separate audio channels within this interface (right, left, etc.) */
|
||||
uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal */
|
||||
uint16_t ChannelConfig; /**< CHANNEL_* masks indicating what channel layout is supported by this terminal. */
|
||||
|
||||
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device */
|
||||
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
|
||||
uint8_t ChannelStrIndex; /**< Index of a string descriptor describing this channel within the device. */
|
||||
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
|
||||
} USB_Audio_InputTerminal_t;
|
||||
|
||||
/** \brief Audio Class Specific Output Terminal Descriptor.
|
||||
/** \brief Audio class-specific Output Terminal Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific output terminal descriptor. This indicates to the host that the device
|
||||
* Type define for an Audio class-specific output terminal descriptor. This indicates to the host that the device
|
||||
* contains an output audio sink, either to a physical terminal on the device, or a logical terminal (for example,
|
||||
* a USB endpoint). See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device */
|
||||
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask */
|
||||
uint8_t TerminalID; /**< ID value of this terminal unit - must be a unique value within the device. */
|
||||
uint16_t TerminalType; /**< Type of terminal, a TERMINAL_* mask. */
|
||||
uint8_t AssociatedInputTerminal; /**< ID of associated input terminal, for physically grouped terminals
|
||||
* such as the speaker and microphone of a phone handset
|
||||
* such as the speaker and microphone of a phone handset.
|
||||
*/
|
||||
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from */
|
||||
uint8_t SourceID; /**< ID value of the unit this terminal's audio is sourced from. */
|
||||
|
||||
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
|
||||
uint8_t TerminalStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
|
||||
} USB_Audio_OutputTerminal_t;
|
||||
|
||||
/** \brief Audio Class Specific Streaming Audio Interface Descriptor.
|
||||
/** \brief Audio class-specific Streaming Audio Interface Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific streaming interface descriptor. This indicates to the host
|
||||
* Type define for an Audio class-specific streaming interface descriptor. This indicates to the host
|
||||
* how audio streams within the device are formatted. See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing */
|
||||
uint8_t TerminalLink; /**< ID value of the output terminal this descriptor is describing. */
|
||||
|
||||
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output */
|
||||
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification */
|
||||
uint8_t FrameDelay; /**< Delay in frames resulting from the complete sample processing from input to output. */
|
||||
uint16_t AudioFormat; /**< Format of the audio stream, see Audio Device Formats specification. */
|
||||
} USB_Audio_Interface_AS_t;
|
||||
|
||||
/** \brief 24-Bit Audio Frequency Structure.
|
||||
*
|
||||
* Type define for a 24bit audio sample frequency structure. GCC does not contain a built in 24bit datatype,
|
||||
* this this structure is used to build up the value instead. Fill this structure with the SAMPLE_FREQ() macro.
|
||||
* this this structure is used to build up the value instead. Fill this structure with the \ref AUDIO_SAMPLE_FREQ() macro.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t LowWord; /**< Low 16 bits of the 24-bit value */
|
||||
uint8_t HighByte; /**< Upper 8 bits of the 24-bit value */
|
||||
uint16_t LowWord; /**< Low 16 bits of the 24-bit value. */
|
||||
uint8_t HighByte; /**< Upper 8 bits of the 24-bit value. */
|
||||
} USB_Audio_SampleFreq_t;
|
||||
|
||||
/** \brief Audio Class Specific Format Descriptor.
|
||||
/** \brief Audio class-specific Format Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific audio format descriptor. This is used to give the host full details
|
||||
* Type define for an Audio class-specific audio format descriptor. This is used to give the host full details
|
||||
* about the number of channels, the sample resolution, acceptable sample frequencies and encoding method used
|
||||
* in the device's audio streams. See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification */
|
||||
uint8_t Channels; /**< Total number of discrete channels in the stream */
|
||||
uint8_t FormatType; /**< Format of the audio stream, see Audio Device Formats specification. */
|
||||
uint8_t Channels; /**< Total number of discrete channels in the stream. */
|
||||
|
||||
uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream */
|
||||
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream */
|
||||
uint8_t SubFrameSize; /**< Size in bytes of each channel's sample data in the stream. */
|
||||
uint8_t BitResolution; /**< Bits of resolution of each channel's samples in the stream. */
|
||||
|
||||
uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device */
|
||||
USB_Audio_SampleFreq_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES]; /**< Sample frequencies supported by the device */
|
||||
uint8_t SampleFrequencyType; /**< Total number of sample frequencies supported by the device. */
|
||||
USB_Audio_SampleFreq_t SampleFrequencies[AUDIO_TOTAL_SAMPLE_RATES]; /**< Sample frequencies supported by the device. */
|
||||
} USB_Audio_Format_t;
|
||||
|
||||
/** \brief Audio Class Specific Streaming Endpoint Descriptor.
|
||||
/** \brief Audio class-specific Streaming Endpoint Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific endpoint descriptor. This contains a regular endpoint
|
||||
* descriptor with a few Audio-class specific extensions. See the USB Audio specification for more details.
|
||||
* Type define for an Audio class-specific endpoint descriptor. This contains a regular endpoint
|
||||
* descriptor with a few Audio-class-specific extensions. See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint */
|
||||
USB_Descriptor_Endpoint_t Endpoint; /**< Standard endpoint descriptor describing the audio endpoint. */
|
||||
|
||||
uint8_t Refresh; /**< Always set to zero */
|
||||
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronization information to, if needed (zero otherwise) */
|
||||
uint8_t Refresh; /**< Always set to zero for Audio class devices. */
|
||||
uint8_t SyncEndpointNumber; /**< Endpoint address to send synchronization information to, if needed (zero otherwise). */
|
||||
} USB_Audio_StreamEndpoint_Std_t;
|
||||
|
||||
/** \brief Audio Class Specific Extended Endpoint Descriptor.
|
||||
/** \brief Audio class-specific Extended Endpoint Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific extended endpoint descriptor. This contains extra information
|
||||
* Type define for an Audio class-specific extended endpoint descriptor. This contains extra information
|
||||
* on the usage of endpoints used to stream audio in and out of the USB Audio device, and follows an Audio
|
||||
* class specific extended endpoint descriptor. See the USB Audio specification for more details.
|
||||
* class-specific extended endpoint descriptor. See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t Attributes; /**< Audio class specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS */
|
||||
uint8_t Attributes; /**< Audio class-specific endpoint attributes, such as ACCEPTS_SMALL_PACKETS. */
|
||||
|
||||
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
|
||||
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
|
||||
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification. */
|
||||
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry. */
|
||||
} USB_Audio_StreamEndpoint_Spc_t;
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
|
|
@ -66,22 +66,22 @@
|
|||
#endif
|
||||
|
||||
/* Macros: */
|
||||
/** CDC Class specific request to get the current virtual serial port configuration settings. */
|
||||
/** CDC class-specific request to get the current virtual serial port configuration settings. */
|
||||
#define REQ_GetLineEncoding 0x21
|
||||
|
||||
/** CDC Class specific request to set the current virtual serial port configuration settings. */
|
||||
/** CDC class-specific request to set the current virtual serial port configuration settings. */
|
||||
#define REQ_SetLineEncoding 0x20
|
||||
|
||||
/** CDC Class specific request to set the current virtual serial port handshake line states. */
|
||||
/** CDC class-specific request to set the current virtual serial port handshake line states. */
|
||||
#define REQ_SetControlLineState 0x22
|
||||
|
||||
/** CDC Class specific request to send a break to the receiver via the carrier channel. */
|
||||
/** CDC class-specific request to send a break to the receiver via the carrier channel. */
|
||||
#define REQ_SendBreak 0x23
|
||||
|
||||
/** CDC Class specific request to send an encapsulated command to the device. */
|
||||
/** CDC class-specific request to send an encapsulated command to the device. */
|
||||
#define REQ_SendEncapsulatedCommand 0x00
|
||||
|
||||
/** CDC Class specific request to retrieve an encapsulated command response from the device. */
|
||||
/** CDC class-specific request to retrieve an encapsulated command response from the device. */
|
||||
#define REQ_GetEncapsulatedResponse 0x01
|
||||
|
||||
/** Notification type constant for a change in the virtual serial port handshake line states, for
|
||||
|
|
@ -90,47 +90,47 @@
|
|||
*/
|
||||
#define NOTIF_SerialState 0x20
|
||||
|
||||
/** Mask for the DTR handshake line for use with the REQ_SetControlLineState class specific request
|
||||
/** Mask for the DTR handshake line for use with the REQ_SetControlLineState class-specific request
|
||||
* from the host, to indicate that the DTR line state should be high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_OUT_DTR (1 << 0)
|
||||
|
||||
/** Mask for the RTS handshake line for use with the REQ_SetControlLineState class specific request
|
||||
/** Mask for the RTS handshake line for use with the REQ_SetControlLineState class-specific request
|
||||
* from the host, to indicate that theRTS line state should be high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_OUT_RTS (1 << 1)
|
||||
|
||||
/** Mask for the DCD handshake line for use with the a NOTIF_SerialState class specific notification
|
||||
/** Mask for the DCD handshake line for use with the a NOTIF_SerialState class-specific notification
|
||||
* from the device to the host, to indicate that the DCD line state is currently high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_DCD (1 << 0)
|
||||
|
||||
/** Mask for the DSR handshake line for use with the a NOTIF_SerialState class specific notification
|
||||
/** Mask for the DSR handshake line for use with the a NOTIF_SerialState class-specific notification
|
||||
* from the device to the host, to indicate that the DSR line state is currently high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_DSR (1 << 1)
|
||||
|
||||
/** Mask for the BREAK handshake line for use with the a NOTIF_SerialState class specific notification
|
||||
/** Mask for the BREAK handshake line for use with the a NOTIF_SerialState class-specific notification
|
||||
* from the device to the host, to indicate that the BREAK line state is currently high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_BREAK (1 << 2)
|
||||
|
||||
/** Mask for the RING handshake line for use with the a NOTIF_SerialState class specific notification
|
||||
/** Mask for the RING handshake line for use with the a NOTIF_SerialState class-specific notification
|
||||
* from the device to the host, to indicate that the RING line state is currently high.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_RING (1 << 3)
|
||||
|
||||
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
|
||||
/** Mask for use with the a NOTIF_SerialState class-specific notification from the device to the host,
|
||||
* to indicate that a framing error has occurred on the virtual serial port.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_FRAMEERROR (1 << 4)
|
||||
|
||||
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
|
||||
/** Mask for use with the a NOTIF_SerialState class-specific notification from the device to the host,
|
||||
* to indicate that a parity error has occurred on the virtual serial port.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_PARITYERROR (1 << 5)
|
||||
|
||||
/** Mask for use with the a NOTIF_SerialState class specific notification from the device to the host,
|
||||
/** Mask for use with the a NOTIF_SerialState class-specific notification from the device to the host,
|
||||
* to indicate that a data overrun error has occurred on the virtual serial port.
|
||||
*/
|
||||
#define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6)
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
* a single typedef struct. A macro is used instead so that functional descriptors can be created
|
||||
* easily by specifying the size of the payload. This allows sizeof() to work correctly.
|
||||
*
|
||||
* \param[in] DataSize Size in bytes of the CDC functional descriptor's data payload
|
||||
* \param[in] DataSize Size in bytes of the CDC functional descriptor's data payload.
|
||||
*/
|
||||
#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize) \
|
||||
struct \
|
||||
|
|
@ -152,21 +152,21 @@
|
|||
|
||||
/* Enums: */
|
||||
/** Enum for the possible line encoding formats of a virtual serial port. */
|
||||
enum CDC_LineCodingFormats_t
|
||||
enum CDC_LineEncodingFormats_t
|
||||
{
|
||||
CDC_LINEENCODING_OneStopBit = 0, /**< Each frame contains one stop bit */
|
||||
CDC_LINEENCODING_OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits */
|
||||
CDC_LINEENCODING_TwoStopBits = 2, /**< Each frame contains two stop bits */
|
||||
CDC_LINEENCODING_OneStopBit = 0, /**< Each frame contains one stop bit. */
|
||||
CDC_LINEENCODING_OneAndAHalfStopBits = 1, /**< Each frame contains one and a half stop bits. */
|
||||
CDC_LINEENCODING_TwoStopBits = 2, /**< Each frame contains two stop bits. */
|
||||
};
|
||||
|
||||
/** Enum for the possible line encoding parity settings of a virtual serial port. */
|
||||
enum CDC_LineCodingParity_t
|
||||
enum CDC_LineEncodingParity_t
|
||||
{
|
||||
CDC_PARITY_None = 0, /**< No parity bit mode on each frame */
|
||||
CDC_PARITY_Odd = 1, /**< Odd parity bit mode on each frame */
|
||||
CDC_PARITY_Even = 2, /**< Even parity bit mode on each frame */
|
||||
CDC_PARITY_Mark = 3, /**< Mark parity bit mode on each frame */
|
||||
CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame */
|
||||
CDC_PARITY_None = 0, /**< No parity bit mode on each frame. */
|
||||
CDC_PARITY_Odd = 1, /**< Odd parity bit mode on each frame. */
|
||||
CDC_PARITY_Even = 2, /**< Even parity bit mode on each frame. */
|
||||
CDC_PARITY_Mark = 3, /**< Mark parity bit mode on each frame. */
|
||||
CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame. */
|
||||
};
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
|
|
@ -61,22 +61,22 @@
|
|||
#endif
|
||||
|
||||
/* Macros: */
|
||||
/** HID Class Specific Request to get the current HID report from the device. */
|
||||
/** HID class-specific Request to get the current HID report from the device. */
|
||||
#define REQ_GetReport 0x01
|
||||
|
||||
/** HID Class Specific Request to get the current device idle count. */
|
||||
/** HID class-specific Request to get the current device idle count. */
|
||||
#define REQ_GetIdle 0x02
|
||||
|
||||
/** HID Class Specific Request to set the current HID report to the device. */
|
||||
/** HID class-specific Request to set the current HID report to the device. */
|
||||
#define REQ_SetReport 0x09
|
||||
|
||||
/** HID Class Specific Request to set the device's idle count. */
|
||||
/** HID class-specific Request to set the device's idle count. */
|
||||
#define REQ_SetIdle 0x0A
|
||||
|
||||
/** HID Class Specific Request to get the current HID report protocol mode. */
|
||||
/** HID class-specific Request to get the current HID report protocol mode. */
|
||||
#define REQ_GetProtocol 0x03
|
||||
|
||||
/** HID Class Specific Request to set the current HID report protocol mode. */
|
||||
/** HID class-specific Request to set the current HID report protocol mode. */
|
||||
#define REQ_SetProtocol 0x0B
|
||||
|
||||
/** Descriptor header type value, to indicate a HID class HID descriptor. */
|
||||
|
|
@ -145,22 +145,22 @@
|
|||
REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */
|
||||
};
|
||||
|
||||
/** \brief HID Class Specific HID Descriptor.
|
||||
/** \brief HID class-specific HID Descriptor.
|
||||
*
|
||||
* Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
|
||||
* Type define for the HID class-specific HID descriptor, to describe the HID device's specifications. Refer to the HID
|
||||
* specification for details on the structure elements.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header;
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
|
||||
uint16_t HIDSpec;
|
||||
uint8_t CountryCode;
|
||||
uint16_t HIDSpec; /**< BCD encoded version that the HID descriptor and device complies to. */
|
||||
uint8_t CountryCode; /**< Country code of the localized device, or zero if universal. */
|
||||
|
||||
uint8_t TotalReportDescriptors;
|
||||
uint8_t TotalReportDescriptors; /**< Total number of HID report descriptors for the interface. */
|
||||
|
||||
uint8_t HIDReportType;
|
||||
uint16_t HIDReportLength;
|
||||
uint8_t HIDReportType; /**< Type of HID report, set to \ref DTYPE_Report. */
|
||||
uint16_t HIDReportLength; /**< Length of the associated HID report descriptor, in bytes. */
|
||||
} USB_HID_Descriptor_t;
|
||||
|
||||
/** \brief Standard HID Boot Protocol Mouse Report.
|
||||
|
|
@ -169,9 +169,9 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Button; /**< Button mask for currently pressed buttons in the mouse */
|
||||
int8_t X; /**< Current delta X movement of the mouse */
|
||||
int8_t Y; /**< Current delta Y movement on the mouse */
|
||||
uint8_t Button; /**< Button mask for currently pressed buttons in the mouse. */
|
||||
int8_t X; /**< Current delta X movement of the mouse. */
|
||||
int8_t Y; /**< Current delta Y movement on the mouse. */
|
||||
} USB_MouseReport_Data_t;
|
||||
|
||||
/** \brief Standard HID Boot Protocol Keyboard Report.
|
||||
|
|
@ -181,10 +181,10 @@
|
|||
typedef struct
|
||||
{
|
||||
uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of
|
||||
* HID_KEYBOARD_MODIFER_* masks)
|
||||
* HID_KEYBOARD_MODIFER_* masks).
|
||||
*/
|
||||
uint8_t Reserved; /**< Reserved for OEM use, always set to 0 */
|
||||
uint8_t KeyCode[6]; /**< Key codes of the currently pressed keys */
|
||||
uint8_t Reserved; /**< Reserved for OEM use, always set to 0. */
|
||||
uint8_t KeyCode[6]; /**< Key codes of the currently pressed keys. */
|
||||
} USB_KeyboardReport_Data_t;
|
||||
|
||||
/** Type define for the data type used to store HID report descriptor elements. */
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@
|
|||
#endif
|
||||
|
||||
/* Macros: */
|
||||
/** Audio class descriptor subtype value for a Audio class specific MIDI input jack descriptor. */
|
||||
/** Audio class descriptor subtype value for a Audio class-specific MIDI input jack descriptor. */
|
||||
#define DSUBTYPE_InputJack 0x02
|
||||
|
||||
/** Audio class descriptor subtype value for a Audio class specific MIDI output jack descriptor. */
|
||||
/** Audio class descriptor subtype value for a Audio class-specific MIDI output jack descriptor. */
|
||||
#define DSUBTYPE_OutputJack 0x03
|
||||
|
||||
/** Audio class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
|
||||
|
|
@ -94,75 +94,77 @@
|
|||
/** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel
|
||||
* addresses are zero-indexed. This converts a natural MIDI channel number into the logical channel address.
|
||||
*
|
||||
* \param[in] channel MIDI channel number to address
|
||||
* \param[in] channel MIDI channel number to address.
|
||||
*/
|
||||
#define MIDI_CHANNEL(channel) ((channel) - 1)
|
||||
|
||||
/* Type Defines: */
|
||||
/** \brief MIDI Class Specific Streaming Interface Descriptor.
|
||||
/** \brief MIDI class-specific Streaming Interface Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific MIDI streaming interface descriptor. This indicates to the host
|
||||
* how MIDI the specification compliance of the device and the total length of the Audio class specific descriptors.
|
||||
* Type define for an Audio class-specific MIDI streaming interface descriptor. This indicates to the host
|
||||
* how MIDI the specification compliance of the device and the total length of the Audio class-specific descriptors.
|
||||
* See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class specification version */
|
||||
uint16_t TotalLength; /**< Total length of the Audio class specific descriptors, including this descriptor */
|
||||
uint16_t AudioSpecification; /**< Binary coded decimal value, indicating the supported Audio Class
|
||||
* specification version.
|
||||
*/
|
||||
uint16_t TotalLength; /**< Total length of the Audio class-specific descriptors, including this descriptor. */
|
||||
} USB_MIDI_AudioInterface_AS_t;
|
||||
|
||||
/** \brief MIDI Class Specific Input Jack Descriptor.
|
||||
/** \brief MIDI class-specific Input Jack Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific MIDI IN jack. This gives information to the host on a MIDI input, either
|
||||
* Type define for an Audio class-specific MIDI IN jack. This gives information to the host on a MIDI input, either
|
||||
* a physical input jack, or a logical jack (receiving input data internally, or from the host via an endpoint).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values */
|
||||
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device */
|
||||
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
|
||||
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device. */
|
||||
|
||||
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
|
||||
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
|
||||
} USB_MIDI_In_Jack_t;
|
||||
|
||||
/** \brief MIDI Class Specific Output Jack Descriptor.
|
||||
/** \brief MIDI class-specific Output Jack Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific MIDI OUT jack. This gives information to the host on a MIDI output, either
|
||||
* Type define for an Audio class-specific MIDI OUT jack. This gives information to the host on a MIDI output, either
|
||||
* a physical output jack, or a logical jack (sending output data internally, or to the host via an endpoint).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values */
|
||||
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device */
|
||||
uint8_t JackType; /**< Type of jack, one of the JACKTYPE_* mask values. */
|
||||
uint8_t JackID; /**< ID value of this jack - must be a unique value within the device. */
|
||||
|
||||
uint8_t NumberOfPins; /**< Number of output channels within the jack, either physical or logical */
|
||||
uint8_t SourceJackID[1]; /**< ID of each output pin's source data jack */
|
||||
uint8_t SourcePinID[1]; /**< Pin number in the input jack of each output pin's source data */
|
||||
uint8_t NumberOfPins; /**< Number of output channels within the jack, either physical or logical. */
|
||||
uint8_t SourceJackID[1]; /**< ID of each output pin's source data jack. */
|
||||
uint8_t SourcePinID[1]; /**< Pin number in the input jack of each output pin's source data. */
|
||||
|
||||
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device */
|
||||
uint8_t JackStrIndex; /**< Index of a string descriptor describing this descriptor within the device. */
|
||||
} USB_MIDI_Out_Jack_t;
|
||||
|
||||
/** \brief Audio Class Specific Jack Endpoint Descriptor.
|
||||
/** \brief Audio class-specific Jack Endpoint Descriptor.
|
||||
*
|
||||
* Type define for an Audio class specific extended MIDI jack endpoint descriptor. This contains extra information
|
||||
* Type define for an Audio class-specific extended MIDI jack endpoint descriptor. This contains extra information
|
||||
* on the usage of MIDI endpoints used to stream MIDI events in and out of the USB Audio device, and follows an Audio
|
||||
* class specific extended MIDI endpoint descriptor. See the USB Audio specification for more details.
|
||||
* class-specific extended MIDI endpoint descriptor. See the USB Audio specification for more details.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class specific descriptors */
|
||||
USB_Descriptor_Header_t Header; /**< Regular descriptor header containing the descriptor's type and length. */
|
||||
uint8_t Subtype; /**< Sub type value used to distinguish between audio class-specific descriptors. */
|
||||
|
||||
uint8_t TotalEmbeddedJacks; /**< Total number of jacks inside this endpoint */
|
||||
uint8_t AssociatedJackID[1]; /**< IDs of each jack inside the endpoint */
|
||||
uint8_t TotalEmbeddedJacks; /**< Total number of jacks inside this endpoint. */
|
||||
uint8_t AssociatedJackID[1]; /**< IDs of each jack inside the endpoint. */
|
||||
} USB_MIDI_Jack_Endpoint_t;
|
||||
|
||||
/** \brief MIDI Class Driver Event Packet.
|
||||
|
|
@ -171,12 +173,12 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char Command : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet */
|
||||
unsigned char CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface */
|
||||
unsigned char Command : 4; /**< Upper nibble of the MIDI command being sent or received in the event packet. */
|
||||
unsigned char CableNumber : 4; /**< Virtual cable number of the event being sent or received in the given MIDI interface. */
|
||||
|
||||
uint8_t Data1; /**< First byte of data in the MIDI event */
|
||||
uint8_t Data2; /**< Second byte of data in the MIDI event */
|
||||
uint8_t Data3; /**< Third byte of data in the MIDI event */
|
||||
uint8_t Data1; /**< First byte of data in the MIDI event. */
|
||||
uint8_t Data2; /**< Second byte of data in the MIDI event. */
|
||||
uint8_t Data3; /**< Third byte of data in the MIDI event. */
|
||||
} MIDI_EventPacket_t;
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
|
|
@ -66,10 +66,10 @@
|
|||
#endif
|
||||
|
||||
/* Macros: */
|
||||
/** Mass Storage Class specific request to reset the Mass Storage interface, ready for the next command. */
|
||||
/** Mass Storage class-specific request to reset the Mass Storage interface, ready for the next command. */
|
||||
#define REQ_MassStorageReset 0xFF
|
||||
|
||||
/** Mass Storage Class specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
|
||||
/** Mass Storage class-specific request to retrieve the total number of Logical Units (drives) in the SCSI device. */
|
||||
#define REQ_GetMaxLUN 0xFE
|
||||
|
||||
/** Magic signature for a Command Block Wrapper used in the Mass Storage Bulk-Only transport protocol. */
|
||||
|
|
@ -211,13 +211,13 @@
|
|||
* Type define for a Command Block Wrapper, used in the Mass Storage Bulk-Only Transport protocol. */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Signature; /**< Command block signature, must be CBW_SIGNATURE to indicate a valid Command Block */
|
||||
uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
|
||||
uint32_t DataTransferLength; /**< Length of the optional data portion of the issued command, in bytes */
|
||||
uint8_t Flags; /**< Command block flags, indicating command data direction */
|
||||
uint8_t LUN; /**< Logical Unit number this command is issued to */
|
||||
uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array */
|
||||
uint8_t SCSICommandData[16]; /**< Issued SCSI command in the Command Block */
|
||||
uint32_t Signature; /**< Command block signature, must be CBW_SIGNATURE to indicate a valid Command Block. */
|
||||
uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
|
||||
uint32_t DataTransferLength; /**< Length of the optional data portion of the issued command, in bytes. */
|
||||
uint8_t Flags; /**< Command block flags, indicating command data direction. */
|
||||
uint8_t LUN; /**< Logical Unit number this command is issued to. */
|
||||
uint8_t SCSICommandLength; /**< Length of the issued SCSI command within the SCSI command data array. */
|
||||
uint8_t SCSICommandData[16]; /**< Issued SCSI command in the Command Block. */
|
||||
} MS_CommandBlockWrapper_t;
|
||||
|
||||
/** \brief Mass Storage Class Command Status Wrapper.
|
||||
|
|
@ -226,10 +226,10 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Signature; /**< Status block signature, must be CSW_SIGNATURE to indicate a valid Command Status */
|
||||
uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper */
|
||||
uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command */
|
||||
uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum */
|
||||
uint32_t Signature; /**< Status block signature, must be CSW_SIGNATURE to indicate a valid Command Status. */
|
||||
uint32_t Tag; /**< Unique command ID value, to associate a command block wrapper with its command status wrapper. */
|
||||
uint32_t DataTransferResidue; /**< Number of bytes of data not processed in the SCSI command. */
|
||||
uint8_t Status; /**< Status code of the issued command - a value from the MassStorage_CommandStatusCodes_t enum. */
|
||||
} MS_CommandStatusWrapper_t;
|
||||
|
||||
/** \brief Mass Storage Class SCSI Sense Structure
|
||||
|
|
@ -306,8 +306,10 @@
|
|||
enum MassStorage_CommandStatusCodes_t
|
||||
{
|
||||
SCSI_Command_Pass = 0, /**< Command completed with no error */
|
||||
SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */
|
||||
SCSI_Phase_Error = 2 /**< Command failed due to being invalid in the current phase */
|
||||
SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a
|
||||
* SCSI REQUEST SENSE command.
|
||||
*/
|
||||
SCSI_Phase_Error = 2 /**< Command failed due to being invalid in the current phase. */
|
||||
};
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
|
|
@ -96,25 +96,25 @@
|
|||
/** Enum for the possible NDIS adapter states. */
|
||||
enum RNDIS_States_t
|
||||
{
|
||||
RNDIS_Uninitialized = 0, /**< Adapter currently uninitialized */
|
||||
RNDIS_Initialized = 1, /**< Adapter currently initialized but not ready for data transfers */
|
||||
RNDIS_Data_Initialized = 2, /**< Adapter currently initialized and ready for data transfers */
|
||||
RNDIS_Uninitialized = 0, /**< Adapter currently uninitialized. */
|
||||
RNDIS_Initialized = 1, /**< Adapter currently initialized but not ready for data transfers. */
|
||||
RNDIS_Data_Initialized = 2, /**< Adapter currently initialized and ready for data transfers. */
|
||||
};
|
||||
|
||||
/** Enum for the NDIS hardware states. */
|
||||
enum NDIS_Hardware_Status_t
|
||||
{
|
||||
NDIS_HardwareStatus_Ready, /**< Hardware Ready to accept commands from the host */
|
||||
NDIS_HardwareStatus_Initializing, /**< Hardware busy initializing */
|
||||
NDIS_HardwareStatus_Reset, /**< Hardware reset */
|
||||
NDIS_HardwareStatus_Closing, /**< Hardware currently closing */
|
||||
NDIS_HardwareStatus_NotReady /**< Hardware not ready to accept commands from the host */
|
||||
NDIS_HardwareStatus_Ready, /**< Hardware Ready to accept commands from the host. */
|
||||
NDIS_HardwareStatus_Initializing, /**< Hardware busy initializing. */
|
||||
NDIS_HardwareStatus_Reset, /**< Hardware reset. */
|
||||
NDIS_HardwareStatus_Closing, /**< Hardware currently closing. */
|
||||
NDIS_HardwareStatus_NotReady /**< Hardware not ready to accept commands from the host. */
|
||||
};
|
||||
|
||||
/* Type Defines: */
|
||||
/** \brief MAC Address Structure.
|
||||
*
|
||||
* Type define for a physical MAC address of a device on a network
|
||||
* Type define for a physical MAC address of a device on a network.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
|
|
@ -127,9 +127,9 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */
|
||||
uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer */
|
||||
bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */
|
||||
uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents. */
|
||||
uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer. */
|
||||
bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer. */
|
||||
} Ethernet_Frame_Info_t;
|
||||
|
||||
/** \brief RNDIS Common Message Header Structure.
|
||||
|
|
|
|||
|
|
@ -66,58 +66,58 @@
|
|||
#endif
|
||||
|
||||
/* Macros: */
|
||||
/** Length in bytes of a given Unicode string's character length
|
||||
/** Length in bytes of a given Unicode string's character length.
|
||||
*
|
||||
* \param[in] chars Total number of Unicode characters in the string
|
||||
* \param[in] Chars Total number of Unicode characters in the string.
|
||||
*
|
||||
* \return Number of bytes of the given unicode string
|
||||
* \return Number of bytes of the given unicode string.
|
||||
*/
|
||||
#define UNICODE_STRING_LENGTH(chars) ((chars) << 1)
|
||||
#define UNICODE_STRING_LENGTH(Chars) ((Chars) << 1)
|
||||
|
||||
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
|
||||
* a command container.
|
||||
*
|
||||
* \param[in] params Number of parameters which are to be sent in the Param field of the container
|
||||
* \param[in] Params Number of parameters which are to be sent in the Param field of the container.
|
||||
*/
|
||||
#define PIMA_COMMAND_SIZE(params) ((sizeof(SI_PIMA_Container_t) - 12) + \
|
||||
((params) * sizeof(uint32_t)))
|
||||
#define PIMA_COMMAND_SIZE(Params) ((sizeof(SI_PIMA_Container_t) - 12) + \
|
||||
((Params) * sizeof(uint32_t)))
|
||||
|
||||
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
|
||||
* a data container.
|
||||
*
|
||||
* \param[in] datalen Length in bytes of the data in the container
|
||||
* \param[in] DataLen Length in bytes of the data in the container.
|
||||
*/
|
||||
#define PIMA_DATA_SIZE(datalen) ((sizeof(SI_PIMA_Container_t) - 12) + \
|
||||
(datalen))
|
||||
#define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + \
|
||||
(DataLen))
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for the possible PIMA contains types. */
|
||||
enum SI_PIMA_Container_Types_t
|
||||
{
|
||||
CType_Undefined = 0, /**< Undefined container type */
|
||||
CType_CommandBlock = 1, /**< Command Block container type */
|
||||
CType_DataBlock = 2, /**< Data Block container type */
|
||||
CType_ResponseBlock = 3, /**< Response container type */
|
||||
CType_EventBlock = 4, /**< Event Block container type */
|
||||
CType_Undefined = 0, /**< Undefined container type. */
|
||||
CType_CommandBlock = 1, /**< Command Block container type. */
|
||||
CType_DataBlock = 2, /**< Data Block container type. */
|
||||
CType_ResponseBlock = 3, /**< Response container type. */
|
||||
CType_EventBlock = 4, /**< Event Block container type. */
|
||||
};
|
||||
|
||||
/* Enums: */
|
||||
/** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
|
||||
enum SI_PIMA_ResponseCodes_t
|
||||
{
|
||||
PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command */
|
||||
PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */
|
||||
PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the
|
||||
* issued command
|
||||
* issued command.
|
||||
*/
|
||||
PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open
|
||||
* session before being issued
|
||||
* session before being issued.
|
||||
*/
|
||||
PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred */
|
||||
PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */
|
||||
PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported
|
||||
* by the attached device
|
||||
* by the attached device.
|
||||
*/
|
||||
PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's
|
||||
* parameters are not supported by the device
|
||||
* parameters are not supported by the device.
|
||||
*/
|
||||
};
|
||||
|
||||
|
|
@ -129,11 +129,11 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t DataLength; /**< Length of the container and data, in bytes */
|
||||
uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */
|
||||
uint16_t Code; /**< Command, event or response code of the container */
|
||||
uint32_t TransactionID; /**< Unique container ID to link blocks together */
|
||||
uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only) */
|
||||
uint32_t DataLength; /**< Length of the container and data, in bytes. */
|
||||
uint16_t Type; /**< Container type, a value from the \ref SI_PIMA_Container_Types_t enum. */
|
||||
uint16_t Code; /**< Command, event or response code of the container. */
|
||||
uint32_t TransactionID; /**< Unique container ID to link blocks together. */
|
||||
uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only). */
|
||||
} SI_PIMA_Container_t;
|
||||
|
||||
/* Disable C linkage for C++ Compilers: */
|
||||
|
|
|
|||
|
|
@ -82,21 +82,21 @@
|
|||
const struct
|
||||
{
|
||||
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this
|
||||
* structure controls
|
||||
* structure controls.
|
||||
*/
|
||||
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming Audio Streaming data, if available
|
||||
* (zero if unused)
|
||||
* (zero if unused).
|
||||
*/
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the incoming Audio Streaming data endpoint, if available
|
||||
* (zero if unused)
|
||||
* (zero if unused).
|
||||
*/
|
||||
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing Audio Streaming data, if available
|
||||
* (zero if unused)
|
||||
* (zero if unused).
|
||||
*/
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available
|
||||
* (zero if unused)
|
||||
* (zero if unused).
|
||||
*/
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
|
|
@ -116,16 +116,16 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
|
||||
* given Audio interface is selected.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Processes incoming control requests from the host, that are directed to the given Audio class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*/
|
||||
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -133,7 +133,7 @@
|
|||
/** General management task for a given Audio class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*/
|
||||
static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -148,9 +148,9 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the given Audio interface has a sample to be read, false otherwise
|
||||
* \return Boolean true if the given Audio interface has a sample to be read, false otherwise.
|
||||
*/
|
||||
static inline bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -169,9 +169,9 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise
|
||||
* \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise.
|
||||
*/
|
||||
static inline bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -189,9 +189,9 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsSampleReceived() function to ensure
|
||||
* ensure the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Signed 8-bit audio sample from the audio interface
|
||||
* \return Signed 8-bit audio sample from the audio interface.
|
||||
*/
|
||||
static inline int8_t Audio_Device_ReadSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -214,9 +214,9 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsSampleReceived() function to ensure
|
||||
* that the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Signed 16-bit audio sample from the audio interface
|
||||
* \return Signed 16-bit audio sample from the audio interface.
|
||||
*/
|
||||
static inline int16_t Audio_Device_ReadSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -239,9 +239,9 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsSampleReceived() function to ensure
|
||||
* that the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
*
|
||||
* \return Signed 24-bit audio sample from the audio interface
|
||||
* \return Signed 24-bit audio sample from the audio interface.
|
||||
*/
|
||||
static inline int32_t Audio_Device_ReadSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -264,8 +264,8 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsReadyForNextSample() function to
|
||||
* ensure that the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in] Sample Signed 8-bit audio sample
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
* \param[in] Sample Signed 8-bit audio sample.
|
||||
*/
|
||||
static inline void Audio_Device_WriteSample8(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
|
||||
const int8_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -283,8 +283,8 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsReadyForNextSample() function to
|
||||
* ensure that the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in] Sample Signed 16-bit audio sample
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
* \param[in] Sample Signed 16-bit audio sample.
|
||||
*/
|
||||
static inline void Audio_Device_WriteSample16(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
|
||||
const int16_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
@ -302,8 +302,8 @@
|
|||
* \pre This should be preceded immediately by a call to the \ref Audio_Device_IsReadyForNextSample() function to
|
||||
* ensure that the correct endpoint is selected and ready for data.
|
||||
*
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state
|
||||
* \param[in] Sample Signed 24-bit audio sample
|
||||
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
|
||||
* \param[in] Sample Signed 24-bit audio sample.
|
||||
*/
|
||||
static inline void Audio_Device_WriteSample24(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
|
||||
const int32_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
|
||||
|
|
|
|||
|
|
@ -99,19 +99,19 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
|
||||
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the CDC interface's IN data endpoint should use double banking */
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint. */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint. */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the CDC interface's IN data endpoint should use double banking. */
|
||||
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the CDC interface's OUT data endpoint should use double banking */
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint. */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint. */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the CDC interface's OUT data endpoint should use double banking. */
|
||||
|
||||
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */
|
||||
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
|
||||
bool NotificationEndpointDoubleBank; /**< Indicates if the CDC interface's notification endpoint should use double banking */
|
||||
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used. */
|
||||
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used. */
|
||||
bool NotificationEndpointDoubleBank; /**< Indicates if the CDC interface's notification endpoint should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -130,14 +130,14 @@
|
|||
|
||||
struct
|
||||
{
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second. */
|
||||
uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
|
||||
* CDCDevice_CDC_LineCodingFormats_t enum
|
||||
* \ref CDC_LineEncodingFormats_t enum.
|
||||
*/
|
||||
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
|
||||
* CDCDevice_LineCodingParity_t enum
|
||||
* \ref CDC_LineEncodingParity_t enum.
|
||||
*/
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port. */
|
||||
} LineEncoding; /** Line encoding used in the virtual serial port, for the device's information. This is generally
|
||||
* only used if the virtual serial port data is to be reconstructed on a physical UART.
|
||||
*/
|
||||
|
|
@ -151,23 +151,23 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing
|
||||
* the given CDC interface is selected.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Processes incoming control requests from the host, that are directed to the given CDC class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*/
|
||||
void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** General management task for a given CDC class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*/
|
||||
void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
* user program by declaring a handler function with the same name and parameters listed here. The new line encoding
|
||||
* settings are available in the LineEncoding structure inside the CDC interface structure passed as a parameter.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*/
|
||||
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -186,15 +186,15 @@
|
|||
* are available in the ControlLineStates.HostToDevice value inside the CDC interface structure passed as a parameter, set as
|
||||
* a mask of CDC_CONTROL_LINE_OUT_* masks.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*/
|
||||
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** CDC class driver event for a send break request sent to the device from the host. This is generally used to separate
|
||||
* data or to indicate a special condition to the receiving device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in] Duration Duration of the break that has been sent by the host, in milliseconds
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in] Duration Duration of the break that has been sent by the host, in milliseconds.
|
||||
*/
|
||||
void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -206,11 +206,11 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in] Data Pointer to the string to send to the host
|
||||
* \param[in] Length Size in bytes of the string to send to the host
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in] Data Pointer to the string to send to the host.
|
||||
* \param[in] Length Size in bytes of the string to send to the host.
|
||||
*
|
||||
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, char* const Data, const uint16_t Length)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -223,10 +223,10 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in] Data Byte of data to send to the host
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in] Data Byte of data to send to the host.
|
||||
*
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -235,9 +235,9 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*
|
||||
* \return Total number of buffered bytes received from the host
|
||||
* \return Total number of buffered bytes received from the host.
|
||||
*/
|
||||
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -248,9 +248,9 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*
|
||||
* \return Next received byte from the host, or 0 if no data received
|
||||
* \return Next received byte from the host, or 0 if no data received.
|
||||
*/
|
||||
uint8_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -259,9 +259,9 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Device_Flush(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -273,7 +273,7 @@
|
|||
* \pre This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or
|
||||
* the call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
*/
|
||||
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -289,8 +289,8 @@
|
|||
* \note The created stream can be given as stdout if desired to direct the standard output from all <stdio.h> functions
|
||||
* to the given CDC interface.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Device_CreateStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -298,8 +298,8 @@
|
|||
/** Identical to CDC_Device_CreateStream(), except that reads are blocking until the calling stream function terminates
|
||||
* the transfer. While blocking, the USB and CDC service tasks are called repeatedly to maintain USB communications.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo, FILE* Stream)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
|
|||
|
|
@ -85,11 +85,11 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device */
|
||||
uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device. */
|
||||
|
||||
uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint */
|
||||
uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */
|
||||
bool ReportINEndpointDoubleBank; /**< Indicates if the HID interface's IN report endpoint should use double banking */
|
||||
uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint. */
|
||||
uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint. */
|
||||
bool ReportINEndpointDoubleBank; /**< Indicates if the HID interface's IN report endpoint should use double banking. */
|
||||
|
||||
void* PrevReportINBuffer; /**< Pointer to a buffer where the previously created HID input report can be
|
||||
* stored by the driver, for comparison purposes to detect report changes that
|
||||
|
|
@ -114,10 +114,10 @@
|
|||
*/
|
||||
struct
|
||||
{
|
||||
bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode */
|
||||
uint16_t IdleCount; /**< Report idle period, in milliseconds, set by the host */
|
||||
bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode. */
|
||||
uint16_t IdleCount; /**< Report idle period, in milliseconds, set by the host. */
|
||||
uint16_t IdleMSRemaining; /**< Total number of milliseconds remaining before the idle period elapsed - this
|
||||
* should be decremented by the user application if non-zero each millisecond */
|
||||
* should be decremented by the user application if non-zero each millisecond. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* are reset to their defaults when the interface is enumerated.
|
||||
*/
|
||||
|
|
@ -128,23 +128,23 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||
* containing the given HID interface is selected.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Processes incoming control requests from the host, that are directed to the given HID class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
*/
|
||||
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
*/
|
||||
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -152,16 +152,16 @@
|
|||
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the
|
||||
* user is responsible for the creation of the next HID input report to be sent to the host.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
* \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero,
|
||||
* this should be set to the report ID of the generated HID input report (if any). If multiple
|
||||
* reports are not sent via the given HID interface, this parameter should be ignored.
|
||||
* \param[in] ReportType Type of HID report to generate, either \ref REPORT_ITEM_TYPE_In or \ref REPORT_ITEM_TYPE_Feature
|
||||
* \param[out] ReportData Pointer to a buffer where the generated HID report should be stored
|
||||
* \param[out] ReportSize Number of bytes in the generated input report, or zero if no report is to be sent
|
||||
* \param[in] ReportType Type of HID report to generate, either \ref REPORT_ITEM_TYPE_In or \ref REPORT_ITEM_TYPE_Feature.
|
||||
* \param[out] ReportData Pointer to a buffer where the generated HID report should be stored.
|
||||
* \param[out] ReportSize Number of bytes in the generated input report, or zero if no report is to be sent.
|
||||
*
|
||||
* \return Boolean true to force the sending of the report even if it is identical to the previous report and still within
|
||||
* the idle period (useful for devices which report relative movement), false otherwise
|
||||
* the idle period (useful for devices which report relative movement), false otherwise.
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* ReportSize) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -171,10 +171,10 @@
|
|||
* either HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback
|
||||
* the user is responsible for the processing of the received HID output report from the host.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
* \param[in] ReportID Report ID of the received output report. If multiple reports are not received via the given HID
|
||||
* interface, this parameter should be ignored.
|
||||
* \param[in] ReportType Type of received HID report, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature
|
||||
* \param[in] ReportType Type of received HID report, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
|
||||
* \param[in] ReportData Pointer to a buffer where the received HID report is stored.
|
||||
* \param[in] ReportSize Size in bytes of the received report from the host.
|
||||
*/
|
||||
|
|
@ -186,9 +186,9 @@
|
|||
/** Indicates that a millisecond of idle time has elapsed on the given HID interface, and the interface's idle count should be
|
||||
* decremented. This should be called once per millisecond so that hardware key-repeats function correctly. It is recommended
|
||||
* that this be called by the \ref EVENT_USB_Device_StartOfFrame() event, once SOF events have been enabled via
|
||||
* \ref USB_Device_EnableSOFEvents();.
|
||||
* \ref USB_Device_EnableSOFEvents().
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
|
||||
*/
|
||||
static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_ALWAYS_INLINE ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -81,15 +81,15 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls */
|
||||
uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls. */
|
||||
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming MIDI data, if available (zero if unused) */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the incoming MIDI data endpoint, if available (zero if unused) */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking */
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the incoming MIDI data, if available (zero if unused). */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the incoming MIDI data endpoint, if available (zero if unused). */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking. */
|
||||
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI data, if available (zero if unused) */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI data endpoint, if available (zero if unused) */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking */
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI data, if available (zero if unused). */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI data endpoint, if available (zero if unused). */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the MIDI interface's IN data endpoint should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -106,9 +106,9 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||
* containing the given MIDI interface is selected.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -119,10 +119,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send.
|
||||
*
|
||||
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -131,9 +131,9 @@
|
|||
/** Flushes the MIDI send buffer, sending any queued MIDI events to the host. This should be called to override the
|
||||
* \ref MIDI_Device_SendEventPacket() function's packing behavior, to flush queued events.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Endpoint_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Device_Flush(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -143,10 +143,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed.
|
||||
*
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise.
|
||||
*/
|
||||
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
/** General management task for a given MIDI class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*/
|
||||
static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
/** Processes incoming control requests from the host, that are directed to the given MIDI class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*/
|
||||
static inline void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -81,30 +81,30 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device */
|
||||
uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device. */
|
||||
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the Mass Storage interface's IN data endpoint */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the Mass Storage interface's IN data endpoint */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the Mass Storage interface's IN data endpoint should use double banking */
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the Mass Storage interface's IN data endpoint. */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the Mass Storage interface's IN data endpoint. */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the Mass Storage interface's IN data endpoint should use double banking. */
|
||||
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the Mass Storage interface's OUT data endpoint */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the Mass Storage interface's OUT data endpoint should use double banking */
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the Mass Storage interface's OUT data endpoint. */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint. */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the Mass Storage interface's OUT data endpoint should use double banking. */
|
||||
|
||||
uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface */
|
||||
uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
struct
|
||||
{
|
||||
MS_CommandBlockWrapper_t CommandBlock; /**< Mass Storage class command block structure, stores the received SCSI
|
||||
* command from the host which is to be processed
|
||||
* command from the host which is to be processed.
|
||||
*/
|
||||
MS_CommandStatusWrapper_t CommandStatus; /**< Mass Storage class command status structure, set elements to indicate
|
||||
* the issued command's success or failure to the host
|
||||
* the issued command's success or failure to the host.
|
||||
*/
|
||||
volatile bool IsMassStoreReset; /**< Flag indicating that the host has requested that the Mass Storage interface be reset
|
||||
* and that all current Mass Storage operations should immediately abort
|
||||
* and that all current Mass Storage operations should immediately abort.
|
||||
*/
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* are reset to their defaults when the interface is enumerated.
|
||||
|
|
@ -116,23 +116,23 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||
* containing the given Mass Storage interface is selected.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Processes incoming control requests from the host, that are directed to the given Mass Storage class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
|
||||
*/
|
||||
void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** General management task for a given Mass Storage class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage configuration and state.
|
||||
*/
|
||||
void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -141,9 +141,9 @@
|
|||
* for the processing of the received SCSI command from the host. The SCSI command is available in the CommandBlock structure
|
||||
* inside the Mass Storage class state structure passed as a parameter to the callback function.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the SCSI command was successfully processed, false otherwise
|
||||
* \return Boolean true if the SCSI command was successfully processed, false otherwise.
|
||||
*/
|
||||
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
|
|||
|
|
@ -81,38 +81,38 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device. */
|
||||
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the RNDIS interface's IN data endpoint should use double banking */
|
||||
uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint. */
|
||||
uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint. */
|
||||
bool DataINEndpointDoubleBank; /**< Indicates if the RNDIS interface's IN data endpoint should use double banking. */
|
||||
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the RNDIS interface's OUT data endpoint should use double banking */
|
||||
uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint. */
|
||||
uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint. */
|
||||
bool DataOUTEndpointDoubleBank; /**< Indicates if the RNDIS interface's OUT data endpoint should use double banking. */
|
||||
|
||||
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */
|
||||
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
|
||||
bool NotificationEndpointDoubleBank; /**< Indicates if the RNDIS interface's notification endpoint should use double banking */
|
||||
uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used. */
|
||||
uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used. */
|
||||
bool NotificationEndpointDoubleBank; /**< Indicates if the RNDIS interface's notification endpoint should use double banking. */
|
||||
|
||||
char* AdapterVendorDescription; /**< String description of the adapter vendor */
|
||||
MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
char* AdapterVendorDescription; /**< String description of the adapter vendor. */
|
||||
MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section.
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
struct
|
||||
{
|
||||
uint8_t RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host,
|
||||
* managed by the class driver
|
||||
* managed by the class driver.
|
||||
*/
|
||||
bool ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host */
|
||||
uint8_t CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the RNDIS_States_t enum */
|
||||
uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver */
|
||||
bool ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host. */
|
||||
uint8_t CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the RNDIS_States_t enum. */
|
||||
uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver. */
|
||||
Ethernet_Frame_Info_t FrameIN; /**< Structure holding the last received Ethernet frame from the host, for user
|
||||
* processing
|
||||
* processing.
|
||||
*/
|
||||
Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the
|
||||
* user application
|
||||
* user application.
|
||||
*/
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* are reset to their defaults when the interface is enumerated.
|
||||
|
|
@ -124,23 +124,23 @@
|
|||
* \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||
* containing the given HID interface is selected.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
|
||||
*
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise
|
||||
* \return Boolean true if the endpoints were successfully configured, false otherwise.
|
||||
*/
|
||||
bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Processes incoming control requests from the host, that are directed to the given RNDIS class interface. This should be
|
||||
* linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
|
||||
*/
|
||||
void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
|
||||
*/
|
||||
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the CDC interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the CDC interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the CDC interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the CDC interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the CDC interface's notification pipe should use double banking */
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used. */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the CDC interface's notification pipe should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -97,13 +97,13 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref CDC_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification pipe, if used */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe. */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification pipe, if used. */
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
@ -118,14 +118,14 @@
|
|||
|
||||
struct
|
||||
{
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second. */
|
||||
uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
|
||||
* CDCDevice_CDC_LineCodingFormats_t enum
|
||||
* \ref CDC_LineEncodingFormats_t enum.
|
||||
*/
|
||||
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
|
||||
* CDCDevice_LineCodingParity_t enum
|
||||
* \ref CDC_LineEncodingParity_t enum.
|
||||
*/
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port. */
|
||||
} LineEncoding; /**< Line encoding used in the virtual serial port, for the device's information. This is generally
|
||||
* only used if the virtual serial port data is to be reconstructed on a physical UART. When set
|
||||
* by the host application, the \ref CDC_Host_SetLineEncoding() function must be called to push
|
||||
|
|
@ -141,17 +141,17 @@
|
|||
/** Enum for the possible error codes returned by the \ref CDC_Host_ConfigurePipes() function. */
|
||||
enum CDCHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
CDC_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
CDC_ENUMERROR_NoCDCInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */
|
||||
CDC_ENUMERROR_EndpointsNotFound = 3, /**< Compatible CDC endpoints were not found in the device's CDC interface */
|
||||
CDC_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
CDC_ENUMERROR_NoCDCInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor. */
|
||||
CDC_ENUMERROR_EndpointsNotFound = 3, /**< Compatible CDC endpoints were not found in the device's CDC interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
/** General management task for a given CDC host class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state.
|
||||
*/
|
||||
void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -161,11 +161,11 @@
|
|||
* This should be called once after the stack has enumerated the attached device, while the host state machine is in
|
||||
* the Addressed state.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref CDCHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref CDCHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -173,9 +173,9 @@
|
|||
/** Sets the line encoding for the attached device's virtual serial port. This should be called when the LineEncoding
|
||||
* values of the interface have been changed to push the new settings to the USB device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -184,19 +184,19 @@
|
|||
* notification. This should be called each time the CDC class driver's ControlLineStates.HostToDevice value is updated
|
||||
* to push the new states to the USB device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Sends a Send Break request to the device. This is generally used to separate data data or to indicate a special condition
|
||||
* to the receiving device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Duration Duration of the break, in milliseconds
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Duration Duration of the break, in milliseconds.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -208,11 +208,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Data Pointer to the string to send to the device
|
||||
* \param[in] Length Size in bytes of the string to send to the device
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Data Pointer to the string to send to the device.
|
||||
* \param[in] Length Size in bytes of the string to send to the device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, char* Data, const uint16_t Length)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -225,10 +225,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Data Byte of data to send to the device
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Data Byte of data to send to the device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -237,9 +237,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return Total number of buffered bytes received from the device
|
||||
* \return Total number of buffered bytes received from the device.
|
||||
*/
|
||||
uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -250,9 +250,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return Next received byte from the device, or 0 if no data received
|
||||
* \return Next received byte from the device, or 0 if no data received.
|
||||
*/
|
||||
uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -261,9 +261,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -274,16 +274,16 @@
|
|||
* \note The created stream can be given as stdout if desired to direct the standard output from all <stdio.h> functions
|
||||
* to the given CDC interface.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Host_CreateStream(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, FILE* Stream);
|
||||
|
||||
/** Identical to CDC_Host_CreateStream(), except that reads are blocking until the calling stream function terminates
|
||||
* the transfer. While blocking, the USB and CDC service tasks are called repeatedly to maintain USB communications.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Host_CreateBlockingStream(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, FILE* Stream);
|
||||
|
||||
|
|
@ -293,7 +293,7 @@
|
|||
* are available in the ControlLineStates.DeviceToHost value inside the CDC host interface structure passed as a parameter, set as
|
||||
* a mask of CDC_CONTROL_LINE_IN_* masks.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*/
|
||||
void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,20 +85,20 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the HID interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the HID interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
|
||||
* boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL,
|
||||
* \ref HID_BOOT_KEYBOARD_PROTOCOL or \ref HID_NON_BOOT_PROTOCOL if any
|
||||
* HID device should be enumerated by the interface
|
||||
* HID device should be enumerated by the interface.
|
||||
*/
|
||||
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
|
||||
HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
|
||||
* is not used
|
||||
* is not used.
|
||||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined,
|
||||
* this method is unavailable.
|
||||
|
|
@ -111,23 +111,23 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref HID_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe. */
|
||||
|
||||
bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
|
||||
* Protocol when enabled via \ref HID_Host_SetBootProtocol()
|
||||
* Protocol when enabled via \ref HID_Host_SetBootProtocol().
|
||||
*/
|
||||
bool DeviceUsesOUTPipe; /**< Indicates if the current interface instance uses a separate OUT data pipe for
|
||||
* OUT reports, or if OUT reports are sent via the control pipe instead.
|
||||
*/
|
||||
bool UsingBootProtocol; /**< Indicates that the interface is currently initialized in Boot Protocol mode */
|
||||
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device */
|
||||
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device. */
|
||||
|
||||
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes */
|
||||
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -138,11 +138,11 @@
|
|||
/** Enum for the possible error codes returned by the \ref HID_Host_ConfigurePipes() function. */
|
||||
enum HIDHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
|
||||
HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface */
|
||||
HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface */
|
||||
HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor. */
|
||||
HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface. */
|
||||
HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
|
|
@ -155,11 +155,11 @@
|
|||
* \note Once the device pipes are configured, the HID device's reporting protocol <b>must</b> be set via a call
|
||||
* to either the \ref HID_Host_SetBootProtocol() or \ref HID_Host_SetReportProtocol() function.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref HIDHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref HIDHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -167,16 +167,16 @@
|
|||
|
||||
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
|
||||
*
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \note The destination buffer should be large enough to accommodate the largest report that the attached device
|
||||
* can generate.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] Buffer Buffer to store the received report into
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] Buffer Buffer to store the received report into.
|
||||
*
|
||||
* \return An error code from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return An error code from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, void* Buffer)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -189,11 +189,11 @@
|
|||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ReportID Report ID of the received report if ControlRequest is false, set by the to the Report ID to fetch
|
||||
* \param[in] Buffer Buffer to store the received report into
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ReportID Report ID of the received report if ControlRequest is false, set by the to the Report ID to fetch.
|
||||
* \param[in] Buffer Buffer to store the received report into.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
void* Buffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -208,14 +208,14 @@
|
|||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, the ReportID parameter is removed
|
||||
* from the parameter list of this function.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs
|
||||
* \param[in] ReportType Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature
|
||||
* \param[in] Buffer Buffer containing the report to send to the attached device
|
||||
* \param[in] ReportSize Report size in bytes to send to the attached device
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs.
|
||||
* \param[in] ReportType Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
|
||||
* \param[in] Buffer Buffer containing the report to send to the attached device.
|
||||
* \param[in] ReportSize Report size in bytes to send to the attached device.
|
||||
*
|
||||
* \return An error code from the \ref USB_Host_SendControlErrorCodes_t enum if the DeviceUsesOUTPipe flag is set in
|
||||
* the interface's state structure, a value from the \ref Pipe_Stream_RW_ErrorCodes_t enum otherwise
|
||||
* the interface's state structure, a value from the \ref Pipe_Stream_RW_ErrorCodes_t enum otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
|
||||
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
|
||||
|
|
@ -233,9 +233,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if a report has been received, false otherwise
|
||||
* \return Boolean true if a report has been received, false otherwise.
|
||||
*/
|
||||
bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -244,10 +244,10 @@
|
|||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method must still be called
|
||||
* to explicitly place the attached device into boot protocol mode before use.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return \ref HID_ERROR_LOGICAL if the device does not support Boot Protocol mode, a value from the
|
||||
* \ref USB_Host_SendControlErrorCodes_t enum otherwise
|
||||
* \ref USB_Host_SendControlErrorCodes_t enum otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -261,12 +261,12 @@
|
|||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum if an error occurs while retrieving the HID
|
||||
* Report descriptor or the setting of the Report protocol, \ref HID_ERROR_LOGICAL if the HID interface does
|
||||
* not have a valid \ref HID_ReportInfo_t structure set in its configuration, a mask of \ref HID_ERROR_LOGICAL
|
||||
* and a value from the \ref HID_Parse_ErrorCodes_t otherwise
|
||||
* and a value from the \ref HID_Parse_ErrorCodes_t otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
#endif
|
||||
|
|
@ -276,7 +276,7 @@
|
|||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*/
|
||||
static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo);
|
||||
static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -133,12 +133,12 @@
|
|||
* left-aligned to the given data type. This allows for signed data to be interpreted correctly, by shifting the data
|
||||
* leftwards until the data's sign bit is in the correct position.
|
||||
*
|
||||
* \param[in] reportitem HID Report Item whose retrieved value is to be aligned
|
||||
* \param[in] type Data type to align the HID report item's value to
|
||||
* \param[in] ReportItem HID Report Item whose retrieved value is to be aligned.
|
||||
* \param[in] Type Data type to align the HID report item's value to.
|
||||
*
|
||||
* \return Left-aligned data of the given report item's pre-retrieved value for the given datatype
|
||||
* \return Left-aligned data of the given report item's pre-retrieved value for the given datatype.
|
||||
*/
|
||||
#define HID_ALIGN_DATA(reportitem, type) ((type)(reportitem->Value << ((8 * sizeof(type)) - reportitem->Attributes.BitSize)))
|
||||
#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Enums: */
|
||||
|
|
@ -239,9 +239,9 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ReportID; /**< Report ID of the report within the HID interface */
|
||||
uint8_t ReportID; /**< Report ID of the report within the HID interface. */
|
||||
uint16_t ReportSizeBits[3]; /**< Total number of bits in each report type for the given Report ID,
|
||||
* indexed by the \ref HID_ReportItemTypes_t enum
|
||||
* indexed by the \ref HID_ReportItemTypes_t enum.
|
||||
*/
|
||||
} HID_ReportSizeInfo_t;
|
||||
|
||||
|
|
@ -272,11 +272,11 @@
|
|||
/** Function to process a given HID report returned from an attached device, and store it into a given
|
||||
* \ref HID_ReportInfo_t structure.
|
||||
*
|
||||
* \param[in] ReportData Buffer containing the device's HID report table
|
||||
* \param[in] ReportSize Size in bytes of the HID report table
|
||||
* \param[out] ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output
|
||||
* \param[in] ReportData Buffer containing the device's HID report table.
|
||||
* \param[in] ReportSize Size in bytes of the HID report table.
|
||||
* \param[out] ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output.
|
||||
*
|
||||
* \return A value in the \ref HID_Parse_ErrorCodes_t enum
|
||||
* \return A value in the \ref HID_Parse_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -287,10 +287,10 @@
|
|||
* When called, this copies the report item's Value element to it's PreviousValue element for easy
|
||||
* checking to see if an item's value has changed before processing a report.
|
||||
*
|
||||
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device
|
||||
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array
|
||||
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device.
|
||||
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
|
||||
*
|
||||
* \returns Boolean true if the item to retrieve was located in the given report, false otherwise
|
||||
* \returns Boolean true if the item to retrieve was located in the given report, false otherwise.
|
||||
*/
|
||||
bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -305,20 +305,20 @@
|
|||
*
|
||||
* If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.
|
||||
*
|
||||
* \param[out] ReportData Buffer holding the current OUT or FEATURE report data
|
||||
* \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array
|
||||
* \param[out] ReportData Buffer holding the current OUT or FEATURE report data.
|
||||
* \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
|
||||
*/
|
||||
void USB_SetHIDReportItemInfo(uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
||||
/** Retrieves the size of a given HID report in bytes from it's Report ID.
|
||||
*
|
||||
* \param[in] ParserData Pointer to a \ref HID_ReportInfo_t instance containing the parser output
|
||||
* \param[in] ReportID Report ID of the report whose size is to be retrieved
|
||||
* \param[in] ParserData Pointer to a \ref HID_ReportInfo_t instance containing the parser output.
|
||||
* \param[in] ReportID Report ID of the report whose size is to be retrieved.
|
||||
* \param[in] ReportType Type of the report whose size is to be determined, a valued from the
|
||||
* \ref HID_ReportItemTypes_t enum
|
||||
* \ref HID_ReportItemTypes_t enum.
|
||||
*
|
||||
* \return Size of the report in bytes, or 0 if the report does not exist
|
||||
* \return Size of the report in bytes, or 0 if the report does not exist.
|
||||
*/
|
||||
uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, const uint8_t ReportID,
|
||||
const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
@ -328,9 +328,9 @@
|
|||
* HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that
|
||||
* no RAM is wasted storing the attributes for report items which will never be referenced by the application.
|
||||
*
|
||||
* \param[in] CurrentItem Pointer to the current report item for user checking
|
||||
* \param[in] CurrentItem Pointer to the current report item for user checking.
|
||||
*
|
||||
* \return Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored
|
||||
* \return Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored.
|
||||
*/
|
||||
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem);
|
||||
|
||||
|
|
|
|||
|
|
@ -79,11 +79,11 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the MIDI interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the MIDI interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the MIDI interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the MIDI interface's OUT data pipe should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -91,11 +91,11 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref MIDI_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's OUT data pipe. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -106,10 +106,10 @@
|
|||
/** Enum for the possible error codes returned by the \ref MIDI_Host_ConfigurePipes() function. */
|
||||
enum MIDIHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
MIDI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
MIDI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
MIDI_ENUMERROR_NoStreamingInterfaceFound = 2, /**< A compatible MIDI interface was not found in the device's Configuration Descriptor */
|
||||
MIDI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible MIDI data endpoints were not found in the device's MIDI interface */
|
||||
MIDI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
MIDI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
MIDI_ENUMERROR_NoStreamingInterfaceFound = 2, /**< A compatible MIDI interface was not found in the device's Configuration Descriptor. */
|
||||
MIDI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible MIDI data endpoints were not found in the device's MIDI interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
|
|
@ -119,11 +119,11 @@
|
|||
* This should be called once after the stack has enumerated the attached device, while the host state machine is in
|
||||
* the Addressed state.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -133,10 +133,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -146,9 +146,9 @@
|
|||
* pipe bank until either the pipe bank is full, or \ref MIDI_Host_Flush() is called. This allows for multiple MIDI
|
||||
* events to be packed into a single pipe packet, increasing data throughput.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -157,10 +157,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed.
|
||||
*
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise.
|
||||
*/
|
||||
bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -169,7 +169,7 @@
|
|||
/** General management task for a given MIDI host class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state.
|
||||
*/
|
||||
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -83,11 +83,11 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Mass Storage interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Mass Storage interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Mass Storage interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Mass Storage interface's OUT data pipe should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -95,14 +95,14 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref MS_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe. */
|
||||
|
||||
uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets */
|
||||
uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -117,17 +117,17 @@
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device */
|
||||
uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN */
|
||||
uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device. */
|
||||
uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN. */
|
||||
} SCSI_Capacity_t;
|
||||
|
||||
/* Enums: */
|
||||
enum MSHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
MS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
MS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
MS_ENUMERROR_NoMSInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor */
|
||||
MS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Mass Storage endpoints were not found in the device's interfaces */
|
||||
MS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
MS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
MS_ENUMERROR_NoMSInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor. */
|
||||
MS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Mass Storage endpoints were not found in the device's interfaces. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
|
|
@ -137,11 +137,11 @@
|
|||
* is found within the device. This should be called once after the stack has enumerated the attached device, while
|
||||
* the host state machine is in the Addressed state.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref MSHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref MSHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -149,9 +149,9 @@
|
|||
/** Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface
|
||||
* and readying it for the next Mass Storage command.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -163,10 +163,10 @@
|
|||
* on unsupported devices the max LUN index will be reported as zero and no error will be returned
|
||||
* if the device STALLs the request.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[out] MaxLUNIndex Pointer to a location where the highest LUN index value should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[out] MaxLUNIndex Pointer to a location where the highest LUN index value should be stored.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_t* const MaxLUNIndex)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -177,11 +177,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] InquiryData Location where the read inquiry data should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] InquiryData Location where the read inquiry data should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED.
|
||||
*/
|
||||
uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Inquiry_Response_t* const InquiryData) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -189,10 +189,10 @@
|
|||
|
||||
/** Sends a TEST UNIT READY command to the device, to determine if it is ready to accept other SCSI commands.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex)
|
||||
ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
@ -202,11 +202,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] DeviceCapacity Pointer to the location where the capacity information should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] DeviceCapacity Pointer to the location where the capacity information should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Capacity_t* const DeviceCapacity) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -218,11 +218,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] SenseData Pointer to the location where the sense information should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] SenseData Pointer to the location where the sense information should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Request_Sense_Response_t* const SenseData) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -234,11 +234,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
@ -248,14 +248,14 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] BlockAddress Starting block address within the device to read from
|
||||
* \param[in] Blocks Total number of blocks to read
|
||||
* \param[in] BlockSize Size in bytes of each block within the device
|
||||
* \param[out] BlockBuffer Pointer to where the read data from the device should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] BlockAddress Starting block address within the device to read from.
|
||||
* \param[in] Blocks Total number of blocks to read.
|
||||
* \param[in] BlockSize Size in bytes of each block within the device.
|
||||
* \param[out] BlockBuffer Pointer to where the read data from the device should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,
|
||||
|
|
@ -266,14 +266,14 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] BlockAddress Starting block address within the device to write to
|
||||
* \param[in] Blocks Total number of blocks to read
|
||||
* \param[in] BlockSize Size in bytes of each block within the device
|
||||
* \param[in] BlockBuffer Pointer to where the data to write should be sourced from
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] BlockAddress Starting block address within the device to write to.
|
||||
* \param[in] Blocks Total number of blocks to read.
|
||||
* \param[in] BlockSize Size in bytes of each block within the device.
|
||||
* \param[in] BlockBuffer Pointer to where the data to write should be sourced from.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,
|
||||
|
|
@ -284,7 +284,7 @@
|
|||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state.
|
||||
*/
|
||||
static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo);
|
||||
static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -79,11 +79,11 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Printer interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Printer interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Printer interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Printer interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Printer interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Printer interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Printer interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Printer interface's OUT data pipe should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -91,13 +91,13 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref PRNT_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Printer interface within the attached device */
|
||||
uint8_t AlternateSetting; /**< Alternate setting within the Printer Interface in the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Printer interface within the attached device. */
|
||||
uint8_t AlternateSetting; /**< Alternate setting within the Printer Interface in the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Printer interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Printer interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Printer interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Printer interface's OUT data pipe. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -107,10 +107,10 @@
|
|||
/* Enums: */
|
||||
enum PRNTHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
PRNT_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
PRNT_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
PRNT_ENUMERROR_NoPrinterInterfaceFound = 2, /**< A compatible Printer interface was not found in the device's Configuration Descriptor */
|
||||
PRNT_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Printer endpoints were not found in the device's interfaces */
|
||||
PRNT_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
PRNT_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
PRNT_ENUMERROR_NoPrinterInterfaceFound = 2, /**< A compatible Printer interface was not found in the device's Configuration Descriptor. */
|
||||
PRNT_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Printer endpoints were not found in the device's interfaces. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
|
|
@ -120,11 +120,11 @@
|
|||
* the device. This should be called once after the stack has enumerated the attached device, while the host state
|
||||
* machine is in the Addressed state.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref PRNTHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref PRNTHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -132,28 +132,28 @@
|
|||
/** Configures the printer to enable Bidirectional mode, if it is not already in this mode. This should be called
|
||||
* once the connected device's configuration has been set, to ensure the printer is ready to accept commands.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Retrieves the status of the virtual Printer port's inbound status lines. The result can then be masked against the
|
||||
* PRNT_PORTSTATUS_* macros to determine the printer port's status.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[out] PortStatus Location where the retrieved port status should be stored
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[out] PortStatus Location where the retrieved port status should be stored.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_GetPortStatus(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint8_t* const PortStatus)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
||||
/** Soft-resets the attached printer, readying it for new commands.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SoftReset(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -164,11 +164,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in] PrinterCommands Pointer to a buffer containing the raw command stream to send to the printer
|
||||
* \param[in] CommandSize Size in bytes of the command stream to be sent
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[in] PrinterCommands Pointer to a buffer containing the raw command stream to send to the printer.
|
||||
* \param[in] CommandSize Size in bytes of the command stream to be sent.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, void* PrinterCommands,
|
||||
uint16_t CommandSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -180,11 +180,11 @@
|
|||
*
|
||||
* This string, when supported, contains the model, manufacturer and acceptable printer languages for the attached device.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[out] DeviceIDString Pointer to a buffer where the Device ID string should be stored, in ASCII format
|
||||
* \param[in] BufferSize Size in bytes of the buffer allocated for the Device ID string
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[out] DeviceIDString Pointer to a buffer where the Device ID string should be stored, in ASCII format.
|
||||
* \param[in] BufferSize Size in bytes of the buffer allocated for the Device ID string.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_GetDeviceID(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, char* DeviceIDString,
|
||||
uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*/
|
||||
static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -83,16 +83,16 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the RNDIS interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the RNDIS interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the RNDIS interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the RNDIS interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking */
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used. */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking. */
|
||||
|
||||
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host */
|
||||
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -100,17 +100,17 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref RNDIS_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe. */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used. */
|
||||
|
||||
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device */
|
||||
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device. */
|
||||
|
||||
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair */
|
||||
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -121,10 +121,10 @@
|
|||
/** Enum for the possible error codes returned by the \ref RNDIS_Host_ConfigurePipes() function. */
|
||||
enum RNDISHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
RNDIS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
RNDIS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
RNDIS_ENUMERROR_NoRNDISInterfaceFound = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor */
|
||||
RNDIS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible RNDIS endpoints were not found in the device's RNDIS interface */
|
||||
RNDIS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
RNDIS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
RNDIS_ENUMERROR_NoRNDISInterfaceFound = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor. */
|
||||
RNDIS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible RNDIS endpoints were not found in the device's RNDIS interface. */
|
||||
};
|
||||
|
||||
/* Macros: */
|
||||
|
|
@ -138,11 +138,11 @@
|
|||
* This should be called once after the stack has enumerated the attached device, while the host state machine is in
|
||||
* the Addressed state.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref RNDISHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref RNDISHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -150,45 +150,45 @@
|
|||
/** Sends a RNDIS KEEPALIVE command to the device, to ensure that it does not enter standby mode after periods
|
||||
* of long inactivity.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SendKeepAlive(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Initializes the attached RNDIS device's RNDIS interface. This should be called after the device's pipes have been
|
||||
* configured via the call to \ref RNDIS_Host_ConfigurePipes().
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_InitializeDevice(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Sets a given RNDIS property of an attached RNDIS device.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Oid OID number of the parameter to set
|
||||
* \param[in] Buffer Pointer to where the property data is to be sourced from
|
||||
* \param[in] Length Length in bytes of the property data to sent to the device
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Oid OID number of the parameter to set.
|
||||
* \param[in] Buffer Pointer to where the property data is to be sourced from.
|
||||
* \param[in] Length Length in bytes of the property data to sent to the device.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint32_t Oid, void* Buffer,
|
||||
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
/** Gets a given RNDIS property of an attached RNDIS device.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Oid OID number of the parameter to get
|
||||
* \param[in] Buffer Pointer to where the property data is to be written to
|
||||
* \param[in] MaxLength Length in bytes of the destination buffer size
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Oid OID number of the parameter to get.
|
||||
* \param[in] Buffer Pointer to where the property data is to be written to.
|
||||
* \param[in] MaxLength Length in bytes of the destination buffer size.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint32_t Oid, void* Buffer,
|
||||
uint16_t MaxLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -198,9 +198,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if a packet is waiting to be read in by the host, false otherwise
|
||||
* \return Boolean true if a packet is waiting to be read in by the host, false otherwise.
|
||||
*/
|
||||
bool RNDIS_Host_IsPacketReceived(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -210,11 +210,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[out] Buffer Pointer to a buffer where the packer data is to be written to
|
||||
* \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[out] Buffer Pointer to a buffer where the packer data is to be written to.
|
||||
* \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored.
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t* PacketLength)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -224,11 +224,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Buffer Pointer to a buffer where the packer data is to be read from
|
||||
* \param[in] PacketLength Length in bytes of the packet to send
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Buffer Pointer to a buffer where the packer data is to be read from.
|
||||
* \param[in] PacketLength Length in bytes of the packet to send.
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t PacketLength)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -237,7 +237,7 @@
|
|||
/** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should
|
||||
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*/
|
||||
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)
|
||||
|
|
|
|||
|
|
@ -83,14 +83,14 @@
|
|||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Still Image interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Still Image interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Still Image interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Still Image interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used */
|
||||
bool EventsPipeDoubleBank; /**< Indicates if the Still Image interface's events data pipe should use double banking */
|
||||
uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used. */
|
||||
bool EventsPipeDoubleBank; /**< Indicates if the Still Image interface's events data pipe should use double banking. */
|
||||
} Config; /**< Config data for the USB class interface within the device. All elements in this section
|
||||
* <b>must</b> be set or the interface will fail to enumerate and operate correctly.
|
||||
*/
|
||||
|
|
@ -98,15 +98,15 @@
|
|||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref SImage_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Still Image interface's OUT data pipe */
|
||||
uint16_t EventsPipeSize; /**< Size in bytes of the Still Image interface's IN events pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Still Image interface's OUT data pipe. */
|
||||
uint16_t EventsPipeSize; /**< Size in bytes of the Still Image interface's IN events pipe. */
|
||||
|
||||
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device */
|
||||
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device */
|
||||
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device. */
|
||||
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device. */
|
||||
} State; /**< State data for the USB class interface within the device. All elements in this section
|
||||
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when
|
||||
* the interface is enumerated.
|
||||
|
|
@ -117,13 +117,13 @@
|
|||
/** Enum for the possible error codes returned by the \ref SImage_Host_ConfigurePipes() function. */
|
||||
enum SIHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
SI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
SI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
SI_ENUMERROR_NoSIInterfaceFound = 2, /**< A compatible Still Image interface was not found in the device's
|
||||
* Configuration Descriptor
|
||||
* Configuration Descriptor.
|
||||
*/
|
||||
SI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Still Image data endpoints were not found in the
|
||||
* device's Still Image interface
|
||||
* device's Still Image interface.
|
||||
*/
|
||||
};
|
||||
|
||||
|
|
@ -134,11 +134,11 @@
|
|||
* found within the device. This should be called once after the stack has enumerated the attached device, while
|
||||
* the host state machine is in the Addressed state.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor.
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor.
|
||||
*
|
||||
* \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
|
@ -149,10 +149,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -162,10 +162,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -175,10 +175,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] PIMAHeader Pointer to a PIMA container structure that is to be sent
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] PIMAHeader Pointer to a PIMA container structure that is to be sent.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -190,10 +190,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the received block is to be stored
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the received block is to be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -204,13 +204,13 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] Operation PIMA operation code to issue to the device
|
||||
* \param[in] TotalParams Total number of 32-bit parameters to send to the device in the issued command block
|
||||
* \param[in] Params Pointer to an array of 32-bit values containing the parameters to send in the command block
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] Operation PIMA operation code to issue to the device.
|
||||
* \param[in] TotalParams Total number of 32-bit parameters to send to the device in the issued command block.
|
||||
* \param[in] Params Pointer to an array of 32-bit values containing the parameters to send in the command block.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, const uint16_t Operation,
|
||||
const uint8_t TotalParams, uint32_t* Params) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
@ -221,10 +221,10 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -233,9 +233,9 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if an event is waiting to be read, false otherwise
|
||||
* \return Boolean true if an event is waiting to be read, false otherwise.
|
||||
*/
|
||||
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
|
@ -244,11 +244,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the event should be stored
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the event should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
|
|
@ -260,11 +260,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] Buffer Pointer to a buffer where the data to send has been stored
|
||||
* \param[in] Bytes Length in bytes of the data in the buffer to send to the attached device
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] Buffer Pointer to a buffer where the data to send has been stored.
|
||||
* \param[in] Bytes Length in bytes of the data in the buffer to send to the attached device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, void* Buffer,
|
||||
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -275,11 +275,11 @@
|
|||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] Buffer Pointer to a buffer where the received data is to be stored
|
||||
* \param[in] Bytes Length in bytes of the data to read
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] Buffer Pointer to a buffer where the received data is to be stored.
|
||||
* \param[in] Bytes Length in bytes of the data to read.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, void* Buffer,
|
||||
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
|
@ -289,7 +289,7 @@
|
|||
* interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*/
|
||||
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue