本文整理汇总了C++中USBH_Process函数的典型用法代码示例。如果您正苦于以下问题:C++ USBH_Process函数的具体用法?C++ USBH_Process怎么用?C++ USBH_Process使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USBH_Process函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Init MTP Application */
MTP_InitApplication();
/* Init Host Library */
USBH_Init(&hUSBHost, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSBHost, USBH_MTP_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost);
/* Run Application (Blocking mode) */
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSBHost);
/* MTP Menu Process */
MTP_MenuProcess();
}
}
示例2: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F469xx HAL library initialization */
HAL_Init();
/* Configure the System clock to have a frequency of 180 MHz */
SystemClock_Config();
/* Init CDC Application */
CDC_InitApplication();
/* Init Host Library */
USBH_Init(&hUSBHost, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSBHost, USBH_CDC_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost);
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSBHost);
/* CDC Menu Process */
CDC_MenuProcess();
}
}
示例3: USBH_Dev_Hub_Task
USBH_Status USBH_Dev_Hub_Task(USB_OTG_CORE_HANDLE *pcore , USBH_DEV *pdev)
{
Hub_Data_t* Hub_Data = pdev->Usr_Data;
dbg_obj = Hub_Data->intInEpIo;
USBH_DevIO_Task(Hub_Data->intInEpIo);
if (Hub_Data->intInEpIo->state != UIOSTATE_WAIT_DATA)
{
// iterate all the ports
if (Hub_Data->children != 0)
{
for (int pn = 0; pn < Hub_Data->num_ports; pn++)
{
if (Hub_Data->children[pn] != 0 && (Hub_Data->port_busy == (pn + 1) || Hub_Data->port_busy == 0)) {
USBH_Process(pcore, Hub_Data->children[pn]);
}
}
}
}
if (Hub_Data->port_busy == 0 && (pdev->Control.hc_num_in >= 0 || pdev->Control.hc_num_out >= 0)) {
USBH_Dev_FreeControl(pcore, pdev);
}
return USBH_OK;
}
示例4: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 Mhz */
SystemClock_Config();
/* Init Dual Core Application */
DUAL_InitApplication();
/* Init HS Core */
USBH_Init(&hUSBHost_HS, USBH_HS_UserProcess, 1);
/* Init FS Core */
USBH_Init(&hUSBHost_FS, USBH_FS_UserProcess, 0);
/* Add Supported Classes */
USBH_RegisterClass(&hUSBHost_HS, USBH_MSC_CLASS);
USBH_RegisterClass(&hUSBHost_FS, USBH_HID_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost_FS);
USBH_Start(&hUSBHost_HS);
/* Register the file system object to the FatFs module */
if(f_mount(&USBH_fatfs, "", 0) != FR_OK)
{
LCD_ErrLog("ERROR : Cannot Initialize FatFs! \n");
}
/* Run Application (Blocking mode)*/
while (1)
{
/* USB Host Background tasks */
USBH_Process(&hUSBHost_FS);
USBH_Process(&hUSBHost_HS);
/* DUAL Menu Process */
DUAL_MenuProcess();
}
}
示例5: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 180 MHz */
SystemClock_Config();
/*Initialize the IO module*/
BSP_IO_Init ();
/* Configure LED1 and LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/*##-1- Link the USB Host disk I/O driver ##################################*/
if(FATFS_LinkDriver(&USBH_Driver, USBDISKPath) == 0)
{
/*##-2- Init Host Library ################################################*/
USBH_Init(&hUSB_Host, USBH_UserProcess, 0);
/*##-3- Add Supported Class ##############################################*/
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/*##-4- Start Host Process ###############################################*/
USBH_Start(&hUSB_Host);
/*##-5- Run Application (Blocking mode) ##################################*/
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSB_Host);
/* Mass Storage Application State Machine */
switch(Appli_state)
{
case APPLICATION_START:
MSC_Application();
Appli_state = APPLICATION_IDLE;
break;
case APPLICATION_IDLE:
default:
break;
}
}
}
/* Infinite loop */
while (1)
{
}
}
示例6: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Unlock the Flash to enable the flash control register access */
FLASH_If_FlashUnlock();
/* Test if User button on the STM324x9I_EVAL is pressed */
if (BSP_PB_GetState(BUTTON_KEY) != GPIO_PIN_RESET)
{
/* Check Vector Table: Test if user code is programmed starting from address
"APPLICATION_ADDRESS" */
if ((((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) == 0x20000000) || \
(((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) == 0x10000000))
{
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
Jump_To_Application();
}
}
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Init FW upgrade Application */
FW_InitApplication();
/* Init Host Library */
USBH_Init(&hUSBHost, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSBHost, USBH_MSC_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost);
/* Run Application (Blocking mode)*/
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSBHost);
/* FW Menu Process */
FW_UPGRADE_Process();
}
}
示例7: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization */
HAL_Init();
/* Configure the system clock to 180 Mhz */
SystemClock_Config();
/* Initialize IO expander */
BSP_IO_Init();
/* Init Dual Core Application */
DUAL_InitApplication();
/* Init HS Core */
USBH_Init(&hUSBHost_HS, USBH_HS_UserProcess, 1);
/* Init FS Core */
USBH_Init(&hUSBHost_FS, USBH_FS_UserProcess, 0);
/* Add Supported Classes */
USBH_RegisterClass(&hUSBHost_HS, USBH_MSC_CLASS);
USBH_RegisterClass(&hUSBHost_FS, USBH_HID_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost_FS);
USBH_Start(&hUSBHost_HS);
/* Register the file system object to the FatFs module */
if(f_mount(&USBH_fatfs, "", 0) != FR_OK)
{
LCD_ErrLog("ERROR : Cannot Initialize FatFs! \n");
}
/* Run Application (Blocking mode)*/
while (1)
{
/* USB Host Background tasks */
USBH_Process(&hUSBHost_FS);
USBH_Process(&hUSBHost_HS);
/* DUAL Menu Process */
DUAL_MenuProcess();
}
}
示例8: USBH_USR_BackgroundProcess
void USBH_USR_BackgroundProcess(void)
{
if (( USBH_USR_ApplicationState != USH_USR_READY
&& USBH_USR_ApplicationState != USH_USR_PROCESS
)
|| HCD_IsDeviceConnected(&USB_OTG_Core) == 0
)
USBH_Process(&USB_OTG_Core, &USB_Host);
}
示例9: usb_msc_host_main
usb_msc_host_status_t usb_msc_host_main (void)
{
if (usb_msc_host_status != USB_MSC_DEV_NOT_SUPPORTED)
{
USBH_Process (&USB_OTG_Core, &USB_Host);
}
return usb_msc_host_status;
}
示例10: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Unlock the Flash to enable the flash control register access */
FLASH_If_FlashUnlock();
/* Test if User button on the STM32446E_EVAL is pressed */
if (BSP_PB_GetState(BUTTON_KEY) != GPIO_PIN_SET)
{
/* Check Vector Table: Test if user code is programmed starting from address
"APPLICATION_ADDRESS" */
if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) == 0x20000000)
{
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
Jump_To_Application();
}
}
/* STM32F446xx HAL library initialization */
HAL_Init();
/* Configure the system clock to 180 Mhz */
SystemClock_Config();
/* Initialize IO expander */
BSP_IO_Init();
/* Init FW upgrade Application */
FW_InitApplication();
/* Init Host Library */
USBH_Init(&hUSBHost, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSBHost, USBH_MSC_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost);
/* Run Application (Blocking mode)*/
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSBHost);
/* FW Menu Process */
FW_UPGRADE_Process();
}
}
示例11: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure LED3 and LED4 */
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Configure USER Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Initialize LCD driver */
LCD_Config();
/* Link the USB Host disk I/O driver */
USBDISK_Driver_Num = FATFS_LinkDriver(&USBH_Driver, "");
/* Init Host Library */
if (USBH_Init(&hUSB_Host, USBH_UserProcess, 0) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Add Supported Class */
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/* Start Host Process */
if (USBH_Start(&hUSB_Host) != USBH_OK)
{
/* USB Initialization Error */
Error_Handler();
}
/* Infinite loop */
while (1)
{
if (Appli_state == APPLICATION_START)
{
MSC_Application();
}
Toggle_Leds();
USBH_Process(&hUSB_Host);
}
}
示例12: USB_ReadyCycle
/*------------------------------------------------------------
* Function Name : USB_ReadyCycle
* Description : USB准备
* Input : None
* Output : None
* Return : None
*------------------------------------------------------------*/
void USB_ReadyCycle( void )
{
uint32_t num = 0;
const uint32_t USB_STATUS_CYCLE_NUM = 100000; //USB循环体必须达到此次数才能操作
while (num < USB_STATUS_CYCLE_NUM)
{
num++;
USBH_Process(&USB_OTG_Core, &USB_Host); //执行一定次数才可以改变读写U盘状态位
}
}
示例13: usbh_thread_entry
static void usbh_thread_entry(void *parameter)
{
rt_err_t err = 0;
DBGPRINT(WHED_DEBUG_TRACE, "%s: ---->\n", __FUNCTION__);
err = err;
while (1) {
/* Host Task handler. */
USBH_Process(&USB_OTG_Core_dev , &USB_Host);
}
}
示例14: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* Enable the CPU Cache */
CPU_CACHE_Enable();
/* STM32F7xx HAL library initialization:
- Configure the Flash ART accelerator on ITCM interface
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 200 MHz */
SystemClock_Config();
/* Init Audio Application */
AUDIO_InitApplication();
/* Init Host Library */
USBH_Init(&hUSBHost, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSBHost, USBH_MSC_CLASS);
/* Start Host Process */
USBH_Start(&hUSBHost);
/* Run Application (Blocking mode) */
while (1)
{
/* USB Host Background task */
USBH_Process(&hUSBHost);
/* AUDIO Menu Process */
AUDIO_MenuProcess();
if ( MfxToggleLed == 1)
{
#if defined(USE_STM32756G_EVAL_REVA)
/* On RevA board, as LED1 is connected to MFX, the toggle is performed in main loop */
BSP_LED_Toggle(LED1);
#else
/* On RevB board, as LED1 is connected to GPIO, it is toggled in ISR,
* the LED4 is toggled in main loop as it is connected to MFX */
BSP_LED_Toggle(LED4);
#endif
MfxToggleLed = 0;
}
}
}
示例15: USBH_Process_OS
/**
* @brief USB Host Thread task
* @param pvParameters not used
* @retval None
*/
static void USBH_Process_OS(void const * argument)
{
osEvent event;
for(;;)
{
event = osMessageGet(((USBH_HandleTypeDef *)argument)->os_event, osWaitForever );
if( event.status == osEventMessage )
{
USBH_Process((USBH_HandleTypeDef *)argument);
}
}
}