#include <dev/usb_stm32/usb_lib.h>
#include <dev/usb_stm32/otgd_fs_cal.h>
#include <dev/usb_stm32/otgd_fs_pcd.h>
#include <sys/timer.h>
Functions | |
void | OTGD_FS_PCD_Init (void) |
uint32_t | OTGD_FS_PCD_EP_Open (EP_DESCRIPTOR *epdesc) |
uint32_t | OTGD_FS_PCD_EP_Close (uint8_t ep_addr) |
uint32_t | OTGD_FS_PCD_EP_Read (uint8_t ep_addr, uint8_t *pbuf, uint32_t buf_len) |
uint32_t | OTGD_FS_PCD_EP_Write (uint8_t ep_addr, uint8_t *pbuf, uint32_t buf_len) |
uint32_t | OTGD_FS_PCD_EP_Stall (uint8_t ep_addr) |
uint32_t | OTGD_FS_PCD_EP_ClrStall (uint8_t ep_addr) |
uint32_t | OTGD_FS_PCD_EP_Flush (uint8_t ep_addr) |
void | OTGD_FS_PCD_EP_SetAddress (uint8_t address) |
USB_OTG_EP * | OTGD_FS_PCD_GetInEP (uint32_t ep_num) |
USB_OTG_EP * | OTGD_FS_PCD_GetOutEP (uint32_t ep_num) |
void | OTGD_FS_PCD_DevConnect (void) |
void | OTGD_FS_PCD_DevDisconnect (void) |
void | OTGD_FS_PCD_EP0_OutStart (void) |
Variables | |
USB_OTG_PCD_DEV | USB_OTG_PCD_dev |
USB_OTG_CORE_REGS | core_regs |
void OTGD_FS_PCD_Init | ( | void | ) |
References USB_OTG_USBF::ep0, USB_OTG_USBF::ep0state, EP_TYPE_CTRL, USB_OTG_USBF::in_ep, USB_OTG_ep::is_in, MAX_EP0_SIZE, MAX_PACKET_SIZE, MAX_TX_FIFOS, USB_OTG_ep::maxpacket, USB_OTG_ep::num, USB_OTG_USBF::out_ep, USB_OTG_ep::tx_fifo_num, USB_OTG_ep::type, USB_OTG_ep::xfer_buff, and USB_OTG_ep::xfer_len.
Referenced by OTG_DEV_Init().
uint32_t OTGD_FS_PCD_EP_Open | ( | EP_DESCRIPTOR * | epdesc | ) |
References usb_ep_descriptor::bEndpointAddress, usb_ep_descriptor::bmAttributes, USB_OTG_ep::data_pid_start, USB_OTG_ep::is_in, USB_OTG_ep::maxpacket, USB_OTG_ep::num, OTGD_FS_EPActivate(), OTGD_FS_PCD_GetInEP(), OTGD_FS_PCD_GetOutEP(), USB_OTG_ep::tx_fifo_num, USB_OTG_ep::type, USB_ENDPOINT_XFER_BULK, USB_ENDPOINT_XFERTYPE_MASK, and usb_ep_descriptor::wMaxPacketSize.
Referenced by OTG_DEV_EP_Init(), and OTG_DEV_Init().
References USB_OTG_ep::is_in, USB_OTG_ep::num, OTGD_FS_EPDeactivate(), OTGD_FS_PCD_GetInEP(), and OTGD_FS_PCD_GetOutEP().
References USB_OTG_USBF::ep0state, USB_OTG_ep::is_in, USB_OTG_ep::num, OTGD_FS_EP0StartXfer(), OTGD_FS_EPStartXfer(), OTGD_FS_PCD_GetOutEP(), USB_OTG_ep::xfer_buff, USB_OTG_ep::xfer_count, and USB_OTG_ep::xfer_len.
Referenced by USB_SIL_Read().
References USB_OTG_USBF::ep0state, USB_OTG_ep::is_in, USB_OTG_ep::num, OTGD_FS_EP0StartXfer(), OTGD_FS_EPStartXfer(), OTGD_FS_PCD_GetInEP(), USB_OTG_ep::xfer_buff, USB_OTG_ep::xfer_count, and USB_OTG_ep::xfer_len.
Referenced by USB_SIL_Write().
References USB_OTG_ep::is_in, USB_OTG_ep::num, OTGD_FS_EPSetStall(), OTGD_FS_PCD_GetInEP(), and OTGD_FS_PCD_GetOutEP().
References USB_OTG_ep::is_in, USB_OTG_ep::num, OTGD_FS_EPClearStall(), OTGD_FS_PCD_GetInEP(), and OTGD_FS_PCD_GetOutEP().
Referenced by OTGD_FS_PCD_EP_Flush().
References OTGD_FS_FlushRxFifo(), OTGD_FS_FlushTxFifo(), and OTGD_FS_PCD_EP_ClrStall().
Referenced by OTG_DEV_EP_Init().
void OTGD_FS_PCD_EP_SetAddress | ( | uint8_t | address | ) |
References _USB_OTG_dev_cfg_data::b, _USB_OTG_dev_cfg_data::d32, _USB_OTG_dev_regs::dev_cfg, USB_OTG_core_regs::dev_regs, _USB_OTG_dev_cfg_data::devaddr, and MODIFY_REG32.
Referenced by SetDeviceAddress().
USB_OTG_EP* OTGD_FS_PCD_GetInEP | ( | uint32_t | ep_num | ) |
References USB_OTG_USBF::ep0, USB_OTG_USBF::in_ep, MAX_TX_FIFOS, and USB_OTG_ep::num.
Referenced by OTG_DEV_EP_Init(), OTG_DEV_GetEPTxStatus(), OTG_DEV_SetEPTxStatus(), OTGD_FS_Handle_InEP_ISR(), OTGD_FS_PCD_EP_Close(), OTGD_FS_PCD_EP_ClrStall(), OTGD_FS_PCD_EP_Open(), OTGD_FS_PCD_EP_Stall(), OTGD_FS_PCD_EP_Write(), and Post0_Process().
USB_OTG_EP* OTGD_FS_PCD_GetOutEP | ( | uint32_t | ep_num | ) |
References USB_OTG_USBF::ep0, MAX_TX_FIFOS, USB_OTG_ep::num, and USB_OTG_USBF::out_ep.
Referenced by EP3_OUT_Callback(), OTG_DEV_EP_Init(), OTG_DEV_GetEPRxStatus(), OTG_DEV_Init(), OTG_DEV_SetEPRxStatus(), OTGD_FS_Handle_OutEP_ISR(), OTGD_FS_Handle_RxStatusQueueLevel_ISR(), OTGD_FS_PCD_EP_Close(), OTGD_FS_PCD_EP_ClrStall(), OTGD_FS_PCD_EP_Open(), OTGD_FS_PCD_EP_Read(), OTGD_FS_PCD_EP_Stall(), Setup0_Process(), and USB_SIL_Read().
void OTGD_FS_PCD_DevConnect | ( | void | ) |
References _USB_OTG_dev_ctl_data::b, _USB_OTG_dev_ctl_data::d32, _USB_OTG_dev_regs::dev_ctl, USB_OTG_core_regs::dev_regs, NutSleep(), READ_REG32, _USB_OTG_dev_ctl_data::sftdiscon, and WRITE_REG32.
Referenced by USB_DevConnect().
void OTGD_FS_PCD_DevDisconnect | ( | void | ) |
References _USB_OTG_dev_ctl_data::b, _USB_OTG_dev_ctl_data::d32, _USB_OTG_dev_regs::dev_ctl, USB_OTG_core_regs::dev_regs, NutSleep(), READ_REG32, _USB_OTG_dev_ctl_data::sftdiscon, and WRITE_REG32.
Referenced by USB_DevDisconnect().
void OTGD_FS_PCD_EP0_OutStart | ( | void | ) |
References _USB_OTG_dev_ep_txfer_size0_data::b, _USB_OTG_dev_ep_txfer_size0_data::d32, _USB_OTG_dev_out_ep_regs::dev_out_ep_txfer_siz, USB_OTG_core_regs::outep_regs, _USB_OTG_dev_ep_txfer_size0_data::pktcnt, _USB_OTG_dev_ep_txfer_size0_data::supcnt, WRITE_REG32, and _USB_OTG_dev_ep_txfer_size0_data::xfersize.
Referenced by OTG_DEV_Init(), and OTGD_FS_Handle_UsbReset_ISR().