Lines Matching refs:epnum
573 uint32_t epnum = (uint32_t)ep->num; in USB_ActivateEndpoint() local
579 if ((USBx_INEP(epnum)->DIEPCTL & USB_OTG_DIEPCTL_USBAEP) == 0U) in USB_ActivateEndpoint()
581 USBx_INEP(epnum)->DIEPCTL |= (ep->maxpacket & USB_OTG_DIEPCTL_MPSIZ) | in USB_ActivateEndpoint()
582 ((uint32_t)ep->type << 18) | (epnum << 22) | in USB_ActivateEndpoint()
591 if (((USBx_OUTEP(epnum)->DOEPCTL) & USB_OTG_DOEPCTL_USBAEP) == 0U) in USB_ActivateEndpoint()
593 USBx_OUTEP(epnum)->DOEPCTL |= (ep->maxpacket & USB_OTG_DOEPCTL_MPSIZ) | in USB_ActivateEndpoint()
611 uint32_t epnum = (uint32_t)ep->num; in USB_ActivateDedicatedEndpoint() local
616 if (((USBx_INEP(epnum)->DIEPCTL) & USB_OTG_DIEPCTL_USBAEP) == 0U) in USB_ActivateDedicatedEndpoint()
618 USBx_INEP(epnum)->DIEPCTL |= (ep->maxpacket & USB_OTG_DIEPCTL_MPSIZ) | in USB_ActivateDedicatedEndpoint()
619 ((uint32_t)ep->type << 18) | (epnum << 22) | in USB_ActivateDedicatedEndpoint()
628 if (((USBx_OUTEP(epnum)->DOEPCTL) & USB_OTG_DOEPCTL_USBAEP) == 0U) in USB_ActivateDedicatedEndpoint()
630 USBx_OUTEP(epnum)->DOEPCTL |= (ep->maxpacket & USB_OTG_DOEPCTL_MPSIZ) | in USB_ActivateDedicatedEndpoint()
631 ((uint32_t)ep->type << 18) | (epnum << 22) | in USB_ActivateDedicatedEndpoint()
650 uint32_t epnum = (uint32_t)ep->num; in USB_DeactivateEndpoint() local
655 if ((USBx_INEP(epnum)->DIEPCTL & USB_OTG_DIEPCTL_EPENA) == USB_OTG_DIEPCTL_EPENA) in USB_DeactivateEndpoint()
657 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SNAK; in USB_DeactivateEndpoint()
658 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_EPDIS; in USB_DeactivateEndpoint()
663 USBx_INEP(epnum)->DIEPCTL &= ~(USB_OTG_DIEPCTL_USBAEP | in USB_DeactivateEndpoint()
671 if ((USBx_OUTEP(epnum)->DOEPCTL & USB_OTG_DOEPCTL_EPENA) == USB_OTG_DOEPCTL_EPENA) in USB_DeactivateEndpoint()
673 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_SNAK; in USB_DeactivateEndpoint()
674 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_EPDIS; in USB_DeactivateEndpoint()
679 USBx_OUTEP(epnum)->DOEPCTL &= ~(USB_OTG_DOEPCTL_USBAEP | in USB_DeactivateEndpoint()
697 uint32_t epnum = (uint32_t)ep->num; in USB_DeactivateDedicatedEndpoint() local
702 if ((USBx_INEP(epnum)->DIEPCTL & USB_OTG_DIEPCTL_EPENA) == USB_OTG_DIEPCTL_EPENA) in USB_DeactivateDedicatedEndpoint()
704 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SNAK; in USB_DeactivateDedicatedEndpoint()
705 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_EPDIS; in USB_DeactivateDedicatedEndpoint()
708 USBx_INEP(epnum)->DIEPCTL &= ~ USB_OTG_DIEPCTL_USBAEP; in USB_DeactivateDedicatedEndpoint()
713 if ((USBx_OUTEP(epnum)->DOEPCTL & USB_OTG_DOEPCTL_EPENA) == USB_OTG_DOEPCTL_EPENA) in USB_DeactivateDedicatedEndpoint()
715 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_SNAK; in USB_DeactivateDedicatedEndpoint()
716 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_EPDIS; in USB_DeactivateDedicatedEndpoint()
719 USBx_OUTEP(epnum)->DOEPCTL &= ~USB_OTG_DOEPCTL_USBAEP; in USB_DeactivateDedicatedEndpoint()
739 uint32_t epnum = (uint32_t)ep->num; in USB_EPStartXfer() local
748 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_PKTCNT); in USB_EPStartXfer()
749 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_PKTCNT & (1U << 19)); in USB_EPStartXfer()
750 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_XFRSIZ); in USB_EPStartXfer()
759 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_XFRSIZ); in USB_EPStartXfer()
760 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_PKTCNT); in USB_EPStartXfer()
761 …USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_PKTCNT & (((ep->xfer_len + ep->maxpacket - 1U) / e… in USB_EPStartXfer()
762 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_XFRSIZ & ep->xfer_len); in USB_EPStartXfer()
766 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_MULCNT); in USB_EPStartXfer()
767 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_MULCNT & (1U << 29)); in USB_EPStartXfer()
775 USBx_INEP(epnum)->DIEPDMA = (uint32_t)(ep->dma_addr); in USB_EPStartXfer()
782 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SODDFRM; in USB_EPStartXfer()
786 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SD0PID_SEVNFRM; in USB_EPStartXfer()
791 USBx_INEP(epnum)->DIEPCTL |= (USB_OTG_DIEPCTL_CNAK | USB_OTG_DIEPCTL_EPENA); in USB_EPStartXfer()
796 USBx_INEP(epnum)->DIEPCTL |= (USB_OTG_DIEPCTL_CNAK | USB_OTG_DIEPCTL_EPENA); in USB_EPStartXfer()
810 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SODDFRM; in USB_EPStartXfer()
814 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SD0PID_SEVNFRM; in USB_EPStartXfer()
827 USBx_OUTEP(epnum)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_XFRSIZ); in USB_EPStartXfer()
828 USBx_OUTEP(epnum)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_PKTCNT); in USB_EPStartXfer()
832 USBx_OUTEP(epnum)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_XFRSIZ & ep->maxpacket); in USB_EPStartXfer()
833 USBx_OUTEP(epnum)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_PKTCNT & (1U << 19)); in USB_EPStartXfer()
838 USBx_OUTEP(epnum)->DOEPTSIZ |= USB_OTG_DOEPTSIZ_PKTCNT & ((uint32_t)pktcnt << 19); in USB_EPStartXfer()
839 USBx_OUTEP(epnum)->DOEPTSIZ |= USB_OTG_DOEPTSIZ_XFRSIZ & (ep->maxpacket * pktcnt); in USB_EPStartXfer()
846 USBx_OUTEP(epnum)->DOEPDMA = (uint32_t)(ep->xfer_buff); in USB_EPStartXfer()
854 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_SODDFRM; in USB_EPStartXfer()
858 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_SD0PID_SEVNFRM; in USB_EPStartXfer()
862 USBx_OUTEP(epnum)->DOEPCTL |= (USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA); in USB_EPStartXfer()
881 uint32_t epnum = (uint32_t)ep->num; in USB_EP0StartXfer() local
889 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_PKTCNT); in USB_EP0StartXfer()
890 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_PKTCNT & (1U << 19)); in USB_EP0StartXfer()
891 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_XFRSIZ); in USB_EP0StartXfer()
900 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_XFRSIZ); in USB_EP0StartXfer()
901 USBx_INEP(epnum)->DIEPTSIZ &= ~(USB_OTG_DIEPTSIZ_PKTCNT); in USB_EP0StartXfer()
907 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_PKTCNT & (1U << 19)); in USB_EP0StartXfer()
908 USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_XFRSIZ & ep->xfer_len); in USB_EP0StartXfer()
915 USBx_INEP(epnum)->DIEPDMA = (uint32_t)(ep->dma_addr); in USB_EP0StartXfer()
919 USBx_INEP(epnum)->DIEPCTL |= (USB_OTG_DIEPCTL_CNAK | USB_OTG_DIEPCTL_EPENA); in USB_EP0StartXfer()
924 USBx_INEP(epnum)->DIEPCTL |= (USB_OTG_DIEPCTL_CNAK | USB_OTG_DIEPCTL_EPENA); in USB_EP0StartXfer()
939 USBx_OUTEP(epnum)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_XFRSIZ); in USB_EP0StartXfer()
940 USBx_OUTEP(epnum)->DOEPTSIZ &= ~(USB_OTG_DOEPTSIZ_PKTCNT); in USB_EP0StartXfer()
947 USBx_OUTEP(epnum)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_PKTCNT & (1U << 19)); in USB_EP0StartXfer()
948 USBx_OUTEP(epnum)->DOEPTSIZ |= (USB_OTG_DOEPTSIZ_XFRSIZ & (ep->maxpacket)); in USB_EP0StartXfer()
954 USBx_OUTEP(epnum)->DOEPDMA = (uint32_t)(ep->xfer_buff); in USB_EP0StartXfer()
959 USBx_OUTEP(epnum)->DOEPCTL |= (USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA); in USB_EP0StartXfer()
1030 uint32_t epnum = (uint32_t)ep->num; in USB_EPSetStall() local
1034 if (((USBx_INEP(epnum)->DIEPCTL & USB_OTG_DIEPCTL_EPENA) == 0U) && (epnum != 0U)) in USB_EPSetStall()
1036 USBx_INEP(epnum)->DIEPCTL &= ~(USB_OTG_DIEPCTL_EPDIS); in USB_EPSetStall()
1038 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_STALL; in USB_EPSetStall()
1042 if (((USBx_OUTEP(epnum)->DOEPCTL & USB_OTG_DOEPCTL_EPENA) == 0U) && (epnum != 0U)) in USB_EPSetStall()
1044 USBx_OUTEP(epnum)->DOEPCTL &= ~(USB_OTG_DOEPCTL_EPDIS); in USB_EPSetStall()
1046 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_STALL; in USB_EPSetStall()
1061 uint32_t epnum = (uint32_t)ep->num; in USB_EPClearStall() local
1065 USBx_INEP(epnum)->DIEPCTL &= ~USB_OTG_DIEPCTL_STALL; in USB_EPClearStall()
1068 USBx_INEP(epnum)->DIEPCTL |= USB_OTG_DIEPCTL_SD0PID_SEVNFRM; /* DATA0 */ in USB_EPClearStall()
1073 USBx_OUTEP(epnum)->DOEPCTL &= ~USB_OTG_DOEPCTL_STALL; in USB_EPClearStall()
1076 USBx_OUTEP(epnum)->DOEPCTL |= USB_OTG_DOEPCTL_SD0PID_SEVNFRM; /* DATA0 */ in USB_EPClearStall()
1226 uint32_t USB_ReadDevOutEPInterrupt(USB_OTG_GlobalTypeDef *USBx, uint8_t epnum) in USB_ReadDevOutEPInterrupt() argument
1231 tmpreg = USBx_OUTEP((uint32_t)epnum)->DOEPINT; in USB_ReadDevOutEPInterrupt()
1244 uint32_t USB_ReadDevInEPInterrupt(USB_OTG_GlobalTypeDef *USBx, uint8_t epnum) in USB_ReadDevInEPInterrupt() argument
1251 msk |= ((emp >> (epnum & EP_ADDR_MSK)) & 0x1U) << 7; in USB_ReadDevInEPInterrupt()
1252 tmpreg = USBx_INEP((uint32_t)epnum)->DIEPINT & msk; in USB_ReadDevInEPInterrupt()
1668 uint8_t epnum, uint8_t dev_address, uint8_t speed, in USB_HC_Init() argument
1691 if ((epnum & 0x80U) == 0x80U) in USB_HC_Init()
1714 if ((epnum & 0x80U) == 0x80U) in USB_HC_Init()
1727 if ((epnum & 0x80U) == 0x80U) in USB_HC_Init()
1745 if ((epnum & 0x80U) == 0x80U) in USB_HC_Init()
1767 ((((uint32_t)epnum & 0x7FU) << 11) & USB_OTG_HCCHAR_EPNUM) | in USB_HC_Init()