本文整理汇总了C++中USBH_UsrLog函数的典型用法代码示例。如果您正苦于以下问题:C++ USBH_UsrLog函数的具体用法?C++ USBH_UsrLog怎么用?C++ USBH_UsrLog使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了USBH_UsrLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USBH_AOA_ConfigEndpoints
/**
* @brief USBH_ADK_configAndroid
* Setup bulk transfer endpoint and open channel.
* @param pdev: Selected device
* @param hdev: Selected device property
* @retval USBH_StatusTypeDef
*/
static USBH_StatusTypeDef USBH_AOA_ConfigEndpoints(USBH_HandleTypeDef * phost)
{
AOA_HandleTypeDef* aoa = phost->pActiveClass->pData;
USBH_UsrLog("AOA: Configure bulk endpoint.");
if (phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[0].bEndpointAddress & 0x80)
{
aoa->BulkInEp =
(phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[0].bEndpointAddress);
aoa->BulkInEpSize =
phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[0].wMaxPacketSize;
}
else
{
aoa->BulkOutEp =
(phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[0].bEndpointAddress);
aoa->BulkOutEpSize =
phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[0].wMaxPacketSize;
}
if (phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[1].bEndpointAddress & 0x80)
{
aoa->BulkInEp =
(phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[1].bEndpointAddress);
aoa->BulkInEpSize =
phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[1].wMaxPacketSize;
}
else
{
aoa->BulkOutEp =
(phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[1].bEndpointAddress);
aoa->BulkOutEpSize =
phost->device.CfgDesc.Itf_Desc[0].Ep_Desc[1].wMaxPacketSize;
}
aoa->hc_num_out = USBH_AllocPipe(phost, aoa->BulkOutEp);
aoa->hc_num_in = USBH_AllocPipe(phost, aoa->BulkInEp);
USBH_UsrLog("AOA: in pipe %d, out pipe %d", aoa->hc_num_in, aoa->hc_num_out);
/* Open the new channels */
USBH_OpenPipe(phost, aoa->hc_num_out, aoa->BulkOutEp,
phost->device.address, phost->device.speed,
EP_TYPE_BULK, aoa->BulkOutEpSize);
USBH_OpenPipe(phost, aoa->hc_num_in, aoa->BulkInEp,
phost->device.address, phost->device.speed,
EP_TYPE_BULK, aoa->BulkInEpSize);
return USBH_OK;
}
示例2: HID_InitApplication
/**
* @brief HID application Init.
* @param None
* @retval None
*/
static void HID_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_EXTI);
/* Configure LED1*/
BSP_LED_Init(LED1);
/* Initialize the LCD */
BSP_LCD_Init();
/* LCD Layer Initialization */
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS);
/* Select the LCD Layer */
BSP_LCD_SelectLayer(1);
/* Enable the display */
BSP_LCD_DisplayOn();
/* Initialize the LCD Log module */
LCD_LOG_Init();
#ifdef USE_USB_HS
LCD_LOG_SetHeader((uint8_t *)" USB OTG HS HID Host");
#else
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS HID Host");
#endif
LCD_UsrLog("USB Host library started.\n");
/* Start HID Interface */
USBH_UsrLog("Starting HID Demo");
HID_MenuInit();
}
示例3: USBH_AOA_InterfaceDeInit
/**
* @brief USBH_AOA_InterfaceDeInit
* De-Initialize interface by freeing host channels allocated to interface
* @param pdev: Selected device
* @param hdev: Selected device property
* @retval None
*/
static USBH_StatusTypeDef USBH_AOA_InterfaceDeInit(USBH_HandleTypeDef *phost)
{
AOA_HandleTypeDef* aoa = phost->pActiveClass->pData;
USBH_UsrLog("AOA: Interface deinit.");
/* close bulk transfer pipe */
if (aoa->hc_num_out)
{
USBH_ClosePipe(phost, aoa->hc_num_out);
USBH_FreePipe(phost, aoa->hc_num_out);
aoa->hc_num_out = 0; /* Reset the Channel as Free */
}
if (aoa->hc_num_in)
{
USBH_ClosePipe(phost, aoa->hc_num_in);
USBH_FreePipe(phost, aoa->hc_num_in);
aoa->hc_num_in = 0; /* Reset the Channel as Free */
}
return USBH_OK;
}
示例4: USBH_LL_Disconnect
/**
* @brief USBH_LL_Disconnect
* Handle USB Host disconnection event
* @param phost: Host Handle
* @retval USBH_Status
*/
USBH_StatusTypeDef USBH_LL_Disconnect (USBH_HandleTypeDef *phost)
{
/*Stop Host */
USBH_LL_Stop(phost);
/* FRee Control Pipes */
USBH_FreePipe (phost, phost->Control.pipe_in);
USBH_FreePipe (phost, phost->Control.pipe_out);
phost->device.is_connected = 0;
if(phost->pUser != NULL)
{
phost->pUser(phost, HOST_USER_DISCONNECTION);
}
USBH_UsrLog("USB Device disconnected");
/* Start the low level driver */
USBH_LL_Start(phost);
phost->gState = HOST_DEV_DISCONNECTED;
#if (USBH_USE_OS == 1)
osMessagePut ( phost->os_event, USBH_PORT_EVENT, 0);
#endif
return USBH_OK;
}
示例5: DUAL_InitApplication
/**
* @brief DUALCORE application Init.
* @param None
* @retval None
*/
static void DUAL_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);
/* Configure LED1 */
BSP_LED_Init(LED1);
/* Initialize the LCD */
BSP_LCD_Init();
/* LCD Layer Initialization */
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS);
/* Selects the LCD Layer */
BSP_LCD_SelectLayer(1);
/* Enables the display */
BSP_LCD_DisplayOn();
/* Init the LCD Log module */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)" USB OTG DualCore Host");
LCD_UsrLog("USB Host library started.\n");
/* Start DualCore Interface */
USBH_UsrLog("Initializing hardware....");
DUAL_MenuInit();
}
示例6: MSC_InitApplication
/**
* @brief MSC application Init.
* @param None
* @retval None
*/
static void MSC_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Initialize the LCD */
BSP_LCD_Init();
/* Initialize the LCD Log module */
LCD_LOG_Init();
#ifdef USE_USB_HS
LCD_LOG_SetHeader((uint8_t *)" USB OTG HS MSC Host");
#else
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
#endif
LCD_UsrLog("USB Host library started.\n");
/* Initialize menu and MSC process */
USBH_UsrLog("Starting MSC Demo");
Menu_Init();
}
示例7: MSC_InitApplication
/**
* @brief MSC application Init.
* @param None
* @retval None
*/
static void MSC_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Initialize the LCD */
BSP_LCD_Init();
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
BSP_LCD_SelectLayer(0);
/* Init the LCD Log module */
LCD_LOG_Init();
#ifdef USE_USB_HS
LCD_LOG_SetHeader((uint8_t *)" USB OTG HS MSC Host");
#else
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
#endif
LCD_UsrLog("USB Host library started.\n");
/* Initialize menu and MSC process */
USBH_UsrLog("Starting MSC Demo");
Menu_Init();
}
示例8: HID_MenuInit
/**
* @brief Demo state machine.
* @param None
* @retval None
*/
void HID_MenuInit(void)
{
/* Start HID Interface */
USBH_UsrLog("Starting HID Demo");
hid_demo.state = HID_DEMO_START;
HID_MenuProcess();
}
示例9: MSC_InitApplication
/**
* @brief MSC application Init.
* @param None
* @retval None
*/
static void MSC_InitApplication(void)
{
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Configure the LEDs */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Initialize the LCD */
BSP_LCD_Init();
/* Initialize the LCD Log module */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
LCD_UsrLog("USB Host library started.\n");
/* Start MSC Interface */
USBH_UsrLog("Starting MSC Demo");
Menu_Init();
}
示例10: CDC_InitApplication
/**
* @brief CDC application Init
* @param None
* @retval None
*/
static void CDC_InitApplication(void)
{
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Configure KEY Button */
BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_GPIO);
/* Initialize the LCD */
BSP_LCD_Init();
BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
BSP_LCD_SelectLayer(0);
/* Init the LCD Log module */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS CDC Host");
LCD_UsrLog("USB Host library started.\n");
/* Start CDC Interface */
USBH_UsrLog("Starting CDC Demo");
Menu_Init();
}
示例11: DUAL_InitApplication
/**
* @brief DUALCORE application Init.
* @param None
* @retval None
*/
static void DUAL_InitApplication(void)
{
/* Configure KEY Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Configure the LEDs */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Initialize the LCD */
BSP_LCD_Init();
/* Initialize the LCD Log module */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)" USB OTG DualCore Host");
LCD_UsrLog("USB Host library started.\n");
/* Start DualCore Interface */
USBH_UsrLog("Initializing hardware....");
DUAL_MenuInit();
}
示例12: HID_InitApplication
/**
* @brief HID application Init.
* @param None
* @retval None
*/
static void HID_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Initialize the LCD */
BSP_LCD_Init();
/* Initialize the LCD Log module */
LCD_LOG_Init();
#ifdef USE_USB_HS
LCD_LOG_SetHeader((uint8_t *)" USB OTG HS HID Host");
#else
LCD_LOG_SetHeader((uint8_t *)" USB OTG FS HID Host");
#endif
LCD_UsrLog("USB Host library started.\n");
/* Start HID Interface */
USBH_UsrLog("Starting HID Demo");
HID_MenuInit();
}
示例13: USBH_AOA_InHandle
static USBH_StatusTypeDef USBH_AOA_InHandle(USBH_HandleTypeDef *phost)
{
USBH_URBStateTypeDef URB_Status;
uint32_t size;
AOA_HandleTypeDef* aoa = phost->pActiveClass->pData;
switch (aoa->inState)
{
case AOA_RECV_DATA:
USBH_BulkReceiveData(phost, aoa->inbuff, USBH_AOA_DATA_SIZE,
aoa->hc_num_in);
aoa->inState = AOA_RECV_DATA_WAIT;
break;
case AOA_RECV_DATA_WAIT:
URB_Status = USBH_LL_GetURBState(phost, aoa->hc_num_in);
if (URB_Status == USBH_URB_DONE)
{
size = USBH_LL_GetLastXferSize(phost, aoa->hc_num_in);
if (size > 0) {
if (DebugConfig.print_aoa_recvdata)
{
if (printable(aoa->inbuff, size)) {
aoa->inbuff[size] = '\0';
USBH_UsrLog("AOA: in %u bytes, \"%s\"", (unsigned int)size, aoa->inbuff);
}
else {
USBH_UsrLog("AOA: in %u bytes, %s", (unsigned int)size, bytes2bin(aoa->inbuff, size));
}
}
if (aoa->recvCallback)
{
aoa->recvCallback(phost, aoa->inbuff, size);
}
aoa->inState = AOA_RECV_DATA;
}
}
break;
}
return USBH_OK;
}
示例14: AUDIO_InitApplication
/**
* @brief Audio Application Init.
* @param None
* @retval None
*/
static void AUDIO_InitApplication(void)
{
/* Configure Key Button */
BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);
/* Configure IO and LED1 */
BSP_IO_Init();
BSP_LED_Init(LED1);
BSP_LED_Init(LED4);
/* Configure Joystick in EXTI mode */
BSP_JOY_Init(JOY_MODE_EXTI);
/* Camera has to be powered down as some signals use same GPIOs between
* I2S signals and camera bus. Camera drives its signals to low impedance
* when powered ON. So the camera is powered off to let its signals
* in high impedance */
/* Camera power down sequence */
BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);
/* De-assert the camera STANDBY pin (active high) */
BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);
/* Assert the camera RSTI pin (active low) */
BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);
/* Initialize the LCD */
BSP_LCD_Init();
/* LCD Layer Initialization */
BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS);
/* Select the LCD Layer */
BSP_LCD_SelectLayer(1);
/* Enable the display */
BSP_LCD_DisplayOn();
/* Init the LCD Log module */
LCD_LOG_Init();
LCD_LOG_SetHeader((uint8_t *)"Audio Playback and Record Application");
LCD_UsrLog("USB Host library started.\n");
/* Start Audio interface */
USBH_UsrLog("Starting Audio Demo");
/* Init Audio interface */
AUDIO_PLAYER_Init();
/* Start Audio interface */
AUDIO_MenuInit();
}
示例15: hc_helper_sumbit_request
void hc_helper_sumbit_request(void)
{
if (debug_hal_hcd_hc_submitrequest_halt) {
debug_hal_hcd_hc_submitrequest_halt = 0;
}
if (debug_hal_hcd_hc_submitrequest_print) {
USBH_UsrLog("%s: ", __func__);
}
}