Fix OV5640 rev Y slock freq scaling

This commit is contained in:
Kwabena W. Agyeman 2020-12-04 14:38:19 -08:00
parent 1a46add7f9
commit 5e419eedde
2 changed files with 10 additions and 0 deletions

View File

@ -389,6 +389,14 @@ static int reset(sensor_t *sensor)
ret |= cambus_writeb2(&sensor->i2c, sensor->slv_addr, (default_regs[i][0] << 8) | (default_regs[i][1] << 0), default_regs[i][2]);
}
#if defined(MCU_SERIES_H7)
// Rev V (480 MHz / 20) -> 24 MHz PCLK / 3 * 100 = 800 MHz / 10 = 80 MHz PCLK.
// Rev Y (400 MHz / 16) -> 25 MHz PCLK / 3 * 84 = 700 MHz / 10 = 70 MHz PCLK.
if (HAL_GetREVID() < 0x2003) { // Is this REV Y?
ret |= cambus_writeb2(&sensor->i2c, sensor->slv_addr, SC_PLL_CONTRL2, 0x54);
}
#endif
// Delay 300 ms
systick_sleep(300);

View File

@ -17,7 +17,9 @@
#define SYSTEM_CTROL0 0x3008
#define SC_PLL_CONTRL1 0x3035
#define SC_PLL_CONTRL2 0x3036
#define SC_PLL_CONTRL3 0x3037
#define SCCB_SYSTEM_CTRL_1 0x3103