?? ps2.h
字號:
#ifndef _PS2_H_#define _PS2_H_/* Uncomment the next line to use the PIC's SSP Module*/#define KB_MODULE 0/* Change port as required - defaults to port b */#define KB_DAT RB1 /* clock on port B bit 2 */#define KBDAT_DIR TRISB1#define KB_CLK RB0 /* data on port B bit 1 */#define KBCLK_DIR TRISB0#define KBTRIS TRISB//#define M_SDA_INP 0x02//#define M_SDA_OUT 0xFD//#define M_SCL_INP 0x04//#define M_SCL_OUT 0xFB#define KB_INPUT 1 /* data direction input */#define KB_OUTPUT 0 /* data direction output */#define KB_READ 0x01 /* read bit used with address */#define KBC_WRITE 0x00 /* write bit used with address */#define FALSE 0#define TRUE !FALSE#define KB_ERROR (-1)//#define I2C_LAST FALSE /* SendAck: no more bytes to send *///#define I2C_MORE TRUE /* SendAck: more bytes to send *//*#define i2c_Start() i2c_Restart()#define i2c_WriteTo(address) i2c_Open((address), 0x0) //I2C_WRITE)#define i2c_ReadFrom(address) i2c_Open((address), 0x1) //I2C_READ)#define KBCLK_HIGH() KB_CLK = 1; KBCLK_DIR = KB_OUTPUT#define KBCLK_LOW() KB_CLK = 0; KBCLK_DIR = KB_OUTPUT#define KBDAT_HIGH() KB_DAT = 1; KBDAT_DIR = KB_OUTPUT#define KBDAT_LOW() KB_DAT = 0; KBDAT_DIR = KB_OUTPUT*/#endif /* _PS2_H_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -