使用的stm32f767芯片HAL库,连接OV2640摄像头,通过硬件i2c来读写摄像头出现问题!! i2c配置如下: I2C_Handle.Instance = I2C4; I2C_Handle.Init.Timing = 0x60201E2B;//100KHz I2C_Handle.Init.OwnAddress1 =0; I2C_Handle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; I2C_Handle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; I2C_Handle.Init.OwnAddress2 = 0; I2C_Handle.Init.OwnAddress2Masks = I2C_OA2_NOMASK; I2C_Handle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; I2C_Handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; 写寄存器用的函数HAL_I2C_Mem_Write,读寄存器用的HAL_I2C_Mem_Read, uint8_t OV2640_WriteReg(uint16_t Addr, uint8_t Data) { HAL_StatusTypeDef status = HAL_OK; status = HAL_I2C_Mem_Write(&I2C_Handle, OV2640_DEVICE_ADDRESS, (uint16_t)Addr, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Data, 1, 1000); if(status != HAL_OK) { I2Cx_Error(); } } 开始读取摄像头id,总卡在HAL_I2C_Mem_Write内的I2C_RequestMemoryWrite函数上,返回HAL_ERROR!!这是哪里出现了问题??请大神指教啊!!! |
点评
评分
查看全部评分
请问下,您上面说的那个参考文件在哪里啊??
大佬的风格就是只发文件名,不贴链接