资源简介
c8051f单片机资料
例程,原理图。
keil C教程。

代码片段和文件信息
/*
==================================================================================================
SMBus hardware operations
This file contains some operations of C8051Fxxxx serials MCU. It afford several functions. It use
the internal Timer1 to generate the clock source of SMbus. So you can not use the TIMER1 in the
other files.
Author : LiYong
Date : 2008.09.20
Compiler: Keil C51 V8.02
Version : 1.0
Resource: SMBus Timer-1
Support MCU:
C8051F340 C8051F320
==================================================================================================
*/
#define _C8051F_SMBUS_C_
#include “C8051F_SMBus.H“
static void Delay( unsigned char x );
static void Timer1Init( char sw ) ;
SMBUS_STATE SMbusAccessSlaver( unsigned char ChipAddr unsigned char Dir );
/*
==================================================================================================
Delay : Delay some time to finish some operations
InPut : x
Output : None
Note : None
==================================================================================================
*/
static void Delay( unsigned int x )
{
while( --x );
}
/*
==================================================================================================
WaitFlag_SI: Wait the SMbus finish the current operation.
InPut : None
Output : 1:successful 0:time out
Note : None
==================================================================================================
*/
static unsigned char WaitFlag_SI( void )
{
unsigned int count = 50000;
while( !SI )
{
Delay( 1000 );
if( --count == 0 )
{
return 0;
}
}
return 1;
}
/*
==================================================================================================
Timer1Init: Initialize the timer1 This is the clock source of the SMbus
InPut : -sw : 0: turn off else turn on
Output : None
Note : None
==================================================================================================
*/
static void Timer1Init( char sw )
{
unsigned char clock = ( SMBUS_CLOCK > 10 ) ? 10 : SMBUS_CLOCK;
if( sw == SMBUS_ON )
{
CKCON &= ~( 1<<3 );//clock source : Fsys/12 = 4MHz:
TMOD &= 0x0f;
TMOD |= 0x20;
TH1 = ( clock ^ 0xFF ) + 1;
TR1 = 1;
// ET1 = 1;//do not enter the interrupt handler
}
else if( sw == SMBUS_OFF )
{
TMOD &= 0x0f;
TR1 = 0;
}
}
/*
==================================================================================================
SMBusInit: Initialize the SMbus of C8051Fxxxx serial MCU
InPut : -sw : turn on or off the SMBus turn off to reduce the power consumption
Output : None
Note : None
==================================================================================================
*/
void SMBusInit( unsigned char sw )
{
i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-07-17 20:46 新建文件夹
目录 0 2009-07-17 20:46 新建文件夹\Datasheet
文件 189883 2009-04-01 21:50 新建文件夹\Datasheet\AMS1117-3[1].3.pdf
文件 455784 2009-06-27 19:12 新建文件夹\Datasheet\AT24C02.pdf
文件 4252385 2006-07-29 17:13 新建文件夹\Datasheet\c8051f32x.pdf
文件 430549 2006-11-18 08:35 新建文件夹\Datasheet\max232.pdf
文件 101399 2008-02-28 22:47 新建文件夹\Datasheet\USB-HID-KEYBOARD.pdf
文件 279647 2008-12-08 20:50 新建文件夹\Datasheet\USB枚举过程图解.pdf
文件 1605099 2009-05-18 20:10 新建文件夹\Datasheet\W25X10_W25X20_W25X40_W25X80.pdf
目录 0 2009-07-17 20:46 新建文件夹\Examples
目录 0 2009-07-17 20:45 新建文件夹\Examples\24c02
文件 16194 2008-07-22 09:55 新建文件夹\Examples\24c02\c8051F320.h
文件 11099 2009-07-07 18:27 新建文件夹\Examples\24c02\C8051F_SMbus.c
文件 5780 2009-07-05 14:36 新建文件夹\Examples\24c02\C8051F_SMbus.H
文件 21186 2009-07-05 17:31 新建文件夹\Examples\24c02\C8051F_SMbus.LST
文件 15506 2009-07-05 17:31 新建文件夹\Examples\24c02\C8051F_SMbus.OBJ
文件 41948 2009-07-05 17:31 新建文件夹\Examples\24c02\EEPROM
文件 5038 2009-06-27 22:30 新建文件夹\Examples\24c02\eeprom.c
文件 3257 2009-07-05 15:33 新建文件夹\Examples\24c02\eeprom.H
文件 4446 2009-07-05 17:31 新建文件夹\Examples\24c02\EEPROM.hex
文件 94 2009-07-05 17:31 新建文件夹\Examples\24c02\EEPROM.lnp
文件 8505 2009-07-05 17:31 新建文件夹\Examples\24c02\eeprom.LST
文件 29833 2009-07-05 17:31 新建文件夹\Examples\24c02\EEPROM.M51
文件 15712 2009-07-05 17:31 新建文件夹\Examples\24c02\eeprom.OBJ
文件 3302 2009-07-12 00:37 新建文件夹\Examples\24c02\EEPROM.Opt
文件 188 2009-07-12 00:45 新建文件夹\Examples\24c02\EEPROM.plg
文件 2336 2009-07-05 15:33 新建文件夹\Examples\24c02\EEPROM.Uv2
文件 3275 2009-07-11 23:47 新建文件夹\Examples\24c02\EEPROM_Opt.Bak
文件 0 2009-07-05 14:34 新建文件夹\Examples\24c02\EEPROM_Uv2.Bak
文件 19 2009-07-11 23:47 新建文件夹\Examples\24c02\ExtDll.iex
............此处省略379个文件信息
- 上一篇:GBVS视觉显著性代码
- 下一篇:雷达成像技术_刘永坦
相关资源
- WCE注入工具
- ModelGoon-4.4.1-site.zip
- AsyncTask文件控制暂停和继续,在状态
- Visio大全模具(含Cisco、IBM等常用拓扑
- 信号奇异点Lipschitz指数计算
- 基于STM32RCT6的步进电机驱动程序
- 酒店管理系统基于Qt Creator5)
- 用友NC开发API字典
- Navicat Premium 15汉化包.zip55438
- 登录注册界面.zip48872
- 条码字体barcode128
- Rational Rose Common破解文件
- res10_300x300_ssd_iter_140000.caffemodel与dep
- scratch 第1课 翻跟斗的小猫(入门)
- stm32f407上的两个can发送和接收例程
- Scrach 欢乐狙击手.sb2
- 04741计算机网络原理知识点整理.docx(
- Wolfram Mathematica 矩阵初等变换函数(
- pscad近海风电模型 Fortran语言
- 程序员专用字体YaHei.Consolas.1.11b42517
- scratch3.0 源程序(说相声)
- AutoCAD永久去教育版破解补丁
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- 欧姆龙CP1系列单轴定位PLC程序.cxp
- 用Beckhoff(倍福)PLC读写巴鲁夫RFID
- CVSNT 完整覆盖版防TortoiseCVS中文乱码
- pfc 使用说明.doc
- Scratch 飞机大战.sb3
评论
共有 条评论