18#ifndef __VSF_HAL_DISTBUS_USBD_H__
19#define __VSF_HAL_DISTBUS_USBD_H__
26#if VSF_USE_USB_DEVICE == ENABLED && VSF_HAL_USE_USBD == ENABLED &&VSF_HAL_DISTBUS_USE_USBD == ENABLED
28#if defined(__VSF_HAL_DISTBUS_USBD_CLASS_IMPLEMENT)
29# define __VSF_CLASS_IMPLEMENT__
30#elif defined(__VSF_HAL_DISTBUS_USBD_CLASS_INHERIT__)
31# define __VSF_CLASS_INHERIT__
42#ifndef VSF_HAL_DISTBUS_USBD_CFG_MULTI_CLASS
43# define VSF_HAL_DISTBUS_USBD_CFG_MULTI_CLASS VSF_USBD_CFG_MULTI_CLASS
48#define vsf_usb_dc_from_distbus_ip(__n, __obj, __drv_name) \
49 __USB_DC_FROM_IP(__n, (__obj), __drv_name, vsf_hal_distbus_usbd)
53#if defined(__VSF_HAL_DISTBUS_USBD_CLASS_IMPLEMENT) || defined(__VSF_HAL_DISTBUS_USBD_CLASS_INHERIT__)
55 VSF_HAL_DISTBUS_USBD_CMD_INIT = 0,
56 VSF_HAL_DISTBUS_USBD_CMD_FINI,
57 VSF_HAL_DISTBUS_USBD_CMD_RESET,
58 VSF_HAL_DISTBUS_USBD_CMD_CONNECT,
59 VSF_HAL_DISTBUS_USBD_CMD_DISCONNECT,
60 VSF_HAL_DISTBUS_USBD_CMD_WAKEUP,
61 VSF_HAL_DISTBUS_USBD_CMD_SET_ADDRESS,
62 VSF_HAL_DISTBUS_USBD_CMD_STATUS_STAGE,
63 VSF_HAL_DISTBUS_USBD_CMD_EP_ADD,
64 VSF_HAL_DISTBUS_USBD_CMD_EP_SET_STALL,
65 VSF_HAL_DISTBUS_USBD_CMD_EP_CLEAR_STALL,
66 VSF_HAL_DISTBUS_USBD_CMD_EP_ENABLE_OUT,
67 VSF_HAL_DISTBUS_USBD_CMD_EP_SET_DATA_SIZE,
68 VSF_HAL_DISTBUS_USBD_CMD_EP_WRITE_BUFFER,
69 VSF_HAL_DISTBUS_USBD_CMD_TRANSFER_SEND,
70 VSF_HAL_DISTBUS_USBD_CMD_TRANSFER_RECV,
71 VSF_HAL_DISTBUS_USBD_CMD_ON_EVT,
73 VSF_HAL_DISTBUS_USBD_CMD_ADDR_RANGE,
89#if VSF_HAL_DISTBUS_USBD_CFG_MULTI_CLASS == ENABLED
167#undef __VSF_HAL_DISTBUS_USBD_CLASS_IMPLEMENT
168#undef __VSF_HAL_DISTBUS_USBD_CLASS_INHERIT__
vsf_err_t
Definition __type.h:42
Definition vsf_distbus.h:68
Definition vsf_distbus.h:86
Definition vsf_distbus.h:119
Definition vsf_hal_distbus_usbd.h:88
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned short uint_fast16_t
Definition stdint.h:25
Definition vsf_template_usb.h:316
Definition vsf_hal_distbus_usbd.h:77
uint8_t zlp
Definition vsf_hal_distbus_usbd.h:81
vsf_distbus_msg_t * msg
Definition vsf_hal_distbus_usbd.h:85
uint16_t size
Definition vsf_hal_distbus_usbd.h:78
uint8_t pending
Definition vsf_hal_distbus_usbd.h:82
uint8_t is_stalled
Definition vsf_hal_distbus_usbd.h:80
uint8_t ep
Definition vsf_hal_distbus_usbd.h:83
uint8_t type
Definition vsf_hal_distbus_usbd.h:79
vk_av_control_type_t type
Definition vsf_audio.h:170
void vsf_hal_distbus_usbd_status_stage(vsf_hal_distbus_usbd_t *usbd, bool is_in)
Definition vsf_hal_distbus_usbd.c:218
vsf_err_t vsf_hal_distbus_usbd_ep_clear_stall(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:289
uint_fast8_t vsf_hal_distbus_usbd_ep_get_feature(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint_fast8_t feature)
Definition vsf_hal_distbus_usbd.c:230
uint_fast8_t vsf_hal_distbus_usbd_get_address(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:198
vsf_err_t vsf_hal_distbus_usbd_ep_transfer_recv(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint8_t *buffer, uint_fast32_t size)
Definition vsf_hal_distbus_usbd.c:379
void vsf_hal_distbus_usbd_disconnect(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:164
void vsf_hal_distbus_usbd_set_address(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t addr)
Definition vsf_hal_distbus_usbd.c:184
void vsf_hal_distbus_usbd_reset(vsf_hal_distbus_usbd_t *usbd, usb_dc_cfg_t *cfg)
Definition vsf_hal_distbus_usbd.c:139
vsf_err_t vsf_hal_distbus_usbd_ep_transaction_enable_out(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:328
uint_fast16_t vsf_hal_distbus_usbd_ep_get_size(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:258
void vsf_hal_distbus_usbd_fini(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:129
void vsf_hal_distbus_usbd_get_setup(vsf_hal_distbus_usbd_t *usbd, uint8_t *buffer)
Definition vsf_hal_distbus_usbd.c:213
vsf_err_t vsf_hal_distbus_usbd_ep_transaction_read_buffer(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint8_t *buffer, uint_fast16_t size)
Definition vsf_hal_distbus_usbd.c:316
uint32_t vsf_hal_distbus_usbd_register_service(vsf_distbus_t *distbus, vsf_hal_distbus_usbd_t *usbd, void *info, uint32_t infolen)
Definition vsf_hal_distbus_usbd.c:420
vsf_err_t vsf_hal_distbus_usbd_ep_transfer_send(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint8_t *buffer, uint_fast32_t size, bool zlp)
Definition vsf_hal_distbus_usbd.c:396
vsf_err_t vsf_hal_distbus_usbd_ep_set_stall(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:264
uint_fast8_t vsf_hal_distbus_usbd_get_mframe_number(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:208
vsf_err_t vsf_hal_distbus_usbd_init(vsf_hal_distbus_usbd_t *usbd, usb_dc_cfg_t *cfg)
Definition vsf_hal_distbus_usbd.c:108
void vsf_hal_distbus_usbd_connect(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:154
bool vsf_hal_distbus_usbd_ep_is_stalled(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:283
void vsf_hal_distbus_usbd_irq(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:415
void vsf_hal_distbus_usbd_wakeup(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:174
uint_fast16_t vsf_hal_distbus_usbd_get_frame_number(vsf_hal_distbus_usbd_t *usbd)
Definition vsf_hal_distbus_usbd.c:203
vsf_err_t vsf_hal_distbus_usbd_ep_transaction_write_buffer(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint8_t *buffer, uint_fast16_t size)
Definition vsf_hal_distbus_usbd.c:361
vsf_err_t vsf_hal_distbus_usbd_ep_add(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, usb_ep_type_t type, uint_fast16_t size)
Definition vsf_hal_distbus_usbd.c:235
uint_fast32_t vsf_hal_distbus_usbd_ep_get_data_size(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep)
Definition vsf_hal_distbus_usbd.c:308
vsf_err_t vsf_hal_distbus_usbd_ep_transaction_set_data_size(vsf_hal_distbus_usbd_t *usbd, uint_fast8_t ep, uint_fast16_t size)
Definition vsf_hal_distbus_usbd.c:344
uint32_t size
Definition vsf_memfs.h:50
usb_ep_type_t
Definition vsf_template_usb.h:277
void(* usb_dc_evthandler_t)(void *param, usb_evt_t evt, uint_fast8_t value)
Definition vsf_template_usb.h:309