1 /**————————————————————2 〖说明〗I2C总线驱动程序(用两个普通IO模拟I2C总线)3 包括100Khz(T=10us)的标准模式(慢速模式)选择,4 和400Khz(T=2.5us)的快速模式选择,5 默认11.0592Mhz的晶振。6 〖文件〗PCF8563T.C ﹫2001/11/2 77 〖作者〗龙啸九天 c51@yeah.net http://www.c51bbs.co /8 〖修改〗修改建议请到论坛公布 http://www.c51bbs.co m9 〖版本〗V1.00A Build 080310 —————————————————————*/1112 #ifndef SDA13 #define SDA P0_014 #define SCL P0_115 #endif1617 extern uchar SystemError;1819 #define uchar unsigned char20 #define uint unsigned int21 #define Byte unsigned char22 #define Word unsigned int23 #define bool bit24 #define true 125 #define false 02627 #define SomeNOP(); _nop_();_nop_();_nop_();_nop_();2829 /**--------------------------------------------------------------------------------30 调用方式:void I2CStart(void) ﹫2001/07/0 431 函数说明:私有函数,I2C专用32 ---------------------------------------------------------------------------------*/33 void I2CStart(void)34 {35 EA=0;36 SDA=1; SCL=1; SomeNOP();//INI37 SDA=0; SomeNOP(); //START38 SCL=0;39 }4041 /**--------------------------------------------------------------------------------42 调用方式:void I2CStop(void) ﹫2001/07/0 443 函数说明:私有函数,I2C专用44 ---------------------------------------------------------------------------------*/45 void I2CStop(void)46 {47 SCL=0; SDA=0; SomeNOP(); //INI48 SCL=1; SomeNOP(); SDA=1; //STOP49 EA=1;50 }5152 /**--------------------------------------------------------------------------------53 调用方式:bit I2CAck(void) ﹫2001/07/0 454 函数说明:私有函数,I2C专用,等待从器件接收方的应答55 ---------------------------------------------------------------------------------*/56 bool WaitAck(void)57 {58 uchar errtime=255;//因故障接收方无ACK,超时值为255。59 SDA=1;SomeNOP();60 SCL=1;SomeNOP();61 while(SDA) {errtime--; if (!errtime) {I2CStop();SystemError=0x11;return false;}}62 SCL=0;63 return true;
上传时间: 2014-04-11
上传用户:xg262122
嵌入式Linux下CAN总线驱动程序设计
上传时间: 2014-12-21
上传用户:xiaowei314
摘 要: 介绍虚拟设备驱动程序开发的基本知识以及VxDs与WIN32应用程序通讯的几种常用方法,并给出了用VtoolsD开发VxDs的具体实例。 关键词: 虚拟设备,虚拟设备驱动程序(VxDs),DDK,VTOOLSD WIN95下虚拟设备驱动程序设计开发.pdf
上传时间: 2015-01-03
上传用户:yyxy
title=Windows NT/2000/XP 虚拟磁盘驱动程序 memo=将一个或多个文件模拟成物理磁盘。
上传时间: 2015-02-04
上传用户:rishian
I2C总线驱动程序(用两个普通IO模拟I2C总线)
上传时间: 2013-12-17
上传用户:sclyutian
使用98 DDK 编写虚拟设备驱动程序
上传时间: 2015-02-21
上传用户:chfanjiang
嵌入式系统中USB总线驱动的开发及应用
上传时间: 2014-08-02
上传用户:Thuan
一个wmd+xvd开发的虚拟鼠标驱动程序,用键盘模拟鼠标操作
上传时间: 2015-03-05
上传用户:BOBOniu
自动生成虚拟设备驱动(VXD)的C++代码的一个库,非常的好
上传时间: 2014-07-14
上传用户:zhengjian
motorola单片机68hc908gr60的LIN总线驱动程序,编译环境Codewarrior,经验证可以使用
上传时间: 2014-06-08
上传用户:zhuyibin