Exemple #1
0
/**
  * @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 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);

  /* Run Application (Blocking mode) */  
  while (1)
  {
    /* USB Host Background task */
    USBH_Process(&hUSBHost); 
    
    /* CDC Menu Process */
    CDC_MenuProcess(); 
  }
}
Exemple #2
0
/**
  * @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(); 
  }
}
Exemple #3
0
/**
  * @brief  Demo state machine.
  * @param  None
  * @retval None
  */
void Menu_Init(void)
{
  BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
  BSP_LCD_DisplayStringAtLine(14, (uint8_t *)"                                          ");
  BSP_LCD_DisplayStringAtLine(15, (uint8_t *)"Use [Buttons Left/Right] to scroll up/down");
  BSP_LCD_DisplayStringAtLine(16, (uint8_t *)"Use [Joystick Up/Down] to scroll CDC menu ");
  
  CdcDemo.state = CDC_DEMO_IDLE;
  CDC_MenuProcess();
}
Exemple #4
0
/**
  * @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
         - Low Level Initialization
       */
    HAL_Init();

    /* Configure the System clock to have a frequency of 200 Mhz */
    SystemClock_Config();

    /* Initialize IO expander */
    BSP_IO_Init();

    /* 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);

    /* Run Application (Blocking mode) */
    while (1)
    {
        /* USB Host Background task */
        USBH_Process(&hUSBHost);

        /* CDC Menu Process */
        CDC_MenuProcess();
    }
}