STM32F429驱动GT911电容屏I2C无信号,连IO操作都无效了

2019-12-10 18:23发布

STM32F429驱动4.3寸LCD,LCD显示正常,但是I2C驱动GT911电容屏一直不成功,用示波器测SCL,SDA没有波形。
试一下IO操作,连控制高低电平都无效,但是LCD显示正常。哪位大侠知道原因的请指导下,谢谢!
void I2C_Configuration(void)
{
        I2C_InitTypeDef  I2C_InitStructure;
        GPIO_InitTypeDef  GPIO_InitStructure;
       
        RCC_AHB1PeriphClockCmd(Open_I2Cx_SDA_GPIO_CLK | Open_I2Cx_SCL_GPIO_CLK,ENABLE);
       
        RCC_APB1PeriphClockCmd(Open_I2Cx_CLK,ENABLE);
       
        GPIO_PinAFConfig(Open_I2Cx_SDA_GPIO_PORT, Open_I2Cx_SDA_SOURCE, Open_I2Cx_SDA_AF);
        GPIO_PinAFConfig(Open_I2Cx_SCL_GPIO_PORT, Open_I2Cx_SCL_SOURCE, Open_I2Cx_SCL_AF);
       
        GPIO_InitStructure.GPIO_Pin =  Open_I2Cx_SDA_PIN;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
          GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
          GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
        GPIO_Init(Open_I2Cx_SDA_GPIO_PORT, &GPIO_InitStructure);

        GPIO_InitStructure.GPIO_Pin =  Open_I2Cx_SCL_PIN;
        GPIO_Init(Open_I2Cx_SCL_GPIO_PORT, &GPIO_InitStructure);
               
        I2C_DeInit(Open_I2Cx);
        I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
        I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
        I2C_InitStructure.I2C_OwnAddress1 = I2Cx_SLAVE_ADDRESS7;
        I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
        I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
        I2C_InitStructure.I2C_ClockSpeed = I2Cx_SPEED;
       
        I2C_Cmd(Open_I2Cx, ENABLE);
        I2C_Init(Open_I2Cx, &I2C_InitStructure);
       
        I2C_AcknowledgeConfig(Open_I2Cx, ENABLE);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。