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 */
+ 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 */
+ 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 */
+ 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.
*/
* CDCDevice_LineCodingParity_t enum
*/
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
- * the changes to the device.
+ } 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
+ * the changes 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
* 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
*/
* \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single pipe packet, increasing data throughput.
*
- * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
- * call will fail.
+ * \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] 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
*/
* \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be
* packed into a single pipe packet, increasing data throughput.
*
- * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
- * call will fail.
+ * \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] Data Byte of data to send to the device
*
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
*/
/** Determines the number of bytes received by the CDC interface from the device, waiting to be read.
*
- * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
- * call will fail.
+ * \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
*
* returns 0. The \ref CDC_Host_BytesReceived() function should be queried before data is received to ensure that no data
* underflow occurs.
*
- * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
- * call will fail.
+ * \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
*
/** Flushes any data waiting to be sent, ensuring that the send buffer is cleared.
*
- * \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
- * call will fail.
+ * \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
*
* 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] 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);
* 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] 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);
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_CDC_CLASS_HOST_C)
- static int CDC_Host_putchar(char c, FILE* Stream);
- static int CDC_Host_getchar(FILE* Stream);
- static int CDC_Host_getchar_Blocking(FILE* Stream);
+ static int CDC_Host_putchar(char c, FILE* Stream) ATTR_NON_NULL_PTR_ARG(2);
+ static int CDC_Host_getchar(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
+ static int CDC_Host_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
void CDC_Host_Event_Stub(void);
void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo)
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub);
- static uint8_t DComp_CDC_Host_NextCDCControlInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- static uint8_t DComp_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- static uint8_t DComp_CDC_Host_NextCDCInterfaceEndpoint(void* const CurrentDescriptor);
+
+ static uint8_t DCOMP_CDC_Host_NextCDCControlInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
+ static uint8_t DCOMP_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
+ static uint8_t DCOMP_CDC_Host_NextCDCInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif