ML Middleware
ModusToolbox Machine Learning Middleware Library
All Data Structures Functions Variables Modules
Stream_API

Functions

cy_rslt_t mtb_ml_stream_init (mtb_ml_stream_interface_t *interface, const mtb_ml_model_t *model_object)
 : Prepare for data streaming: initialize members of interface, validate input test data matches dimensions of model object. More...
 
cy_rslt_t mtb_ml_stream_output_data (mtb_ml_stream_interface_t *interface, void *tx_buf, uint32_t timeout_ms)
 : Streams output test data via interface. More...
 
cy_rslt_t mtb_ml_stream_input_data (mtb_ml_stream_interface_t *interface, void *rx_buf, uint32_t timeout_ms)
 : Streams input test data via interface. More...
 
cy_rslt_t mtb_ml_inform_host_done (mtb_ml_stream_interface_t *interface, uint32_t timeout_ms)
 : API to inform host application when the device task is complete More...
 
void mtb_ml_stream_cb (void *tag, cy_rslt_t rslt)
 : TX/RX callback function. More...
 

Detailed Description

Function Documentation

◆ mtb_ml_inform_host_done()

cy_rslt_t mtb_ml_inform_host_done ( mtb_ml_stream_interface_t interface,
uint32_t  timeout_ms 
)

: API to inform host application when the device task is complete

Parameters
[in]interface: Stream interface provided by user. Used to stream input data.
[in]timeout_ms: Timeout in milliseconds. Value of 0 means attempt to receive data forever.
Returns
: MTB_ML_RESULT_SUCCESS - success : otherwise - check the return value for detail.

◆ mtb_ml_stream_cb()

void mtb_ml_stream_cb ( void *  tag,
cy_rslt_t  rslt 
)

: TX/RX callback function.

Parameters
[in]tag: Used to store arbitrary caller information.
[in]rslt: Result of TX/RX parent callback.
Returns
: None

◆ mtb_ml_stream_init()

cy_rslt_t mtb_ml_stream_init ( mtb_ml_stream_interface_t interface,
const mtb_ml_model_t model_object 
)

: Prepare for data streaming: initialize members of interface, validate input test data matches dimensions of model object.

Parameters
[in]interface: Stream interface provided by user. interface_obj, rx_tag, and tx_tag must be allocated by user. input_size and output_size will be set by call.
[in]model_object: Model object associated with interface. Parsed to verify input test data and initialize interface.
Returns
: MTB_ML_RESULT_SUCCESS - success : otherwise - check the return value for detail.

◆ mtb_ml_stream_input_data()

cy_rslt_t mtb_ml_stream_input_data ( mtb_ml_stream_interface_t interface,
void *  rx_buf,
uint32_t  timeout_ms 
)

: Streams input test data via interface.

Parameters
[in]interface: Stream interface provided by user. Used to stream input data.
[in]rx_buf: Receive buffer. Assumed to be of size interface->input_size.
[in]timeout_ms: Timeout in milliseconds. Value of 0 means attempt to receive data forever.
Returns
: MTB_ML_RESULT_SUCCESS - success : otherwise - check the return value for detail.

◆ mtb_ml_stream_output_data()

cy_rslt_t mtb_ml_stream_output_data ( mtb_ml_stream_interface_t interface,
void *  tx_buf,
uint32_t  timeout_ms 
)

: Streams output test data via interface.

Parameters
[in]interface: Stream interface provided by user. Used to stream output data.
[in]tx_buf: Transmit buffer. Assumed to be of size interface->output_size.
[in]timeout_ms: Timeout in milliseconds. Value of 0 means attempt to transmit data forever.
Returns
: MTB_ML_RESULT_SUCCESS - success : otherwise - check the return value for detail.