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