Ejemplo n.º 1
0
/**
  * @brief  Handles Keyboard Menu.
  * @param  None
  * @retval None
  */
void HID_KeyboardMenuProcess(void)
{
  if(hid_demo.keyboard_state == HID_KEYBOARD_START)
  {
    LCD_LOG_ClearTextZone();
    BSP_LCD_ClearStringLine(19);
    USBH_HID_KeybdInit(&hUSBHost);
    USR_KEYBRD_Init();
  }
}
Ejemplo n.º 2
0
/**
  * @brief  Handles Keyboard Menu.
  * @param  None
  * @retval None
  */
void HID_KeyboardMenuProcess(void)
{
  switch(hid_demo.keyboard_state)
  {
  case HID_KEYBOARD_IDLE:
    hid_demo.keyboard_state = HID_KEYBOARD_START;
    HID_SelectItem(DEMO_KEYBOARD_menu, 0);
    hid_demo.select = 0;
    prev_select = 0;
    break;

  case HID_KEYBOARD_WAIT:
    if(hid_demo.select != prev_select)
    {
      prev_select = hid_demo.select;
      HID_SelectItem(DEMO_KEYBOARD_menu, hid_demo.select & 0x7F);
      /* Handle select item */
      if(hid_demo.select & 0x80)
      {
        switch(hid_demo.select& 0x7F)
        {
        case 0:
          hid_demo.keyboard_state = HID_KEYBOARD_START;
          break;

        case 1: /* Return */
          LCD_LOG_ClearTextZone();
          hid_demo.state = HID_DEMO_REENUMERATE;
          hid_demo.select = 0;
          break;

        default:
          break;
        }
      }
    }
    break;

  case HID_KEYBOARD_START:
    USBH_HID_KeybdInit(&hUSBHost);
    USR_KEYBRD_Init();
    hid_demo.keyboard_state = HID_KEYBOARD_WAIT;
    break;

  default:
    break;
  }
  hid_demo.select &= 0x7F;
}
Ejemplo n.º 3
0
/**
  * @brief  Handle Keyboard 
  * @param  None
  * @retval None
  */
void HID_KeyboardMenuProcess(void)
{
  switch(demo.keyboard_state)
  {
  case HID_KEYBOARD_IDLE:
    demo.keyboard_state = HID_KEYBOARD_START;
    Demo_SelectItem(DEMO_KEYBOARD_menu, 0);   
    demo.select = 0;       
    break;
    
  case HID_KEYBOARD_WAIT:
    if(demo.select != prev_select)
    {
      prev_select = demo.select;
      Demo_SelectItem(DEMO_KEYBOARD_menu, demo.select & 0x7F);
      /* Handle select item */
      if(demo.select & 0x80)
      {
        demo.select &= 0x7F;
        switch(demo.select)
        {
        case 0: 
          demo.keyboard_state = HID_KEYBOARD_START;
          break;
          
        case 1: /* return */
          LCD_LOG_ClearTextZone();
          demo.state = DEMO_IDLE;
          LCD_UsrLogY("> HID application closed.\n");
          demo.select = 0;
          break;
          
        default:
          break;
        }
      }
    }
    break; 
    
  case HID_KEYBOARD_START:
    USR_KEYBRD_Init();   
    demo.keyboard_state = HID_KEYBOARD_WAIT;
    break;  
    
  default:
    break;
  }
}
/**
* @brief  KEYBRD_Init.
*         Initialize the keyboard function.
* @param  None
* @retval None
*/
static void  KEYBRD_Init (void)
{
  /* Call User Init*/
  USR_KEYBRD_Init();
}
Ejemplo n.º 5
0
/**
  * @brief  Manages Keyboard Menu Process.  
  * @param  None
  * @retval None
  */
void HID_KeyboardMenuProcess(void)
{
  USR_KEYBRD_Init();   
}