discoverpixy
Macros | Functions | Variables
usb_bsp.c File Reference
#include "usb_bsp.h"
#include "stm32f4_discovery.h"
Include dependency graph for usb_bsp.c:

Macros

#define USE_ACCURATE_TIME
 
#define TIM_MSEC_DELAY   0x01
 
#define TIM_USEC_DELAY   0x02
 
#define HOST_OVRCURR_PORT   GPIOD
 
#define HOST_OVRCURR_LINE   GPIO_Pin_5
 
#define HOST_OVRCURR_PORT_SOURCE   GPIO_PortSourceGPIOD
 
#define HOST_OVRCURR_PIN_SOURCE   GPIO_PinSourceD
 
#define HOST_OVRCURR_PORT_RCC   RCC_APB2Periph_GPIOD
 
#define HOST_OVRCURR_EXTI_LINE   EXTI_Line5
 
#define HOST_OVRCURR_IRQn   EXTI9_5_IRQn
 
#define HOST_POWERSW_PORT_RCC   RCC_AHB1Periph_GPIOC
 
#define HOST_POWERSW_PORT   GPIOC
 
#define HOST_POWERSW_VBUS   GPIO_Pin_0
 

Functions

static void BSP_SetTime (uint8_t unit)
 BSP_SetTime Configures TIM2 for delay routine based on TIM2. More...
 
static void BSP_Delay (uint32_t nTime, uint8_t unit)
 BSP_Delay Delay routine based on TIM2. More...
 
static void USB_OTG_BSP_TimeInit (void)
 USB_OTG_BSP_TimeInit Initializes delay unit using Timer2. More...
 
void BSP_Init (void)
 BSP_Init board user initializations. More...
 
void USB_OTG_BSP_Init (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_BSP_Init Initilizes BSP configurations. More...
 
void USB_OTG_BSP_EnableInterrupt (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_BSP_EnableInterrupt Configures USB Global interrupt. More...
 
void USB_OTG_BSP_DriveVBUS (USB_OTG_CORE_HANDLE *pdev, uint8_t state)
 BSP_Drive_VBUS Drives the Vbus signal through IO. More...
 
void USB_OTG_BSP_ConfigVBUS (USB_OTG_CORE_HANDLE *pdev)
 USB_OTG_BSP_ConfigVBUS Configures the IO for the Vbus and OverCurrent. More...
 
void USB_OTG_BSP_uDelay (const uint32_t usec)
 USB_OTG_BSP_uDelay This function provides delay time in micro sec. More...
 
void USB_OTG_BSP_mDelay (const uint32_t msec)
 USB_OTG_BSP_mDelay This function provides delay time in milli sec. More...
 
void USB_OTG_BSP_TimerIRQ (void)
 USB_OTG_BSP_TimerIRQ Time base IRQ. More...
 

Variables

ErrorStatus HSEStartUpStatus
 
__IO uint32_t BSP_delay = 0
 

Macro Definition Documentation

#define HOST_OVRCURR_EXTI_LINE   EXTI_Line5
#define HOST_OVRCURR_IRQn   EXTI9_5_IRQn
#define HOST_OVRCURR_LINE   GPIO_Pin_5
#define HOST_OVRCURR_PIN_SOURCE   GPIO_PinSourceD
#define HOST_OVRCURR_PORT   GPIOD
#define HOST_OVRCURR_PORT_RCC   RCC_APB2Periph_GPIOD
#define HOST_OVRCURR_PORT_SOURCE   GPIO_PortSourceGPIOD
#define HOST_POWERSW_PORT   GPIOC
#define HOST_POWERSW_PORT_RCC   RCC_AHB1Periph_GPIOC
#define HOST_POWERSW_VBUS   GPIO_Pin_0
#define TIM_MSEC_DELAY   0x01
#define TIM_USEC_DELAY   0x02
#define USE_ACCURATE_TIME

Function Documentation

static void BSP_Delay ( uint32_t  nTime,
uint8_t  unit 
)
static

BSP_Delay Delay routine based on TIM2.

Parameters
nTime: Delay Time
unit: Delay Time unit : mili sec / micro sec
Return values
None

Here is the call graph for this function:

Here is the caller graph for this function:

void BSP_Init ( void  )

BSP_Init board user initializations.

Parameters
None
Return values
None
static void BSP_SetTime ( uint8_t  unit)
static

BSP_SetTime Configures TIM2 for delay routine based on TIM2.

Parameters
unit: msec /usec
Return values
None

Here is the caller graph for this function:

void USB_OTG_BSP_ConfigVBUS ( USB_OTG_CORE_HANDLE *  pdev)

USB_OTG_BSP_ConfigVBUS Configures the IO for the Vbus and OverCurrent.

Parameters
None
Return values
None

Here is the call graph for this function:

void USB_OTG_BSP_DriveVBUS ( USB_OTG_CORE_HANDLE *  pdev,
uint8_t  state 
)

BSP_Drive_VBUS Drives the Vbus signal through IO.

Parameters
state: VBUS states
Return values
None
void USB_OTG_BSP_EnableInterrupt ( USB_OTG_CORE_HANDLE *  pdev)

USB_OTG_BSP_EnableInterrupt Configures USB Global interrupt.

Parameters
None
Return values
None
void USB_OTG_BSP_Init ( USB_OTG_CORE_HANDLE *  pdev)

USB_OTG_BSP_Init Initilizes BSP configurations.

Parameters
None
Return values
None

Here is the call graph for this function:

void USB_OTG_BSP_mDelay ( const uint32_t  msec)

USB_OTG_BSP_mDelay This function provides delay time in milli sec.

Parameters
msec: Value of delay required in milli sec
Return values
None

Here is the call graph for this function:

Here is the caller graph for this function:

static void USB_OTG_BSP_TimeInit ( void  )
static

USB_OTG_BSP_TimeInit Initializes delay unit using Timer2.

Parameters
None
Return values
None

Here is the caller graph for this function:

void USB_OTG_BSP_TimerIRQ ( void  )

USB_OTG_BSP_TimerIRQ Time base IRQ.

Parameters
None
Return values
None

Here is the caller graph for this function:

void USB_OTG_BSP_uDelay ( const uint32_t  usec)

USB_OTG_BSP_uDelay This function provides delay time in micro sec.

Parameters
usec: Value of delay required in micro sec
Return values
None

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

__IO uint32_t BSP_delay = 0
ErrorStatus HSEStartUpStatus