XMC Peripheral Library for XMC4000 Family: xmc_usbh.h File Reference

XMC Peripheral Library for XMC4000 Family

XMC Peripheral Library for XMC4000 Family  2.1.16
xmc_usbh.h File Reference
#include <stdint.h> #include "xmc_common.h"
#include "xmc_scu.h"
#include "xmc_gpio.h"
Include dependency graph for xmc_usbh.h:

Data Structures

struct  XMC_USBH0_DEVICE_t
 
struct  XMC_USBH0_pipe_t
 
struct  XMC_USBH_CAPABILITIES_t
 
struct  XMC_USBH_DRIVER_t
 
struct  XMC_USBH_DRIVER_VERSION_t
 
struct  XMC_USBH_PORT_STATE_t
 

Macros

#define USB_CH_HCCHARx_DEVADDR(x)    (((uint32_t) x << USB_CH_HCCHAR_DevAddr_Pos) & (uint32_t)USB_CH_HCCHAR_DevAddr_Msk)
 
#define USB_CH_HCCHARx_EPDIR(x)    (((uint32_t) x << USB_CH_HCCHAR_EPDir_Pos) & (uint32_t)USB_CH_HCCHAR_EPDir_Msk)
 
#define USB_CH_HCCHARx_EPNUM(x)    (((uint32_t) x << USB_CH_HCCHAR_EPNum_Pos) & (uint32_t)USB_CH_HCCHAR_EPNum_Msk)
 
#define USB_CH_HCCHARx_EPTYPE(x)    (((uint32_t) x << USB_CH_HCCHAR_EPType_Pos) & (uint32_t)USB_CH_HCCHAR_EPType_Msk)
 
#define USB_CH_HCCHARx_MCEC(x)    (((uint32_t) x << USB_CH_HCCHAR_MC_EC_Pos) & (uint32_t)USB_CH_HCCHAR_MC_EC_Msk)
 
#define USB_CH_HCCHARx_MPS(x)    (((uint32_t) x ) & (uint32_t)USB_CH_HCCHAR_MPS_Msk)
 
#define USB_CH_HCFG_FSLSPCS(x)    (((uint32_t) x ) & USB_HCFG_FSLSPclkSel_Msk)
 
#define USB_CH_HCFG_FSLSSUP(x)    (((uint32_t) x << USB_HCFG_FSLSSupp_Pos) & USB_HCFG_FSLSSupp_Msk)
 
#define USB_CH_HCINTx_ALL
 
#define USB_CH_HCINTx_ERRORS
 
#define USB_CH_HCTSIZx_DPID(x)    (((uint32_t) x << USB_CH_HCTSIZ_BUFFERMODE_Pid_Pos) & (uint32_t)USB_CH_HCTSIZ_BUFFERMODE_Pid_Msk)
 
#define USB_CH_HCTSIZx_DPID_DATA0   (USB_CH_HCTSIZx_DPID(0U))
 
#define USB_CH_HCTSIZx_DPID_DATA1   (USB_CH_HCTSIZx_DPID(2U))
 
#define USB_CH_HCTSIZx_DPID_DATA2   (USB_CH_HCTSIZx_DPID(1U))
 
#define USB_CH_HCTSIZx_DPID_MDATA   (USB_CH_HCTSIZx_DPID(3U))
 
#define USB_CH_HCTSIZx_DPID_SETUP   (USB_CH_HCTSIZx_DPID(3U))
 
#define USB_GRXSTSR_HOSTMODE_PktSts_IN_DATA_PKT   0x2
 
#define USB_GRXSTSR_HOSTMODE_PktSts_IN_TRSF_CPL   0x3
 
#define USBH0_MAX_PIPE_NUM   (14U)
 
#define USBH_PIPE_GET_INDEX(handle)    (((uint32_t)handle - (uint32_t)USB0_CH0_BASE)/(0x20U))
 
#define XMC_USB_DRIVE_PORT1   P3_2
 
#define XMC_USB_DRIVE_PORT2   P0_1
 
#define XMC_USBH_API_VERSION   ((uint16_t)((uint16_t)XMC_LIB_MAJOR_VERSION << 8U) |XMC_LIB_MINOR_VERSION)
 
#define XMC_USBH_CLOCK_GATING_DISABLE   0
 
#define XMC_USBH_CLOCK_GATING_ENABLE   1
 
#define XMC_USBH_DRIVER_ERROR   -1
 
#define XMC_USBH_DRIVER_ERROR_BUSY   -2
 
#define XMC_USBH_DRIVER_ERROR_PARAMETER   -5
 
#define XMC_USBH_DRIVER_ERROR_SPECIFIC   -6
 
#define XMC_USBH_DRIVER_ERROR_TIMEOUT   -3
 
#define XMC_USBH_DRIVER_ERROR_UNSUPPORTED   -4
 
#define XMC_USBH_DRIVER_OK   0
 
#define XMC_USBH_ENDPOINT_BULK   2
 
#define XMC_USBH_ENDPOINT_CONTROL   0
 
