【STM32F303开发】开发学习笔记、教程集合贴
【合集】STM32F303开发教程
【STM32F303开发】+ 使用片内的CCMRAM缩短代码执行时间
【STM32F303开发】(五)TIM定时器PWM的输出与捕获
【STM32F303开发】+ 内部Flash模拟EEPROM
【STM32F303开发】+如何解析GPS数据
【STM32F303开发】+使用fromelf反汇编keil生成的AXF文件
使用STM32F303VBT6的SPI驱动TM1629A
【STM32F303开发】+ 使用SWO输出调试信息到Debug Viewer窗口
【STM32F303开发】基础:工程模板+LED+USART+常用文档+按键中断
#define EEPROM_SCL_Pin GPIO_Pin_0 /* PB.00 */
#define EEPROM_SCL_GPIOx GPIOB
#define EEPROM_SDA_Pin GPIO_Pin_1 /* PB.01 */
#define EEPROM_SDA_GPIOx GPIOB
/* IIC×ÜÏߣ¬SDAÊý¾ÝÏßµÄÊä³ö·½ÏòÉèÖà */
#define IIC_SDA_IN() {EEPROM_SDA_GPIOx->MODER&=~(3 << (1*2));EEPROM_SDA_GPIOx->MODER|=0 << (1*2);}
#define IIC_SDA_OUT() {EEPROM_SDA_GPIOx->MODER&=~(3 << (1*2));EEPROM_SDA_GPIOx->MODER|=1 << (1*2);}
#define EEPROM_GPIOB_Pin EEPROM_SCL_Pin|EEPROM_SDA_Pin
#define EEPROM_RCC_GPIOx RCC_AHBPeriph_GPIOB
/* IO¿Ú²Ù×÷ºê¶¨Òå */
#define BITBAND(addr, bitnum) ((addr & 0xF0000000)+0x2000000+((addr &0xFFFFF)<<5)+(bitnum<<2))
#define MEM_ADDR(addr) *((volatile unsigned long *)(addr))
#define BIT_ADDR(addr, bitnum) MEM_ADDR(BITBAND(addr, bitnum))
/* IO¿ÚµØÖ·Ó³Éä */
#define GPIOA_ODR_Addr (GPIOA_BASE+0x14)
#define GPIOB_ODR_Addr (GPIOB_BASE+0x14)
#define GPIOC_ODR_Addr (GPIOC_BASE+0x14)
#define GPIOD_ODR_Addr (GPIOD_BASE+0x14)
#define GPIOA_IDR_Addr (GPIOA_BASE+0x10)
#define GPIOB_IDR_Addr (GPIOB_BASE+0x10)
#define GPIOC_IDR_Addr (GPIOC_BASE+0x10)
#define GPIOD_IDR_Addr (GPIOD_BASE+0x10)
/* IO¿Ú²Ù×÷£¬Ö»¶Ôµ¥Ò»µÄIO¿Ú */
#define IIC_SCL BIT_ADDR(GPIOB_ODR_Addr,0)
#define IIC_SDA BIT_ADDR(GPIOB_ODR_Addr,1)
#define Read_SDA BIT_ADDR(GPIOB_IDR_Addr,1)
不成功现像是什么?