Browse Source

Hardware I2C0/I2C1 for sccb communication

pull/129/head
apiesse 5 years ago
parent
commit
a6e2ac208e
  1. 13
      Kconfig
  2. 11
      driver/sccb.c

13
Kconfig

@ -21,13 +21,20 @@ config OV3660_SUPPORT @@ -21,13 +21,20 @@ config OV3660_SUPPORT
Enable this option if you want to use the OV3360.
Disable this option to safe memory.
config SCCB_HARDWARE_I2C
bool "Use hardware I2C1 for SCCB"
default y
choice SCCB_HARDWARE_I2C
bool "Use hardware I2C0/I2C1 for SCCB"
default SCCB_HARDWARE_I2C1
help
Enable this option if you want to use hardware I2C to control the camera.
Disable this option to use software I2C.
config SCCB_HARDWARE_I2C0
bool "I2C0"
config SCCB_HARDWARE_I2C1
bool "I2C1"
endchoice
choice CAMERA_TASK_PINNED_TO_CORE
bool "Camera task pinned to core"
default CAMERA_CORE0

11
driver/sccb.c

@ -19,6 +19,13 @@ @@ -19,6 +19,13 @@
static const char* TAG = "sccb";
#endif
#ifdef CONFIG_SCCB_HARDWARE_I2C0
#define CONFIG_SCCB_HARDWARE_I2C
#endif
#ifdef CONFIG_SCCB_HARDWARE_I2C1
#define CONFIG_SCCB_HARDWARE_I2C
#endif
#define LITTLETOBIG(x) ((x<<8)|(x>>8))
#ifdef CONFIG_SCCB_HARDWARE_I2C
@ -31,7 +38,11 @@ static const char* TAG = "sccb"; @@ -31,7 +38,11 @@ static const char* TAG = "sccb";
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
#define ACK_VAL 0x0 /*!< I2C ack value */
#define NACK_VAL 0x1 /*!< I2C nack value */
#if CONFIG_SCCB_HARDWARE_I2C1
const int SCCB_I2C_PORT = 1;
#else
const int SCCB_I2C_PORT = 0;
#endif
static uint8_t ESP_SLAVE_ADDR = 0x3c;
#else
#include "twi.h"

Loading…
Cancel
Save