mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
commit
b898f0bb8e
@ -104,7 +104,7 @@
|
||||
#define ISC_I2C_ID (0)
|
||||
#define ISC_I2C_SCL_PIN (2)
|
||||
#define ISC_I2C_SDA_PIN (31)
|
||||
#define ISC_I2C_SPEED (CAMBUS_SPEED_FULL)
|
||||
#define ISC_I2C_SPEED (CAMBUS_SPEED_STANDARD)
|
||||
|
||||
// I2C0
|
||||
#define TWI0_ID (0)
|
||||
@ -125,7 +125,7 @@
|
||||
|
||||
// DCMI
|
||||
#define DCMI_PWDN_PIN (29)
|
||||
//#define DCMI_RESET_PIN (30)
|
||||
#define DCMI_RESET_PIN (30)
|
||||
|
||||
#define DCMI_D0_PIN (32+2)
|
||||
#define DCMI_D1_PIN (32+3)
|
||||
|
||||
@ -114,7 +114,7 @@ int cambus_readb(cambus_t *bus, uint8_t slv_addr, uint8_t reg_addr, uint8_t *reg
|
||||
|
||||
nrfx_twi_enable(&bus->i2c);
|
||||
nrfx_twi_xfer_desc_t desc1 = NRFX_TWI_XFER_DESC_TX(slv_addr, ®_addr, 1);
|
||||
if (nrfx_twi_xfer(&bus->i2c, &desc1, NRFX_TWI_FLAG_TX_NO_STOP) != NRFX_SUCCESS) {
|
||||
if (nrfx_twi_xfer(&bus->i2c, &desc1, 0) != NRFX_SUCCESS) {
|
||||
ret = -1;
|
||||
goto i2c_error;
|
||||
}
|
||||
|
||||
@ -144,14 +144,6 @@ static int dcmi_config()
|
||||
_hrefPort = portInputRegister(digitalPinToPort(DCMI_HSYNC_PIN));
|
||||
_pclkPort = portInputRegister(digitalPinToPort(DCMI_PXCLK_PIN));
|
||||
|
||||
#if defined(DCMI_PWDN_PIN)
|
||||
nrf_gpio_cfg_output(DCMI_PWDN_PIN);
|
||||
#endif
|
||||
|
||||
#if defined(DCMI_RESET_PIN)
|
||||
nrf_gpio_cfg_output(DCMI_RESET_PIN);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -159,6 +151,16 @@ int sensor_init()
|
||||
{
|
||||
int init_ret = 0;
|
||||
|
||||
#if defined(DCMI_PWDN_PIN)
|
||||
nrf_gpio_cfg_output(DCMI_PWDN_PIN);
|
||||
DCMI_PWDN_HIGH();
|
||||
#endif
|
||||
|
||||
#if defined(DCMI_RESET_PIN)
|
||||
nrf_gpio_cfg_output(DCMI_RESET_PIN);
|
||||
DCMI_RESET_HIGH();
|
||||
#endif
|
||||
|
||||
/* Do a power cycle */
|
||||
DCMI_PWDN_HIGH();
|
||||
mp_hal_delay_ms(10);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user