![]() |
Synergy Software Package User's Manual
|
RTOS-integrated USBX CDC ACM device implementation. More...
Data Structures | |
| struct | sf_el_ux_comms_instance_ctrl_t |
Functions | |
| ssp_err_t | SF_EL_UX_COMMS_Open (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_cfg_t const *const p_cfg) |
| Initializes a USB channel for CDC ACM mode. More... | |
| ssp_err_t | SF_EL_UX_COMMS_Close (sf_comms_ctrl_t *const p_api_ctrl) |
| Releases all the ThreadX Resources. More... | |
| ssp_err_t | SF_EL_UX_COMMS_Read (sf_comms_ctrl_t *const p_api_ctrl, uint8_t *const p_dest, uint32_t const bytes, UINT const timeout) |
| Read data from the USBX CDC-ACM driver. More... | |
| ssp_err_t | SF_EL_UX_COMMS_Write (sf_comms_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const bytes, UINT const timeout) |
| Write data to the USBX CDC-ACM framework. More... | |
| ssp_err_t | SF_EL_UX_COMMS_Lock (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_lock_t lock_type, UINT timeout) |
| Lock the USB COM resource. More... | |
| ssp_err_t | SF_EL_UX_COMMS_Unlock (sf_comms_ctrl_t *const p_api_ctrl, sf_comms_lock_t lock_type) |
| Unlock the USB COM resource. More... | |
| ssp_err_t | SF_EL_UX_COMMS_VersionGet (ssp_version_t *const p_version) |
| Get driver version. More... | |
RTOS-integrated USBX CDC ACM device implementation.
| ssp_err_t SF_EL_UX_COMMS_Close | ( | sf_comms_ctrl_t *const | p_api_ctrl | ) |
Releases all the ThreadX Resources.
| SSP_SUCCESS | Channel successfully closed |
| SSP_ERR_ASSERTION | Pointer to control block is NULL |
| SSP_ERR_NOT_OPEN | Module is not opened. |
Check if module has been opened.
Delete transmit mutex.
Delete receive mutex.
Deletes a semaphore for USBX CDC instance
| ssp_err_t SF_EL_UX_COMMS_Lock | ( | sf_comms_ctrl_t *const | p_api_ctrl, |
| sf_comms_lock_t | lock_type, | ||
| UINT | timeout | ||
| ) |
Lock the USB COM resource.
| SSP_SUCCESS | Locking a USB COM resource successful. |
| SSP_ERR_ASSERTION | Pointer to control block is NULL. |
| SSP_ERR_NOT_OPEN | Module is not opened. |
| SSP_ERR_TIMEOUT | Mutex not available in timeout. |
If lock type is ALL, both TX and RX gets locked else either TX or RX is locked.
If TX or RX fails to acquire mutex, return error.
| ssp_err_t SF_EL_UX_COMMS_Open | ( | sf_comms_ctrl_t *const | p_api_ctrl, |
| sf_comms_cfg_t const *const | p_cfg | ||
| ) |
Initializes a USB channel for CDC ACM mode.
| [in] | p_api_ctrl | Pointer to control structure block. |
| [in] | p_cfg | Pointer to configuration structure block. This parameter is not used in the framework hence the NULL parameter check not implemented. |
| SSP_SUCCESS | Channel opened successfully. |
| SSP_ERR_ASSERTION | p_api_ctrl pointer parameter to control block is NULL. |
| SSP_ERR_TIMEOUT | Semaphore not available in timeout. |
| SSP_ERR_INTERNAL | Transmit/Receive mutex or Semaphore creation fails. |
| SSP_ERR_IN_USE | Channel/peripheral is running/busy. |
Create semaphore if the USBX CDC instance is not ready.
If the semaphore creation fails, return error.
Suspend here until a USBX CDC instance is created by the USBX CDC for this module.
Create the mutex for protecting the access to control structure for transmit and related hardware
Create the mutex for protecting the access to control structure for receive and related hardware
Mark control block open.
| ssp_err_t SF_EL_UX_COMMS_Read | ( | sf_comms_ctrl_t *const | p_api_ctrl, |
| uint8_t *const | p_dest, | ||
| uint32_t const | bytes, | ||
| UINT const | timeout | ||
| ) |
Read data from the USBX CDC-ACM driver.
| SSP_SUCCESS | Data reception ends successfully. |
| SSP_ERR_INTERNAL | An error has occurred if usb read operation fails or buffer overflow occurred. |
| SSP_ERR_TIMEOUT | Receive mutex get timed out |
Get mutex.
Set timeout value in the transfer request.
If there is data leftover from the last packet, use it.
Read from the CDC class.
Release mutex in case of buffer overflow or read error .
Release mutex for Read API.
| ssp_err_t SF_EL_UX_COMMS_Unlock | ( | sf_comms_ctrl_t *const | p_api_ctrl, |
| sf_comms_lock_t | lock_type | ||
| ) |
Unlock the USB COM resource.
| SSP_SUCCESS | Unlocking a USB COM resource successful. |
| SSP_ERR_ASSERTION | Pointer to control block is NULL. |
| SSP_ERR_NOT_OPEN | Module is not opened. |
| SSP_ERR_INTERNAL | Failed to release the mutex. |
Unlock the USB CDC COM resource as per the user request.
If USB CDC COM resource fails to unlock,returns error.
| ssp_err_t SF_EL_UX_COMMS_VersionGet | ( | ssp_version_t *const | p_version | ) |
Get driver version.
| [out] | p_version | Version will be stored here. |
| ssp_err_t SF_EL_UX_COMMS_Write | ( | sf_comms_ctrl_t *const | p_api_ctrl, |
| uint8_t const *const | p_src, | ||
| uint32_t const | bytes, | ||
| UINT const | timeout | ||
| ) |
Write data to the USBX CDC-ACM framework.
| SSP_SUCCESS | Data transmission finished successfully. |
| SSP_ERR_INTERNAL | An error has occurred, when usb write operation fails. |
| SSP_ERR_TIMEOUT | Transmit mutex get timed out or when DTR and RTS state setting gets timed out. |
Wait for DTR and RTS state to set.
Get Transmit mutex.
Set timeout value in the transfer request.
Release mutex in case of error condition and log the error .
Release Transmit mutex for Write API.