资源简介
从MDK下移植到IAR下的...
AT24C02
touch_pane
touch_pane
ILI93xx
serial
TFT

代码片段和文件信息
/* Includes ------------------------------------------------------------------*/
#include “AT24C02.h“
#define EEPROM_ADDRESS 0xA0
/*******************************************************************************
* Name : I2C_Configuration
* Deion : I2C Configuration
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void I2C_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
I2C_InitTypeDef I2C_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOBENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1ENABLE);
/* Configure I2C1 pins: SCL and SDA */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;//开漏输出
GPIO_Init(GPIOB &GPIO_InitStructure);
/* I2C configuration */
I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;//设置 I2C为 I2C模式
I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;//I2C快速模式
I2C_InitStructure.I2C_OwnAddress1 = 0;
I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;//使能应答
I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;//应答 7位地址
I2C_InitStructure.I2C_ClockSpeed = I2C_Speed;//设置时钟频率
/* I2C Peripheral Enable */
I2C_Cmd(I2C1 ENABLE);//使能I2C外设
/* Apply I2C configuration after enabling it */
I2C_Init(I2C1 &I2C_InitStructure);
}
/*******************************************************************************
* Name : I2C_EE_Init
* Deion : Initializes peripherals used by the I2C EEPROM driver.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void I2C_EE_Init()
{
/* I2C configuration */
I2C_Configuration();
}
/*******************************************************************************
* Name : I2C_EE_BufferWrite
* Deion : Writes buffer of data to the I2C EEPROM.
* Input : - pBuffer : pointer to the buffer containing the data to be
* written to the EEPROM.
* - WriteAddr : EEPROM‘s internal address to write to.
* - NumByteToWrite : number of bytes to write to the EEPROM.
* Output : None
* Return : None
pBuffer:指向要写入数据数组的指针
WriteAddr:24c02中要写入数据的首地址
NumByteToWrite:写入的字节数
*******************************************************************************/
void I2C_EE_BufferWrite(uint8_t *pBuffer uint8_t WriteAddr uint16_t NumByteToWrite)//将缓冲器的数据写入EEPROM
{
uint8_t NumOfPage = 0 NumOfSingle = 0 Addr = 0 count = 0;
uint16_t delay;
Addr = WriteAddr % I2C_PageSize;//写入地址是每页的第几位
count = I2C_PageSize - Addr;//在开始的一页要写入的个数
NumOfPage = NumByteToWrite / I2C_PageSize;//要写入的页数
NumOfSingle = NumByteToWrite % I2C_PageSize;//不足一页的个数
I2C_EE_WaitEepromStandbyState();//EEPROM设为待命状态
/* If WriteAddr is I2C_PageSize aligned */
i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-07-13 20:48 IAR下stm32程序\
文件 13582 2012-06-02 00:19 IAR下stm32程序\AT24C02.c
文件 667 2012-06-02 00:19 IAR下stm32程序\AT24C02.h
文件 29368 2012-05-27 23:18 IAR下stm32程序\board.c
文件 5875 2012-06-01 23:54 IAR下stm32程序\board.h
文件 16155 2010-06-21 11:18 IAR下stm32程序\FONT.H
文件 28920 2012-05-28 22:10 IAR下stm32程序\ILI93xx.c
文件 2236 2012-06-02 00:13 IAR下stm32程序\key.c
文件 312 2012-06-02 00:13 IAR下stm32程序\key.h
文件 8579 2012-05-28 22:10 IAR下stm32程序\lcd.h
文件 1180 2012-06-01 23:23 IAR下stm32程序\led.c
文件 200 2012-06-01 23:26 IAR下stm32程序\led.h
文件 9914 2012-06-07 00:49 IAR下stm32程序\serial.c
文件 548 2012-06-06 23:45 IAR下stm32程序\serial.h
文件 294 2012-06-01 23:21 IAR下stm32程序\sysinit.c
文件 169 2012-06-01 23:21 IAR下stm32程序\sysinit.h
文件 6812 2012-06-06 23:28 IAR下stm32程序\TFT.c
文件 4130 2012-06-06 23:28 IAR下stm32程序\TFT.h
文件 3654 2012-06-05 23:11 IAR下stm32程序\touch_pane.c
文件 975 2012-06-05 23:10 IAR下stm32程序\touch_pane.h
文件 5850 2012-06-01 23:26 IAR下stm32程序\W25X16.c
文件 1051 2012-06-01 23:27 IAR下stm32程序\W25X16.h
- 上一篇:简易数控直流电源论文
- 下一篇:4阶斐波那契数列算法使用循环队列实现
相关资源
- Beginning STM32: Developing with FreeRTOS libo
- stm32f103c8t6_sch.Lib
- ALIENTEK战舰STM32F1 V3开发板原理图.rar
- STM32F103RC+ADC+DMA多通道采样LCD显示
- I2C读写AT24C02 基于STM32F103 cube116540
- IAR FOR 430 破解工具
- 基于stm32f103ve的程序——跑马灯实验
- 基于STM32RCT6的步进电机驱动程序
- stm32f407上的两个can发送和接收例程
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- IAR For ARM 7.3最新注册机
- STM32中文资料
- IAR7.20H破解机注册机
- IAR ARM 7.8破解
- IAR 7.80.4的安装包
- IAR for MSP430 v7.10.1 注册机
- IAR-Keygen-2019+附使用教程.zip
- IAR 7.3 注册机
- IAR For ARM V5.5 注册机
- IAR for ARM 7.40 破解
- IAR For ARM 7.4 破解
- STM32蓝牙和串口程序
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- STM32基于rt_thread操作系统的SDHC卡文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
评论
共有 条评论