mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #790 from openmv/cambus_speed
Add I2C timings to cambus.
This commit is contained in:
commit
ecf6e4581e
@ -107,7 +107,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_8)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_9)
|
||||
#define SCCB_TIMING (0) // ignored
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD) // ignored
|
||||
|
||||
/* DCMI */
|
||||
#define DCMI_TIM (TIM1)
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_8)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_9)
|
||||
#define SCCB_TIMING (0x1090699B) // Frequency: 100KHz Rise Time: 100ns Fall Time: 20ns
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD)
|
||||
|
||||
/* DCMI */
|
||||
#define DCMI_TIM (TIM1)
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_8)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_9)
|
||||
#define SCCB_TIMING (0x20D09DE7) // Frequency: 100KHz Rise Time: 100ns Fall Time: 20ns
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD)
|
||||
|
||||
/* DCMI */
|
||||
#define DCMI_TIM (TIM1)
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_8)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_9)
|
||||
#define SCCB_TIMING (0x20D09DE7) // Frequency: 100KHz Rise Time: 100ns Fall Time: 20ns
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD)
|
||||
|
||||
/* DCMI */
|
||||
#define DCMI_TIM (TIM1)
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
#define SCCB_PORT (GPIOB)
|
||||
#define SCCB_SCL_PIN (GPIO_PIN_6)
|
||||
#define SCCB_SDA_PIN (GPIO_PIN_7)
|
||||
#define SCCB_TIMING (0x20D09DE7) // Frequency: 100KHz Rise Time: 100ns Fall Time: 20ns
|
||||
#define SCCB_TIMING (I2C_TIMING_STANDARD)
|
||||
|
||||
#define DCMI_PWDN_PIN (GPIO_PIN_4)
|
||||
#define DCMI_PWDN_PORT (GPIOD)
|
||||
|
||||
@ -12,6 +12,23 @@
|
||||
#define __CAMBUS_H__
|
||||
#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)
|
||||
#elif defined(STM32F7)
|
||||
// These timing values are for f_I2CCLK=54MHz and are only approximate
|
||||
#define I2C_TIMING_STANDARD (0x1090699B)
|
||||
#define I2C_TIMING_FULL (0x70330309)
|
||||
#define I2C_TIMING_FAST (0x50100103)
|
||||
#elif defined(STM32H7)
|
||||
// I2C timing obtained from the CUBEMX.
|
||||
#define I2C_TIMING_STANDARD (0x20D09DE7)
|
||||
#define I2C_TIMING_FULL (0x40900C22)
|
||||
#define I2C_TIMING_FAST (0x4030040B)
|
||||
#else
|
||||
#error "no I2C timings for this MCU"
|
||||
#endif
|
||||
|
||||
int cambus_init(I2C_HandleTypeDef *i2c, I2C_TypeDef *instance, uint32_t timing);
|
||||
int cambus_deinit(I2C_HandleTypeDef *i2c);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user