lpc_hid.c

来自「IAR-2148.rar 这是IAR上做的2148所有的例程」· C语言 代码 · 共 47 行

C
47
字号
/*************************************************************************
 *
 *    Used with ICCARM and AARM.
 *
 *    (c) Copyright IAR Systems 2003
 *
 *    File name   : main.c
 *    Description : Define main module
 *
 *    History :
 *    1. Data        : June 16, 2005
 *       Author      : Stanimir Bonev
 *       Description : Create
 *
 *    $Revision: 1.2 $
**************************************************************************/
#include "lpc_hid.h"


typedef union
{
  unsigned int Data[2];
  unsigned short SetupRecuest;
  struct
  {
    unsigned char  RequestType;
    unsigned char  Request;
    unsigned short Value;
    unsigned short Index;
    unsigned short Length;
  } DataFields;
} USB_SETUP_PACKET_DEF;

#define MIN(a, b) (((a) < (b)) ? (a) : (b))

unsigned char  currentConfiguration;
unsigned char  currentAddress;

const short mouseDescriptor[] =
{
  0x0105, // Usage Page (Generic Desktop)
  0x0209, // Usage (Mouse)
  0x01A1, // Collection (Application)
  0x0109, //  Usage (Pointer)
  0x00A1, //  Collection (Physical)
  0x0905, //    Usage Page (Buttons)
  0x0119, //    Usage Minimum

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?