keil_examples/USBHID/demo.c
/*
 *  Get HID Input Report -> InReport
 */
Get HID Input Report -> InReport
Get HID Input Report - > InReport
void GetInReport (void) {
  uint32_t kbd_val;
  kbd_val = (LPC_GPIO1->FIOPIN >> 20) & KBD_MASK;
  InReport = 0x00;
  if ((kbd_val & KBD_UP)     == 0) InReport |= 0x01;  
  if ((kbd_val & KBD_LEFT)   == 0) InReport |= 0x02;  
  if ((kbd_val & KBD_RIGHT)  == 0) InReport |= 0x04;  
  if ((kbd_val & KBD_SELECT) == 0) InReport |= 0x08;  
  if ((kbd_val & KBD_DOWN)   == 0) InReport |= 0x10;  
}
void GetInReport ( void ) { uint32_t kbd_val ; kbd_val = ( LPC_GPIO1 -> FIOPIN >> 20 ) & KBD_MASK ; InReport = 0x00 ; if ( ( kbd_val & KBD_UP ) == 0 ) InReport |= 0x01 ; if ( ( kbd_val & KBD_LEFT ) == 0 ) InReport |= 0x02 ; if ( ( kbd_val & KBD_RIGHT ) == 0 ) InReport |= 0x04 ; if ( ( kbd_val & KBD_SELECT ) == 0 ) InReport |= 0x08 ; if ( ( kbd_val & KBD_DOWN ) == 0 ) InReport |= 0x10 ; }
Get HID Input Report -> InReport
Get HID Input Report - > InReport
/* up     pressed means 0 */ /* left   pressed means 0 */ /* right  pressed means 0 */ /* select pressed means 0 */ /* down   pressed means 0 */