// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #ifdef __cplusplus extern "C" { #endif #include #include #include "soc/i2c_caps.h" /** * @brief I2C port number, can be I2C_NUM_0 ~ (I2C_NUM_MAX-1). */ typedef int i2c_port_t; typedef enum{ I2C_MODE_SLAVE = 0, /*!< I2C slave mode */ I2C_MODE_MASTER, /*!< I2C master mode */ I2C_MODE_MAX, } i2c_mode_t; typedef enum { I2C_MASTER_WRITE = 0, /*!< I2C write data */ I2C_MASTER_READ, /*!< I2C read data */ } i2c_rw_t; typedef enum{ I2C_CMD_RESTART = 0, /*!