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

📄 mouse.h

📁 蓝牙无线鼠标软件代码。采用CSR公司的BLUELAB27模式。有很好的参考价值。
💻 H
字号:
/****************************************************************************

  Copyright (C) Cambridge Silicon Radio October 2001

FILE
        hid_mouse.h - defines for hid_mouse 

MODIFICATION HISTORY


*****************************************************************************/

/*
	The possible states of the mouse
*/
typedef enum
{
	init,
	unconnected,
	discoverable,
	connecting,
	connected,
	disconnecting
}
state_t;

/*
	Mouse's internal data
*/
typedef struct
{	
	state_t		state;			/* current state of mouse */
	BD_ADDR_T	host_addr;
	uint8_t		protocol;
	bool_t		virtual_cable;
	
	/* flag to indicate user pressed the connect button, but we were unable to process
	   it immediately.  As we change state, we should check for this. */
	bool_t		button_press_pending;

	/* the current powermode in the powerstate table we are using */
	uint8_t		power_mode;
}
DEVICE_STATE_T;


/*
	The PIO mask that defines the connect button.
*/
#define CONNECT_BUTTON (1<<6)
#define STATUS_LED1 (1<<8)
#define STATUS_LED2 (1<<7)

/*
	Time in seconds between reading the battery.
	(Note that this number should be a multiple of 4 because battery monitor
	takes 4 samples before returning average).
*/
#define BATTERY_SAMPLE_RATE (4*60) /* every 4 minutes */


/*
	Function prototypes
*/
void connect(connect_type_t con_type);
void cancelConnect(void);
void disconnect(bool_t unplug);
void removeVirtualCable(void);
void sendBatteryReport(uint16_t battery_level);

void handleSetProtocol(const HID_SET_PROTOCOL_IND_T *prim);
void handleGetProtocol(const HID_GET_PROTOCOL_IND_T *prim);
void handleSetIdle(const HID_SET_IDLE_IND_T *prim);
void handleGetIdle(const HID_GET_IDLE_IND_T *prim);
void handleGetReport(const HID_GET_REPORT_IND_T *prim);
void handleControl(const HID_CONTROL_IND_T *prim);
void handleSetReport(const HID_SET_REPORT_IND_T *prim);

⌨️ 快捷键说明

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