USB Device Middleware Library 2.10
Function Pointers

General Description

Typedefs

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_events_callback_t) (cy_en_usb_dev_callback_events_t event, uint32_t wValue, uint32_t wIndex, struct cy_stc_usb_dev_context *devContext)
 Pointer to a function that implements a callback for the following events: Bus Reset detected, SET_CONFIGURATION request received and SET_INTERFACE request received. More...
 
typedef int32_t(* cy_fn_usb_dev_handle_timeout_ptr_t) (int32_t milliseconds)
 Pointer to a function that implements a timeout handler. More...
 
typedef uint8_t *(* cy_fn_usb_dev_sn_string_ptr_t) (void)
 Pointer to function that returns pointer to uint8_t array, which contains a serial number string and accepts the device context cy_stc_usb_dev_context_t. More...
 
typedef void(* cy_cb_usb_dev_bus_reset_t) (void *classData, struct cy_stc_usb_dev_context *devContext)
 Pointer to function that returns nothing and accepts a pointer to void and a pointer to cy_stc_usb_dev_context_t. More...
 
typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_set_config_t) (uint32_t configuration, void *classData, struct cy_stc_usb_dev_context *devContext)
 Pointer to function that returns the status of operation and accepts received configuration number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t. More...
 
typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_set_interface_t) (uint32_t interface, uint32_t alternate, void *classContext, struct cy_stc_usb_dev_context *devContext)
 Pointer to function that returns the status of operation and accepts received interface alternate settings number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t. More...
 
typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_request_received_t) (cy_stc_usb_dev_control_transfer_t *transfer, void *classContext, struct cy_stc_usb_dev_context *devContext)
 Pointer to function that returns the status of operation and accepts pointer to received control transfer number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t. More...
 
typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_request_cmplt_t) (cy_stc_usb_dev_control_transfer_t *transfer, void *classContext, struct cy_stc_usb_dev_context *devContext)
 Pointer to function that returns status of operation and accepts pointer to received control transfer number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t. More...
 

Typedef Documentation

◆ cy_cb_usb_dev_events_callback_t

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_events_callback_t) (cy_en_usb_dev_callback_events_t event, uint32_t wValue, uint32_t wIndex, struct cy_stc_usb_dev_context *devContext)

Pointer to a function that implements a callback for the following events: Bus Reset detected, SET_CONFIGURATION request received and SET_INTERFACE request received.

The notified events are defined by event argument (see cy_en_usb_dev_callback_events_t). Only one event is notified when callback invoked. This callback invoked in the USB interrupt handler context and must be short as possible.
Input arguments:

  • Bus Reset detected event: ignore wValue and wIndex arguments.
  • SET_CONFIGURATION request received event: the wValue is new configuration value and wIndex can be ignored.
  • SET_CONFIGURATION request received event: the wValue is new alternative setting value and wIndex interface value to which alternate belongs.
    The returned status defines following operation:
  • Bus Reset detected event: status is ignored and event processing is passed to class event handlers.
  • SET_CONFIGURATION or SET_INTERFACE received event: the returned status defines following request processing. If returned status fail the request is STALLed and event notification stops. If returned status is success the event is notified to the appropriate class event handlers which status defines request response STALL or ACK.

◆ cy_fn_usb_dev_handle_timeout_ptr_t

typedef int32_t(* cy_fn_usb_dev_handle_timeout_ptr_t) (int32_t milliseconds)

Pointer to a function that implements a timeout handler.

The function accepts the number of milliseconds that remain to wait before timeout expires. This returns the number of milliseconds remaining to wait minus the milliseconds that have elapsed inside the function.

◆ cy_fn_usb_dev_sn_string_ptr_t

typedef uint8_t*(* cy_fn_usb_dev_sn_string_ptr_t) (void)

Pointer to function that returns pointer to uint8_t array, which contains a serial number string and accepts the device context cy_stc_usb_dev_context_t.

This type is used to define a callback that returns serial number string.

◆ cy_cb_usb_dev_bus_reset_t

typedef void(* cy_cb_usb_dev_bus_reset_t) (void *classData, struct cy_stc_usb_dev_context *devContext)

Pointer to function that returns nothing and accepts a pointer to void and a pointer to cy_stc_usb_dev_context_t.

This type is used to define a callback that notifies the class about a bus reset event.

◆ cy_cb_usb_dev_set_config_t

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_set_config_t) (uint32_t configuration, void *classData, struct cy_stc_usb_dev_context *devContext)

Pointer to function that returns the status of operation and accepts received configuration number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t.

This type is used to define a callback that notifies the class about a set configuration request event.

◆ cy_cb_usb_dev_set_interface_t

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_set_interface_t) (uint32_t interface, uint32_t alternate, void *classContext, struct cy_stc_usb_dev_context *devContext)

Pointer to function that returns the status of operation and accepts received interface alternate settings number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t.

This type is used to define a callback that notifies the class about a set interface request event.

◆ cy_cb_usb_dev_request_received_t

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_request_received_t) (cy_stc_usb_dev_control_transfer_t *transfer, void *classContext, struct cy_stc_usb_dev_context *devContext)

Pointer to function that returns the status of operation and accepts pointer to received control transfer number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t.

This type is used to define a callback that notifies the class about a request received event.

◆ cy_cb_usb_dev_request_cmplt_t

typedef cy_en_usb_dev_status_t(* cy_cb_usb_dev_request_cmplt_t) (cy_stc_usb_dev_control_transfer_t *transfer, void *classContext, struct cy_stc_usb_dev_context *devContext)

Pointer to function that returns status of operation and accepts pointer to received control transfer number, pointer to class context, and pointer to device context cy_stc_usb_dev_context_t.

This type is used to define a callback that notifies the class that a request completed (data is received in response for current request) event.