#define XMC_USBH_ENDPOINT_INTERRUPT   3
 
#define XMC_USBH_ENDPOINT_ISOCHRONOUS   1
 
#define XMC_USBH_EP_HANDLE   XMC_USBH_PIPE_HANDLE
 
#define XMC_USBH_EVENT_BUS_ERROR   (1UL << 6)
 
#define XMC_USBH_EVENT_CONNECT   (1UL << 0)
 
#define XMC_USBH_EVENT_DISCONNECT   (1UL << 1)
 
#define XMC_USBH_EVENT_HANDSHAKE_ERR   (1UL << 5)
 
#define XMC_USBH_EVENT_HANDSHAKE_MDATA   (1UL << 3)
 
#define XMC_USBH_EVENT_HANDSHAKE_NAK   (1UL << 1)
 
#define XMC_USBH_EVENT_HANDSHAKE_NYET   (1UL << 2)
 
#define XMC_USBH_EVENT_HANDSHAKE_STALL   (1UL << 4)
 
#define XMC_USBH_EVENT_OVERCURRENT   (1UL << 2)
 
#define XMC_USBH_EVENT_REMOTE_WAKEUP   (1UL << 6)
 
#define XMC_USBH_EVENT_RESET   (1UL << 3)
 
#define XMC_USBH_EVENT_RESUME   (1UL << 5)
 
#define XMC_USBH_EVENT_SUSPEND   (1UL << 4)
 
#define XMC_USBH_EVENT_TRANSFER_COMPLETE   (1UL << 0)
 
#define XMC_USBH_PACKET_CSPLIT   (0x0CUL << XMC_USBH_PACKET_SPLIT_Pos)
 
#define XMC_USBH_PACKET_DATA0   (0x01UL << XMC_USBH_PACKET_DATA_Pos)
 
#define XMC_USBH_PACKET_DATA1   (0x02UL << XMC_USBH_PACKET_DATA_Pos)
 
#define XMC_USBH_PACKET_DATA_Msk   (0x0FUL << XMC_USBH_PACKET_DATA_Pos)
 
#define XMC_USBH_PACKET_DATA_Pos   4
 
#define XMC_USBH_PACKET_IN   (0x03UL << XMC_USBH_PACKET_TOKEN_Pos)
 
#define XMC_USBH_PACKET_OUT   (0x02UL << XMC_USBH_PACKET_TOKEN_Pos)
 
#define XMC_USBH_PACKET_PING   (0x04UL << XMC_USBH_PACKET_TOKEN_Pos)
 
#define XMC_USBH_PACKET_PRE   (1UL << 12)
 
#define XMC_USBH_PACKET_SETUP   (0x01UL << XMC_USBH_PACKET_TOKEN_Pos)
 
#define XMC_USBH_PACKET_SSPLIT   (0x08UL << XMC_USBH_PACKET_SPLIT_Pos)
 
#define XMC_USBH_PACKET_SSPLIT_E   (0x0AUL << XMC_USBH_PACKET_SPLIT_Pos)
 
#define XMC_USBH_PACKET_SSPLIT_S   (0x09UL << XMC_USBH_PACKET_SPLIT_Pos)
 
#define XMC_USBH_PACKET_SSPLIT_S_E   (0x0BUL << XMC_USBH_PACKET_SPLIT_Pos)
 
#define XMC_USBH_PACKET_TOKEN_Msk   (0x0FUL << XMC_USBH_PACKET_TOKEN_Pos)
 
#define XMC_USBH_PACKET_TOKEN_Pos   0
 
#define XMC_USBH_SignalEndpointEvent_t   XMC_USBH_SignalPipeEvent_t
 
#define XMC_USBH_SPEED_FULL   1U
 
#define XMC_USBH_SPEED_HIGH   2U
 
#define XMC_USBH_SPEED_LOW   0U
 

Typedefs

typedef void(* XMC_USBH_SignalPipeEvent_t) (XMC_USBH_PIPE_HANDLE pipe_hndl, uint32_t event)
 
typedef void(* XMC_USBH_SignalPortEvent_t) (uint8_t port, uint32_t event)
 

Functions

uint32_t XMC_USBH_GetInterruptStatus (void)
 
void XMC_USBH_HandleIrq (uint32_t gintsts)
 
uint8_t XMC_USBH_osDelay (uint32_t ms)
 
void XMC_USBH_Select_VBUS (XMC_GPIO_PORT_t *port, uint32_t pin)
 
void XMC_USBH_TurnOffResumeBit (void)
 

Detailed Description

Date
2016-06-30

XMClib v2.1.16 - XMC Peripheral Driver Library

Copyright (c) 2015-2017, Infineon Technologies AG All rights reserved.

Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes with Infineon Technologies AG dave@.nosp@m.infi.nosp@m.neon..nosp@m.com).

Change History

2016-06-30:

  • Initial Version.
    2016-09-01:
  • Removed Keil specific inclusions and macros
Generated on Mon Aug 7 2017 11:33:56 for XMC Peripheral Library for XMC4000 Family by   doxygen 1.8.11