USB Component
Version 6.6
MDK-Professional Middleware for USB Device and Host
|
User API reference of the Communication Device Class (Abstract Control Model). More...
Functions | |
usbStatus | USBH_CDC_ACM_GetDeviceStatus (uint8_t instance) |
Get status of Communication Device Class device. | |
usbStatus | USBH_CDC_ACM_Send (uint8_t instance, const uint8_t *data, uint32_t num) |
Send data to Communication Device Class device. | |
uint32_t | USBH_CDC_ACM_GetTxCount (uint8_t instance) |
Get result of send data to Communication Device Class device. | |
usbStatus | USBH_CDC_ACM_Receive (uint8_t instance, uint8_t *data, uint32_t num) |
Receive data from Communication Device Class device. | |
uint32_t | USBH_CDC_ACM_GetRxCount (uint8_t instance) |
Get result of receive data from Communication Device Class device. | |
usbStatus | USBH_CDC_ACM_SetLineCoding (uint8_t instance, CDC_LINE_CODING *line_coding) |
Change communication settings of Communication Device Class device. | |
usbStatus | USBH_CDC_ACM_GetLineCoding (uint8_t instance, CDC_LINE_CODING *line_coding) |
Retrieve communication settings of Communication Device Class device. | |
usbStatus | USBH_CDC_ACM_SetControlLineState (uint8_t instance, uint16_t state) |
Set control line states of Communication Device Class device. | |
void | USBH_CDC_ACM_Notify (uint8_t instance, uint16_t status) |
Callback function called when Communication Device Class device modem line or error status changes. | |
usbStatus | USBH_CDC_ACM_SendBreak (uint8_t instance, uint16_t duration) |
Send break on Communication Device Class device. | |
User API reference of the Communication Device Class (Abstract Control Model).
usbStatus USBH_CDC_ACM_GetDeviceStatus | ( | uint8_t | instance | ) |
Get status of Communication Device Class device.
[in] | instance | instance of CDC Device. |
The function USBH_CDC_ACM_GetDeviceStatus returns the status of a CDC device attached to the USB Host.
The argument instance specifies the instance of the CDC device to be queried.
Code Example
usbStatus USBH_CDC_ACM_GetLineCoding | ( | uint8_t | instance, |
CDC_LINE_CODING * | line_coding | ||
) |
Retrieve communication settings of Communication Device Class device.
[in] | instance | index of CDC instance. |
[out] | line_coding | pointer to CDC_LINE_CODING structure. |
The function USBH_CDC_ACM_GetLineCoding retrieves the communication parameters of the attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
The argument line_coding is a pointer to the CDC_LINE_CODING to store the communication parameters.
uint32_t USBH_CDC_ACM_GetRxCount | ( | uint8_t | instance | ) |
Get result of receive data from Communication Device Class device.
[in] | instance | index of CDC instance. |
The function USBH_CDC_ACM_GetRxCount returns the number of received data bytes from an attached CDC device.
The argument instance specifies the instance of the sending CDC device.
Code Example
uint32_t USBH_CDC_ACM_GetTxCount | ( | uint8_t | instance | ) |
Get result of send data to Communication Device Class device.
[in] | instance | index of CDC instance. |
The function USBH_CDC_ACM_GetTxCount returns the number of data bytes sent to an attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
Code Example
void USBH_CDC_ACM_Notify | ( | uint8_t | instance, |
uint16_t | status | ||
) |
Callback function called when Communication Device Class device modem line or error status changes.
[in] | instance | index of CDC instance. |
[in] | status | error status and line states:
|
The callback function USBH_CDC_ACM_Notify is called when an attached CDC device signals modem line or error status changes.
The argument instance specifies the instance of the calling CDC device.
The argument status shows the modem line or error status.
Code Example
usbStatus USBH_CDC_ACM_Receive | ( | uint8_t | instance, |
uint8_t * | data, | ||
uint32_t | num | ||
) |
Receive data from Communication Device Class device.
[in] | instance | index of CDC instance |
[out] | data | buffer that receives data. |
[in] | num | maximum number of bytes to receive. |
The USBH_CDC_ACM_Receive function receives data from an attached CDC device.
The argument instance specifies the instance of the CDC device that is sending the data.
The argument data is a pointer to the buffer storing the incoming data.
The argument num specifies the maximum number of data bytes to be received.
Code Example
usbStatus USBH_CDC_ACM_Send | ( | uint8_t | instance, |
const uint8_t * | data, | ||
uint32_t | num | ||
) |
Send data to Communication Device Class device.
[in] | instance | index of CDC instance. |
[in] | data | buffer containing data bytes to send. |
[in] | num | number of bytes to send. |
The function USBH_CDC_ACM_Send transmits data to an attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
The argument data is a pointer to the buffer containing the data that is to be sent.
The argument num specifies the number of bytes to be sent.
Code Example
usbStatus USBH_CDC_ACM_SendBreak | ( | uint8_t | instance, |
uint16_t | duration | ||
) |
Send break on Communication Device Class device.
[in] | instance | index of CDC instance. |
[in] | duration | duration of break (in milliseconds)
|
The USBH_CDC_ACM_SendBreak function sends a break to the attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
The argument duration specifies the duration of the break in milliseconds.
Code Example
usbStatus USBH_CDC_ACM_SetControlLineState | ( | uint8_t | instance, |
uint16_t | state | ||
) |
Set control line states of Communication Device Class device.
[in] | instance | index of CDC instance. |
[in] | state | control line settings bitmap.
|
The function USBH_CDC_ACM_SetControlLineState sets the states of the control lines of the attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
The argument state sets the control line parameters.
Code Example
usbStatus USBH_CDC_ACM_SetLineCoding | ( | uint8_t | instance, |
CDC_LINE_CODING * | line_coding | ||
) |
Change communication settings of Communication Device Class device.
[in] | instance | index of CDC instance. |
[in] | line_coding | pointer to CDC_LINE_CODING structure. |
The function USBH_CDC_ACM_SetLineCoding changes the communication parameters of the attached CDC device.
The argument instance specifies the instance of the targeted CDC device.
The argument line_coding is a pointer to the CDC_LINE_CODING structure containing the communication parameters that are to be used.
Code Example