I2C连接的设备是TPS65185 I2C_InitTypeDef I2C_InitStructure; int main(void) { SystemInit(); RCC_APB2PeriphClockCmd(RCC_GPIO_USE, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE); PM_PWRUP_H; PM_WAKEUP_H; /* Enable I2C1 ----------------------------------------------------*/ I2C_Cmd(I2C1, ENABLE); /* I2C1 configuration ------------------------------------------------------*/ I2C_InitStructure.I2C_Mode = I2C_Mode_I2C; I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2; I2C_InitStructure.I2C_OwnAddress1 = 0x01; I2C_InitStructure.I2C_Ack = I2C_Ack_Enable; I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit; I2C_InitStructure.I2C_ClockSpeed = 100000; I2C_Init(I2C1, &I2C_InitStructure); /*----- First transmission Phase -----*/ /* Send I2C1 START condition */ I2C_GenerateSTART(I2C1, ENABLE); /* Test on I2C1 EV5 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)); /* Send I2C1 slave Address for write */ I2C_Send7bitAddress(I2C1, 0x68, I2C_Direction_Transmitter); /* Test on I2C1 EV6 and clear it */ while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)); 运行到这里就过不去了, 总是没有回应; 请问哪里出现问题, 谢谢! /* Send Command */ I2C_SendData(I2C1, 0x01); while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)); /* Send I2C1 STOP Condition */ I2C_GenerateSTOP(I2C1, ENABLE); } |
【MCU实战经验】基于STM32F103C8T6的hart总线调试器设计
求教STM32F103进入STOP模式后用外部中断唤醒的问题
基于STM32F103RCT6的无源蜂鸣器音乐播放(生日快乐歌)
STM32F103c8t6有没有DAC 功能?
STM32F103x中文数据手册
新手求教,为何在我电脑上找不到STM32F1Xx.h文件
金龙107例程汇总(STM32F107)
万利STM32F107VC 原理图
STM32F103 ADC多通道检测必须要DMA吗?
【官方例程】STM32F107以太网官方例程
RE:关于STM32F103ZET6 I2C1不能使用的问题
RE:关于STM32F103ZET6 I2C1不能使用的问题