/************************************************************************************************************** * altobeam RTOS * * Copyright (c) 2018, altobeam.inc All rights reserved. * * The source code contains proprietary information of AltoBeam, and shall not be distributed, * copied, reproduced, or disclosed in whole or in part without prior written permission of AltoBeam. *****************************************************************************************************************/ #ifndef ATBM_USB_H #define ATBM_USB_H #include "atbm_sbus.h" #include "atbm_os_usb.h" #include "atbm_os_atomic.h" #include "atbm_os_spinlock.h" #ifdef CONFIG_USB_AGGR_URB_TX #define PER_PACKET_LEN 2048 //must pow 512 #define URB_AGGR_NUM 8 #define PER_BUFF_AGGR_NUM 8 #define TX_URB_NUM 4 #define RX_URB_NUM 4 #define BUFF_ALLOC_LEN (PER_BUFF_AGGR_NUM*PER_PACKET_LEN) #define TX_BUFFER_SIZE 2048 #else //CONFIG_USB_AGGR_URB_TX #define TX_URB_NUM 4 //must be 4.can't change #define RX_URB_NUM 4 //must <= 4 #define TX_BUFFER_SIZE 1680 #endif //CONFIG_USB_AGGR_URB_TX #define ATBM_USB_EP0_MAX_SIZE 64 #define ATBM_USB_EP1_MAX_RX_SIZE 512 #define ATBM_USB_EP2_MAX_TX_SIZE 512 #define ATBM_USB_VENQT_WRITE 0x40 #define ATBM_USB_VENQT_READ 0xc0 #define RX_SKB__RX_QUEUE_PACKAGE 3 /*usb vendor define type, EP0, bRequest*/ enum { VENDOR_HW_READ=0, VENDOR_HW_WRITE=1, VENDOR_HW_RESVER=2, VENDOR_SW_CPU_JUMP=3,/*cpu jump to real lmac code,after fw download*/ VENDOR_SW_READ=4, VENDOR_SW_WRITE=5, #if (PROJ_TYPE