1 /* 2 * Interface of low level MUSB core logic (variant independent) 3 */ 4 5 #ifndef _MUSB_CORE_H_ 6 #define _MUSB_CORE_H_ 7 8 #include <usbd/hcd_common.h> 9 10 11 /*===========================================================================* 12 * Types and constants * 13 *===========================================================================*/ 14 /* Structure to hold Mentor USB core configuration 15 * May be more than one on a single chip 16 * Should be initialized by MUSB's variant specific code (like AM335x) */ 17 typedef struct { 18 19 void * regs; /* Points to beginning of memory mapped registers */ 20 hcd_reg1 ep; /* Currently used endpoint */ 21 hcd_reg1 addr; /* Currently used address */ 22 hcd_datatog * datatog_tx; /* Should point at currently used TX toggle */ 23 hcd_datatog * datatog_rx; /* Should point at currently used RX toggle */ 24 } 25 musb_core_config; 26 27 28 /*===========================================================================* 29 * Function prototypes * 30 *===========================================================================*/ 31 /* Only to be used outside generic HCD code */ 32 void musb_core_start(void *); 33 void musb_core_stop(void *); 34 35 36 /* For HCD interface */ 37 void musb_setup_device(void *, hcd_reg1, hcd_reg1, 38 hcd_datatog *, hcd_datatog *); 39 int musb_reset_device(void *, hcd_speed *); 40 void musb_setup_stage(void *, hcd_ctrlrequest *); 41 void musb_rx_stage(void *, hcd_datarequest *); 42 void musb_tx_stage(void *, hcd_datarequest *); 43 void musb_in_data_stage(void *); 44 void musb_out_data_stage(void *); 45 void musb_in_status_stage(void *); 46 void musb_out_status_stage(void *); 47 int musb_read_data(void *, hcd_reg1 *, hcd_reg1); 48 int musb_check_error(void *, hcd_transfer, hcd_reg1, hcd_direction); 49 50 51 #endif /* !_MUSB_CORE_H_ */ 52