⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hid.h

📁 使用ISP1362芯片的USB_OTG参考设计源代码比较新的版本
💻 H
字号:
/*
**  WASABI-Hot! version 1.2c    (HID sub-unit)
**
**
**      -- copyright (c) 2001-2004 by Philips Japan, Ltd. -- All rights reserved --
**
**
**      ** This code has been made to check/learn                          ** 
**      **                             the ISP1362/ISP1363 functionalities **
**      ** Release 06-Aug-2004                                             **
**
**      OKANO, Akifumi
**      
**		Application Laboratory, Mobile and Connectivity
**      Semiconductors Div, Philips Japan Ltd.
**      akifumi.okano@philips.com
**      +81-3-3740-4668 
*/

/*
**	HID-Keyboard/Mouse handling framework has been written by Hisashige Harashima
**		04-Mar-2002
*/


#ifndef _HID_H
#define _HID_H

/****************************************************************************/
/*	includes																*/
/****************************************************************************/

#include	"_hc_core/dev_ep.h"
#include	"_hc_core/transfer.h"


/****************************************************************************/
/*	macros																	*/
/****************************************************************************/

#define		hid_instance_ptr( x )			((hid_instance *)((x)->class_instance_ptr))								//	"x" will be a device instance pointer


/****************************************************************************/
/*	types																	*/
/****************************************************************************/

//
//	HID parameters for each hub instances.
//
typedef struct  hid_param		{
									unsigned char				tr_index;
									transfer_instance			*tr_instance_ptr;
									unsigned long				ep1_data;					//	Hub and Port Statua Change Bitmap
									unsigned char				max_packet_size;
									unsigned char				polling_rate;
																
									//	For graphics draw
									
									int							gdriver;
									int							gmode;
									int							errorcode;
									
                                }
                                hid_instance;


typedef struct  _hid_cls_interface{
									unsigned short  idVendor;
									unsigned short  idProduct;
									unsigned char  	(*hid_initialization_function)( device_instance *dvi_ptr );
									unsigned char  	(*hid_dispose_function)( device_instance *dvi_ptr );
									unsigned char  	(*hid_callback_function)( device_instance *dvi_ptr, unsigned long value );
                                }
                                hid_cls_interface;

typedef struct  _mouse_status	{
									short 			x;
									short  			y;
									unsigned char  	button;
                                }
                                mouse_status;


/****************************************************************************/
/*	function prototypes														*/
/****************************************************************************/

unsigned short		hid_init_commands( device_instance *dvi_ptr );
unsigned short		hid_dispose_process( device_instance *dvi_ptr );

unsigned char		hid_usb_key_buffer( void );
int					hid_usb_key_buffer_pop( void );

unsigned short  	hid_cls_interface_install( hid_cls_interface *hci );
void				hid_keyboard_main( void );
#endif //	_HID_H

⌨️ 快捷键说明

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