Merge pull request #129 from apiesse/feature/config_i2s_sccb
Hardware I2C0/I2C1 for sccb communication
This commit is contained in:
14
Kconfig
14
Kconfig
@@ -22,11 +22,23 @@ config OV3660_SUPPORT
|
|||||||
Disable this option to safe memory.
|
Disable this option to safe memory.
|
||||||
|
|
||||||
config SCCB_HARDWARE_I2C
|
config SCCB_HARDWARE_I2C
|
||||||
bool "Use hardware I2C1 for SCCB"
|
bool "Use hardware I2C for SCCB"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Enable this option if you want to use hardware I2C to control the camera.
|
Enable this option if you want to use hardware I2C to control the camera.
|
||||||
Disable this option to use software I2C.
|
Disable this option to use software I2C.
|
||||||
|
|
||||||
|
choice SCCB_HARDWARE_I2C_PORT
|
||||||
|
bool "I2C peripheral to use for SCCB"
|
||||||
|
depends on SCCB_HARDWARE_I2C
|
||||||
|
default SCCB_HARDWARE_I2C_PORT1
|
||||||
|
|
||||||
|
config SCCB_HARDWARE_I2C_PORT0
|
||||||
|
bool "I2C0"
|
||||||
|
config SCCB_HARDWARE_I2C_PORT1
|
||||||
|
bool "I2C1"
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
choice CAMERA_TASK_PINNED_TO_CORE
|
choice CAMERA_TASK_PINNED_TO_CORE
|
||||||
bool "Camera task pinned to core"
|
bool "Camera task pinned to core"
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ static const char* TAG = "sccb";
|
|||||||
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
|
#define ACK_CHECK_DIS 0x0 /*!< I2C master will not check ack from slave */
|
||||||
#define ACK_VAL 0x0 /*!< I2C ack value */
|
#define ACK_VAL 0x0 /*!< I2C ack value */
|
||||||
#define NACK_VAL 0x1 /*!< I2C nack value */
|
#define NACK_VAL 0x1 /*!< I2C nack value */
|
||||||
|
#if CONFIG_SCCB_HARDWARE_I2C_PORT1
|
||||||
const int SCCB_I2C_PORT = 1;
|
const int SCCB_I2C_PORT = 1;
|
||||||
|
#else
|
||||||
|
const int SCCB_I2C_PORT = 0;
|
||||||
|
#endif
|
||||||
static uint8_t ESP_SLAVE_ADDR = 0x3c;
|
static uint8_t ESP_SLAVE_ADDR = 0x3c;
|
||||||
#else
|
#else
|
||||||
#include "twi.h"
|
#include "twi.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user