CPC#
Modules#
sl_cpc_endpoint_debug_counters_t
Enumerations#
Enumeration representing user endpoint.
Enumeration representing the possible endpoint state.
Enumeration representing the possible configurable options for an endpoint.
Typedefs#
Typedef for the user - supplied callback function which is called when CPC is done with the provided buffer.
Typedef for the user - supplied callback function which is called when CPC receive data on an endpoint.
Typedef for the user-supplied callback function which is called when CPC detects a fatal error on an endpoint.
Functions#
Global variable that contains the core debug information.
The bare metal process action function.
Set endpoint option.
Close endpoint.
Abort read; Allow unblockling task in blocked by a read.
Read data.
Write data.
Get endpoint state.
Get endpoint encryption state.
Free buffer returned by sl_cpc_read().
Macros#
Struct representing a core debug.
Enumeration Documentation#
sl_cpc_user_endpoint_id_t#
sl_cpc_user_endpoint_id_t
Enumeration representing user endpoint.
| Enumerator | |
|---|---|
| SL_CPC_ENDPOINT_USER_ID_0 | User endpoint ID 0. |
| SL_CPC_ENDPOINT_USER_ID_1 | User endpoint ID 1. |
| SL_CPC_ENDPOINT_USER_ID_2 | User endpoint ID 2. |
| SL_CPC_ENDPOINT_USER_ID_3 | User endpoint ID 3. |
| SL_CPC_ENDPOINT_USER_ID_4 | User endpoint ID 4. |
| SL_CPC_ENDPOINT_USER_ID_5 | User endpoint ID 5. |
| SL_CPC_ENDPOINT_USER_ID_6 | User endpoint ID 6. |
| SL_CPC_ENDPOINT_USER_ID_7 | User endpoint ID 7. |
| SL_CPC_ENDPOINT_USER_ID_8 | User endpoint ID 8. |
| SL_CPC_ENDPOINT_USER_ID_9 | User endpoint ID 9. |
sl_cpc_endpoint_state_t#
sl_cpc_endpoint_state_t
Enumeration representing the possible endpoint state.
| Enumerator | |
|---|---|
| SL_CPC_STATE_OPEN | State open. |
| SL_CPC_STATE_CLOSED | State close. |
| SL_CPC_STATE_CLOSING | State closing. |
| SL_CPC_STATE_ERROR_DESTINATION_UNREACHABLE | Error state, destination unreachable. |
| SL_CPC_STATE_ERROR_SECURITY_INCIDENT | Error state, security incident. |
| SL_CPC_STATE_ERROR_FAULT | Error state, fault. |
| SL_CPC_STATE_FREED | State freed. |
sl_cpc_endpoint_option_t#
sl_cpc_endpoint_option_t
Enumeration representing the possible configurable options for an endpoint.
| Enumerator | |
|---|---|
| SL_CPC_ENDPOINT_ON_IFRAME_RECEIVE | Set callback for iframe received notification. |
| SL_CPC_ENDPOINT_ON_IFRAME_RECEIVE_ARG | Set callback argument for iframe received notification. |
| SL_CPC_ENDPOINT_ON_IFRAME_WRITE_COMPLETED | Set callback for write complete notification. |
| SL_CPC_ENDPOINT_ON_ERROR | Set callback for error notification. |
| SL_CPC_ENDPOINT_ON_ERROR_ARG | Set callback argument for error notification. |
| SL_CPC_ENDPOINT_ON_UFRAME_RECEIVE | |
| SL_CPC_ENDPOINT_ON_UFRAME_RECEIVE_ARG | |
| SL_CPC_ENDPOINT_ON_UFRAME_WRITE_COMPLETED | |
| SL_CPC_ENDPOINT_ON_POLL | |
| SL_CPC_ENDPOINT_ON_POLL_ARG | |
| SL_CPC_ENDPOINT_ON_FINAL | |
| SL_CPC_ENDPOINT_ON_FINAL_ARG | |
Typedef Documentation#
sl_cpc_on_write_completed_t#
typedef void(* sl_cpc_on_write_completed_t) (sl_cpc_user_endpoint_id_t endpoint_id, void *buffer, void *arg, sl_status_t status) )(sl_cpc_user_endpoint_id_t endpoint_id, void *buffer, void *arg, sl_status_t status)
Typedef for the user - supplied callback function which is called when CPC is done with the provided buffer.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| N/A | endpoint_id | Endpoint ID | |
| N/A | buffer | Pointer to data buffer. | |
| N/A | arg | Transaction user's argument. | |
| N/A | status | Status indicating the transaction result: SL_STATUS_OK Remote should have receive the frame SL_STATUS_TRANSMIT_INCOMPLETE Remote has not received the frame. |
sl_cpc_on_data_reception_t#
typedef void(* sl_cpc_on_data_reception_t) (uint8_t endpoint_id, void *arg) )(uint8_t endpoint_id, void *arg)
Typedef for the user - supplied callback function which is called when CPC receive data on an endpoint.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| N/A | endpoint_id | Endpoint ID | |
| N/A | arg | User-specific argument . |
sl_cpc_on_error_callback_t#
typedef void(* sl_cpc_on_error_callback_t) (uint8_t endpoint_id, void *arg) )(uint8_t endpoint_id, void *arg)
Typedef for the user-supplied callback function which is called when CPC detects a fatal error on an endpoint.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| N/A | endpoint_id | Endpoint ID | |
| N/A | arg | User-specific argument . |
Function Documentation#
sl_cpc_init#
sl_status_t sl_cpc_init (void )
Global variable that contains the core debug information.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
Initialize CPC module.
Returns
Status code.
sl_cpc_open_user_endpoint#
sl_status_t sl_cpc_open_user_endpoint (sl_cpc_endpoint_handle_t * endpoint_handle, sl_cpc_user_endpoint_id_t id, uint8_t flags, uint8_t tx_window_size)
The bare metal process action function.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
| sl_cpc_user_endpoint_id_t | [in] | id | Endpoint ID [90 to 99]. |
| uint8_t | [in] | flags | Endpoint type flags. SL_CPC_OPEN_ENDPOINT_FLAG_NONE Default behaviors SL_CPC_OPEN_ENDPOINT_FLAG_DISABLE_ENCRYPTION Disable encryption on the endpoint |
| uint8_t | [in] | tx_window_size | Transmit window size. |
Open user endpoint.
Returns
Status code.
sl_cpc_set_endpoint_option#
sl_status_t sl_cpc_set_endpoint_option (sl_cpc_endpoint_handle_t * endpoint_handle, sl_cpc_endpoint_option_t option, void * value)
Set endpoint option.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
| sl_cpc_endpoint_option_t | [in] | option | Endpoint Option. |
| void * | [in] | value | Pointer to the option value. |
Returns
Status code.
Note
Public options are:
SL_CPC_ENDPOINT_ON_IFRAME_RECEIVE: Set an on iframe receive callback. value is a sl_cpc_on_data_reception_t type.
SL_CPC_ENDPOINT_ON_IFRAME_RECEIVE_ARG: Set an on iframe receive argument.
SL_CPC_ENDPOINT_ON_IFRAME_WRITE_COMPLETED: Set an on iframe write completed callback. value is a sl_cpc_on_write_completed_t type.
SL_CPC_ENDPOINT_ON_ERROR: Set an on error callback. value is a sl_cpc_on_error_callback_t type.
SL_CPC_ENDPOINT_ON_ERROR_ARG: Set an on error callback argument.
sl_cpc_close_endpoint#
sl_status_t sl_cpc_close_endpoint (sl_cpc_endpoint_handle_t * endpoint_handle)
Close endpoint.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
Returns
Status code.
sl_cpc_abort_read#
sl_status_t sl_cpc_abort_read (sl_cpc_endpoint_handle_t * endpoint_handle)
Abort read; Allow unblockling task in blocked by a read.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
Returns
Status code.
Note
This function can be called from an ISR.
sl_cpc_read#
sl_status_t sl_cpc_read (sl_cpc_endpoint_handle_t * endpoint_handle, void ** data, uint16_t * data_length, uint32_t timeout, uint8_t flags)
Read data.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
| void ** | [out] | data | Address of the variable that will receive the data pointer. |
| uint16_t * | [out] | data_length | Length of the data contained in the buffer. |
| uint32_t | [in] | timeout | Timeout in ticks for the read operation. (Requires RTOS). Note: No effect if SL_CPC_FLAG_NO_BLOCK is provided as a flag |
| uint8_t | [in] | flags | Optional flags. i.g. SL_CPC_FLAG_NO_BLOCK. Note: SL_CPC_FLAG_NO_BLOCK will cause the function to return SL_STATUS_EMPTY on kernel applications |
Returns
Status code.
sl_cpc_write#
sl_status_t sl_cpc_write (sl_cpc_endpoint_handle_t * endpoint_handle, void * data, uint16_t data_length, uint8_t flag, void * on_write_completed_arg)
Write data.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
| void * | [in] | data | Pointer to data buffer. |
| uint16_t | [in] | data_length | Length of the data contained in the buffer. |
| uint8_t | [in] | flag | Optional flags. |
| void * | [in] | on_write_completed_arg | Argument that will be passed to on_write_completed(). |
Returns
Status code.
Note
This function cannot be called from an ISR.
sl_cpc_get_endpoint_state#
sl_cpc_endpoint_state_t sl_cpc_get_endpoint_state (sl_cpc_endpoint_handle_t * endpoint_handle)
Get endpoint state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
Returns
Endpoint state.
sl_cpc_get_endpoint_encryption#
bool sl_cpc_get_endpoint_encryption (sl_cpc_endpoint_handle_t * endpoint_handle)
Get endpoint encryption state.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_cpc_endpoint_handle_t * | [in] | endpoint_handle | Endpoint handle. |
Returns
Endpoint encryption state.
sl_cpc_free_rx_buffer#
sl_status_t sl_cpc_free_rx_buffer (void * data)
Free buffer returned by sl_cpc_read().
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void * | [in] | data | Pointer to data buffer to free. |
Returns
Status code.