I2C
91i2. 

所属分类:处理器开发
开发工具:C++
文件大小:16KB
下载次数:4
上传日期:2012-02-14 03:08:35
上 传 者electronicdz
说明:  arm st91 I2C一个简单例子,采用keil mdk开发环境,需要参考的,可以下来看看。
(arm st91 I2C a simple example, keil mdk development environment, the need to refer to, can look down.)

文件列表:
I2C\91x_conf.h (3886, 2009-05-07)
I2C\91x_it.c (21820, 2009-05-07)
I2C\I2C.Opt (4450, 2012-02-14)
I2C\I2C.Uv2 (5863, 2009-05-07)
I2C\I2C_Opt.Bak (4446, 2009-05-07)
I2C\I2C_STR91x Release.dep (842, 2012-02-14)
I2C\main.c (9666, 2009-05-07)
I2C\output\I2C.plg (171, 2012-02-14)
I2C\STR91x.s (26608, 2009-05-07)
I2C\output (0, 2012-02-14)
I2C (0, 2012-02-14)

/******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** * File Name : Readme.txt * Author : MCD Application Team * Version : V2.0 * Date : 12/07/2007 * Description : Description of the I2C Example. ******************************************************************************** * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ Example description =================== This example provides a description of how to set a communication between the two I2Cs and performs a transfer from Master to Slave and from Slave to Master in interrupt mode. The I2C1 is configured in Master transmitter during transmission phase and in Master receiver during receive phase. However, I2C0 is configured as Slave receiver during transmission phase and as slave transmitter during receive phase. The Own I2C0 address is defined to 0xA0. The speed is set to the maximum frequency of 400kHz for both I2Cs. In the first part, the Master send the I2C1_Buffer_Tx to be received by the Slave. Then data read by the I2C0 peripheral and stored in the I2C0_Buffer_Rx is compared with the expected values of transmitted buffer. The result of this comparison is stored in the "TransferStatus1" variable. In the second part, The Slave send the I2C0_Buffer_Tx to be received by the Master Then data read by the I2C1 peripheral and stored in the I2C1_Buffer_Rx is compared with the expected values of transmitted buffer. The result of this comparison is stored in the "TransferStatus2" variable. Directory contents ================== 91x_conf.h Library Configuration file 91x_it.c Interrupt handlers 91x_it.h Interrupt handlers header file main.c Main program readme.txt This file Hardware environment ==================== Connect both I2C0 and I2C01 pins as following: - Connect I2C0_CLKOUT(P2.0) to I2C1_CLKOUT(P2.2). - Connect I2C0_DOUT(P2.1) to I2C1_DOUT(P2.3). - Connect a pull-up resistor to both CLKOUT and DOUT lines How to use it ============= In order to make the program work, you must do the following : - Create a project and setup all your toolchain's start-up files - Compile the directory content files and required Library files : + 91x_lib.c + 91x_i2c.c + 91x_gpio.c + 91x_scu.c + 91x_vic.c + 91x_fmi.c - Link all compiled files and load your image into Flash - Run the example ******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****

近期下载者

相关文件


收藏者