USB Device ACM API#
USB Device CDC ACM API.
Modules#
Functions#
GLOBAL VARIABLES.
Add a new instance of the CDC ACM serial emulation subclass.
Add a CDC ACM subclass class instance into USB device configuration.
Get the CDC ACM serial emulation subclass enable state.
Receive data on the CDC ACM serial emulation subclass.
Receive data on the CDC ACM serial emulation subclass asynchronously.
Send data on the CDC ACM serial emulation subclass.
Send data on the CDC ACM serial emulation subclass asynchronously.
Return the state of control lines.
Get the current state of the line coding.
Set a new line coding.
Set a line state event(s).
Clear a line state event(s).
Macros#
MODULE.
PORT SETTINGS DEFINES.
LINE EVENTS FLAGS DEFINES.
CALL MANAGEMENT CAPABILITIES.
Function Documentation#
sl_usbd_cdc_acm_init#
sl_status_t sl_usbd_cdc_acm_init (void )
GLOBAL VARIABLES.
N/A |
MACROS GLOBAL CONSTANTS FUNCTION PROTOTYPES CDC ACM FUNCTIONS
Initialize the CDC ACM serial emulation subclass.
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
170
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_create_instance#
sl_status_t sl_usbd_cdc_acm_create_instance (uint16_t line_state_interval, uint16_t call_mgmt_capabilities, sl_usbd_cdc_acm_callbacks_t * p_acm_callbacks, uint8_t * p_subclass_nbr)
Add a new instance of the CDC ACM serial emulation subclass.
N/A | line_state_interval | Line state notification interval in milliseconds (value must be a power of 2). |
N/A | call_mgmt_capabilities | Call Management Capabilities bitmap. OR'ed of the following flags:
|
N/A | p_acm_callbacks | Optional pointers to callback functions to be called on various events. |
N/A | p_subclass_nbr | Param to variable that will receive CDC ACM serial emulation subclass instance number. |
Returns
Return SL_STATUS_OK on success or another SL_STATUS code on failure.
201
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_add_to_configuration#
sl_status_t sl_usbd_cdc_acm_add_to_configuration (uint8_t subclass_nbr, uint8_t config_nbr)
Add a CDC ACM subclass class instance into USB device configuration.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | config_nbr | Configuration index to add new test class interface to. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
215
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_is_enabled#
sl_status_t sl_usbd_cdc_acm_is_enabled (uint8_t subclass_nbr, bool * p_enabled)
Get the CDC ACM serial emulation subclass enable state.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_enabled | Boolean to a variable that will receive enable status. The variable is set to true, CDC ACM serial emulation is enabled. The variable is set to false, CDC ACM serial emulation is not enabled. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
229
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_read#
sl_status_t sl_usbd_cdc_acm_read (uint8_t subclass_nbr, uint8_t * p_buf, uint32_t buf_len, uint16_t timeout, uint32_t * p_xfer_len)
Receive data on the CDC ACM serial emulation subclass.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_buf | Pointer to the destination buffer to receive data. |
N/A | buf_len | Number of octets to receive. |
N/A | timeout | Timeout, in milliseconds. |
N/A | p_xfer_len | Pointer to a variable that will receive transfer length. If no errors are returned, the variable is set to number of octets received, otherwise it is set to 0. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
249
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_read_async#
sl_status_t sl_usbd_cdc_acm_read_async (uint8_t subclass_nbr, uint8_t * p_buf, uint32_t buf_len, sl_usbd_cdc_async_function_t async_fnct, void * p_async_arg)
Receive data on the CDC ACM serial emulation subclass asynchronously.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_buf | Pointer to the destination buffer to receive data. |
N/A | buf_len | Number of octets to receive. |
N/A | async_fnct | Function that will be invoked upon completion of receive operation. |
N/A | p_async_arg | Pointer to the argument that will be passed as parameter of 'async_fnct'. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
270
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_write#
sl_status_t sl_usbd_cdc_acm_write (uint8_t subclass_nbr, uint8_t * p_buf, uint32_t buf_len, uint16_t timeout, uint32_t * p_xfer_len)
Send data on the CDC ACM serial emulation subclass.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_buf | Pointer to the buffer of data that will be transmitted. |
N/A | buf_len | Number of octets to transmit. |
N/A | timeout | Timeout in milliseconds. |
N/A | p_xfer_len | Pointer to a variable that will receive transfer length. If no errors are returned, the variable is set to number of octets transmitted, otherwise it is set to 0. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
293
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_write_async#
sl_status_t sl_usbd_cdc_acm_write_async (uint8_t subclass_nbr, uint8_t * p_buf, uint32_t buf_len, sl_usbd_cdc_async_function_t async_fnct, void * p_async_arg)
Send data on the CDC ACM serial emulation subclass asynchronously.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_buf | Pointer to the buffer of data that will be transmitted. |
N/A | buf_len | Number of octets to transmit. |
N/A | async_fnct | Function that will be invoked upon completion of transfer operation. |
N/A | p_async_arg | Pointer to the argument that will be passed as parameter of 'async_fnct'. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
314
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_get_line_control_state#
sl_status_t sl_usbd_cdc_acm_get_line_control_state (uint8_t subclass_nbr, uint8_t * p_line_ctrl)
Return the state of control lines.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_line_ctrl | Pointer to the variable that will be set with the state of the control lines, encoded in bit fields. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
330
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_get_line_coding#
sl_status_t sl_usbd_cdc_acm_get_line_coding (uint8_t subclass_nbr, sl_usbd_cdc_acm_line_coding_t * p_line_coding)
Get the current state of the line coding.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_line_coding | Pointer to the structure where the current line coding will be stored. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
342
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_set_line_coding#
sl_status_t sl_usbd_cdc_acm_set_line_coding (uint8_t subclass_nbr, sl_usbd_cdc_acm_line_coding_t * p_line_coding)
Set a new line coding.
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | p_line_coding | Pointer to the structure that contains the new line coding. |
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
354
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_set_line_state_event#
sl_status_t sl_usbd_cdc_acm_set_line_state_event (uint8_t subclass_nbr, uint8_t events)
Set a line state event(s).
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | events | Line state event(s) to set. OR'ed of the following flags:
|
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
373
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
sl_usbd_cdc_acm_clear_line_state_event#
sl_status_t sl_usbd_cdc_acm_clear_line_state_event (uint8_t subclass_nbr, uint8_t events)
Clear a line state event(s).
N/A | subclass_nbr | CDC ACM serial emulation subclass instance number. |
N/A | events | Line state event(s) set to be cleared. OR'ed of the following flags (see Note #1) :
|
Returns
Returns SL_STATUS_OK on success or another SL_STATUS code on failure.
Note
(1) USB PSTN spec ver 1.20 states: "For the irregular signals like break, the incoming ring signal, or the overrun error state, this will reset their values to zero and again will not send another notification until their state changes." The irregular events are automatically cleared by the ACM serial emulation subclass.
393
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
Macro Definition Documentation#
SL_USBD_CDC_ACM_NBR_NONE#
#define SL_USBD_CDC_ACM_NBR_NONEValue:
255u
MODULE.
INCLUDE FILES DEFINES
55
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_PARITY_NONE#
#define SL_USBD_CDC_ACM_PARITY_NONEValue:
0u
PORT SETTINGS DEFINES.
61
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_PARITY_ODD#
#define SL_USBD_CDC_ACM_PARITY_ODDValue:
1u
62
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_PARITY_EVEN#
#define SL_USBD_CDC_ACM_PARITY_EVENValue:
2u
63
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_PARITY_MARK#
#define SL_USBD_CDC_ACM_PARITY_MARKValue:
3u
64
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_PARITY_SPACE#
#define SL_USBD_CDC_ACM_PARITY_SPACEValue:
4u
65
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STOP_BIT_1#
#define SL_USBD_CDC_ACM_STOP_BIT_1Value:
0u
67
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STOP_BIT_1_5#
#define SL_USBD_CDC_ACM_STOP_BIT_1_5Value:
1u
68
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STOP_BIT_2#
#define SL_USBD_CDC_ACM_STOP_BIT_2Value:
2u
69
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CTRL_BREAK#
#define SL_USBD_CDC_ACM_CTRL_BREAKValue:
0x01u
LINE EVENTS FLAGS DEFINES.
75
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CTRL_RTS#
#define SL_USBD_CDC_ACM_CTRL_RTSValue:
0x02u
76
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CTRL_DTR#
#define SL_USBD_CDC_ACM_CTRL_DTRValue:
0x04u
77
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_DCD#
#define SL_USBD_CDC_ACM_STATE_DCDValue:
0x01u
79
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_DSR#
#define SL_USBD_CDC_ACM_STATE_DSRValue:
0x02u
80
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_BREAK#
#define SL_USBD_CDC_ACM_STATE_BREAKValue:
0x04u
81
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_RING#
#define SL_USBD_CDC_ACM_STATE_RINGValue:
0x08u
82
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_FRAMING#
#define SL_USBD_CDC_ACM_STATE_FRAMINGValue:
0x10u
83
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_PARITY#
#define SL_USBD_CDC_ACM_STATE_PARITYValue:
0x20u
84
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_STATE_OVERUN#
#define SL_USBD_CDC_ACM_STATE_OVERUNValue:
0x40u
85
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CALL_MGMT_DEV#
#define SL_USBD_CDC_ACM_CALL_MGMT_DEVValue:
0x01u
CALL MANAGEMENT CAPABILITIES.
Note(s) : (1) See 'USB, Communications Class, Subclass Specification for PSTN Devices, Revision 1.2, February 9 2007', section '5.3.1 Call Management Functional Descriptor' for more details about the Call Management capabilities.
95
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CALL_MGMT_DATA_CCI_DCI#
#define SL_USBD_CDC_ACM_CALL_MGMT_DATA_CCI_DCIValue:
0x02u
96
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h
SL_USBD_CDC_ACM_CALL_MGMT_DATA_OVER_DCI#
#define SL_USBD_CDC_ACM_CALL_MGMT_DATA_OVER_DCIValue:
(0x02u | 0x01u)
97
of file protocol/usb/inc/sl_usbd_class_cdc_acm.h