1、修改stm32f0xx_i2c.h中 I2C_InitTypeDef的结构体,增加 I2C_OwnAddress2 field:
typedef struct
{
...
uint32_t I2C_OwnAddress2; /*!< Specifies the device own address 2.
This parameter can be a 7-bit address*/
...
}I2C_InitTypeDef;
2、修改stm32f0xx_i2c_cpal.c function:
uint32_t CPAL_I2C_Init(CPAL_InitTypeDef* pDevInitStruct)
{
...
/* If OA2 Address mode option bit selected */
if ((pDevInitStruct->wCPAL_Options & CPAL_OPT_I2C_DUALADDR) != 0)
{
/* Configure OA2 */
//__CPAL_I2C_HAL_OA2_CONF(pDevInitStruct->CPAL_Dev, (uint32_t)(pDevInitStruct->wCPAL_Options & 0x000000FE));
__CPAL_I2C_HAL_OA2_CONF(pDevInitStruct->CPAL_Dev, (uint32_t)(pDevInitStruct->pCPAL_I2C_Struct->I2C_OwnAddress2 & 0x000000FE));
...
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
STM32F0从I2C程序(经过测试可达到400K的速率)
共111个文件
h:32个
o:30个
c:30个
4星 · 超过85%的资源 需积分: 49 478 下载量 70 浏览量
2014-12-20
19:33:10
上传
评论 10
收藏 574KB RAR 举报
温馨提示
用C写的一个STM32F0系列的从I2C程序,可以支持一个或多个字节立即读以及随机读,一个或多个字节写操作;经过测试最大可满足400k的通信速率。
资源推荐
资源详情
资源评论
收起资源包目录
STM32F0从I2C程序(经过测试可达到400K的速率) (111个子文件)
stm32f05x_i2c.h.bak 18KB
stm32f05x_i2c.C.bak 9KB
STM32F0_ExamplePrj.cspy.bat 1KB
stm32f0xx_tim.c 123KB
stm32f0xx_rtc.c 88KB
stm32f0xx_usart.c 80KB
stm32f0xx_i2c_cpal.c 74KB
stm32f0xx_rcc.c 58KB
stm32f0xx_i2c.c 55KB
stm32f0xx_spi.c 50KB
stm32f0xx_adc.c 45KB
stm32f0xx_flash.c 39KB
stm32f0xx_dma.c 28KB
stm32f0xx_cec.c 24KB
stm32f0xx_i2c_cpal_hal.c 22KB
stm32f0xx_pwr.c 19KB
stm32f0xx_dac.c 19KB
stm32f0xx_gpio.c 18KB
stm32f0xx_comp.c 15KB
system_stm32f0xx.c 12KB
stm32f0xx_syscfg.c 11KB
stm32f0xx_iwdg.c 11KB
stm32f0xx_exti.c 10KB
stm32f0xx_wwdg.c 10KB
stm32f05x_i2c.C 9KB
stm32f0xx_crc.c 9KB
stm32f0xx_i2c_cpal_usercallback.c 8KB
stm32f0xx_it.c 8KB
stm32f0_discovery.c 7KB
stm32f0xx_dbgmcu.c 7KB
main.c 7KB
stm32f0xx_i2c_cpal_usercallback_template.c 7KB
stm32f0xx_misc.c 6KB
STM32F0_ExamplePrj.dbgdt 6KB
STM32F0_ExamplePrj.dep 28KB
STM32F0_ExamplePrj.dni 1KB
STM32F0_ExamplePrj.ewd 52KB
STM32F0_ExamplePrj.ewp 55KB
STM32F0_ExamplePrj.eww 172B
stm32f0xx.h 232KB
stm32f0xx_tim.h 50KB
stm32f0xx_rtc.h 34KB
stm32f0xx_i2c_cpal_hal.h 32KB
stm32f0xx_i2c_cpal.h 31KB
stm32f0xx_i2c_cpal_conf.h 31KB
stm32f0xx_i2c_cpal_conf_template.h 30KB
stm32f0xx_usart.h 25KB
stm32f0xx_spi.h 22KB
stm32f0xx_rcc.h 20KB
stm32f0xx_adc.h 19KB
stm32f0xx_i2c.h 18KB
stm32f05x_i2c.h 18KB
stm32f0xx_dma.h 14KB
stm32f0xx_gpio.h 13KB
stm32f0xx_cec.h 12KB
stm32f0xx_flash.h 11KB
stm32f0xx_comp.h 10KB
stm32f0xx_syscfg.h 9KB
stm32f0xx_exti.h 8KB
stm32f0xx_dac.h 7KB
stm32f0xx_pwr.h 6KB
stm32f0xx_iwdg.h 4KB
stm32f0xx_misc.h 4KB
stm32f0xx_dbgmcu.h 4KB
stm32f0_discovery.h 4KB
stm32f0xx_crc.h 4KB
stm32f0xx_wwdg.h 3KB
stm32f0xx_conf.h 3KB
main.h 3KB
stm32f0xx_it.h 2KB
system_stm32f0xx.h 2KB
Release_Notes.html 23KB
Release_Notes.html 16KB
Release_Notes.html 15KB
stm32f0xx_flash.icf 1KB
stm32f0xx_tim.o 167KB
stm32f0xx_rtc.o 96KB
stm32f0xx_usart.o 89KB
stm32f0xx_i2c.o 77KB
stm32f0xx_rcc.o 73KB
stm32f0xx_spi.o 58KB
stm32f0xx_flash.o 57KB
stm32f0xx_adc.o 54KB
stm32f0xx_i2c_cpal.o 45KB
stm32f0xx_i2c_cpal_hal.o 40KB
stm32f0xx_cec.o 30KB
stm32f0xx_gpio.o 28KB
stm32f0xx_dac.o 27KB
stm32f0xx_dma.o 24KB
stm32f0_discovery.o 23KB
startup_stm32f0xx_IAR.o 22KB
stm32f0xx_pwr.o 21KB
stm32f0xx_crc.o 20KB
stm32f0xx_exti.o 18KB
stm32f0xx_syscfg.o 18KB
stm32f0xx_comp.o 18KB
stm32f0xx_wwdg.o 17KB
stm32f0xx_iwdg.o 16KB
stm32f0xx_it.o 15KB
stm32f0xx_i2c_cpal_usercallback.o 14KB
共 111 条
- 1
- 2
东城居士
- 粉丝: 11
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页