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

📄 user_generic_hid.h

📁 PIC18F4550_USB开发原代码
💻 H
字号:
/*********************************************************************
 *
 *                Microchip USB C18 Firmware - Mouse Demo
 *
 *********************************************************************
 * FileName:        user_generic_hid.h
 * Dependencies:    See INCLUDES section below
 * Processor:       PIC18
 * Compiler:        C18 2.30.01+
 * Company:         Microchip Technology, Inc.
 *
 * Software License Agreement
 *
 * The software supplied herewith by Microchip Technology Incorporated
 * (the Company for its PICmicro?Microcontroller is intended and
 * supplied to you, the Company customer, for use solely and
 * exclusively on Microchip PICmicro Microcontroller products. The
 * software is owned by the Company and/or its supplier, and is
 * protected under applicable copyright laws. All rights are reserved.
 * Any use in violation of the foregoing restrictions may subject the
 * user to criminal sanctions under applicable laws, as well as to
 * civil liability for the breach of the terms and conditions of this
 * license.
 *
 * THIS SOFTWARE IS PROVIDED IN AS ITS CONDITION. NO WARRANTIES,
 * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
 * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
 * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 *
 * Author               Date        Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Rawin Rojvanit       11/19/04    Original.
 * Jan Axelson           3/4/05     Mouse application adapted for 
 *                                  Generic HID application.	
 ********************************************************************/

#ifndef USER_H
#define USER_H

/** P U B L I C  P R O T O T Y P E S *****************************************/
void UserInit(void);
void ProcessIO(void);
void GetInputReport0(void);
void GetFeatureReport0(void);
void SetOutputReport0(void);
void SetFeatureReport0(void);
byte SetOutReportStatus(byte report_type, byte report_id);
void HandleControlOutReport(void);
/** For Oxygen project ***********************************/
void ReceiveControllerStatus(void);
void ReadBlackBox(void);
void InitBlackBox(void);
#define READ_STATUS	 	0xD4  // 随机取的值,防止数据操作出错时,执行误操作.
#define READ_BLACKBOX   	0xC8  // 这些数据必须与上位机程序的定义一致.
#define INIT_BLACKBOX  		0xE5     
#define dataPacketMAXSIZE 	128

/** Oxygen ***********/
#define POWER_OK 		0x34
#define POWER_OFF 		0x55
#define MCU_STATUS 		PORTBbits.RB2
#define MCU_STATUS_DIR TRISBbits.TRISB2
#define MCU_OK	0x34
#define MCU_ERROR	0x54

#define GPU_STATUS PORTBbits.RB5
#define GPU_STATUS_DIR TRISBbits.TRISB5
#define GPU_OK	0x34
#define GPU_ERROR	0x53


#if defined(__18F4550) 
#define SDA_DIR   TRISBbits.TRISB0
#define SCL_DIR   TRISBbits.TRISB1
#endif // I2C port mapping for 18F4550

unsigned char check_power(void);
unsigned char check_MCU(void);
unsigned char check_GPU(void);


#define USB_FL	16 		//this data must meet the same one on PC side
#define USB_FSP	2 		//this data must meet the same one on PC side
#define I2C_Data_Length 8


#endif //USER_H

⌨️ 快捷键说明

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