mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Use I2C_TIMING for F4.
This commit is contained in:
parent
193ea31ec3
commit
2700fb9123
@ -123,7 +123,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_8)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_9)
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD) // ignored
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD)
|
||||
#define SCCB_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
|
||||
#define SCCB_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include "systick.h"
|
||||
#include "omv_boardconfig.h"
|
||||
#include "cambus.h"
|
||||
#define I2C_FREQUENCY (100000)
|
||||
#define I2C_TIMEOUT (1000)
|
||||
#define I2C_SCAN_TIMEOUT (100)
|
||||
|
||||
@ -26,7 +25,7 @@ int cambus_init(I2C_HandleTypeDef *i2c, I2C_TypeDef *instance, uint32_t timing)
|
||||
#if !defined(STM32F4)
|
||||
i2c->Init.Timing = timing;
|
||||
#else
|
||||
i2c->Init.ClockSpeed = I2C_FREQUENCY;
|
||||
i2c->Init.ClockSpeed = timing;
|
||||
i2c->Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||
#endif
|
||||
i2c->Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
#include <stdint.h>
|
||||
#include STM32_HAL_H
|
||||
#if defined(STM32F4)
|
||||
#define I2C_TIMING_STANDARD (0)
|
||||
#define I2C_TIMING_FULL (0)
|
||||
#define I2C_TIMING_FAST (0)
|
||||
#define I2C_TIMING_STANDARD (100000U)
|
||||
#define I2C_TIMING_FULL (400000U)
|
||||
#define I2C_TIMING_FAST (400000U)
|
||||
#elif defined(STM32F7)
|
||||
// These timing values are for f_I2CCLK=54MHz and are only approximate
|
||||
#define I2C_TIMING_STANDARD (0x1090699B)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user