/*1* Copyright (c) 2018 naehrwert2* Copyright (c) 2020 CTCaer3*4* This program is free software; you can redistribute it and/or modify it5* under the terms and conditions of the GNU General Public License,6* version 2, as published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* You should have received a copy of the GNU General Public License14* along with this program. If not, see <http://www.gnu.org/licenses/>.15*/1617#ifndef _I2C_H_18#define _I2C_H_1920#include <utils/types.h>2122#define I2C_1 023#define I2C_2 124#define I2C_3 225#define I2C_4 326#define I2C_5 427#define I2C_6 52829void i2c_init(u32 i2c_idx);30int i2c_recv_buf(u8 *buf, u32 size, u32 i2c_idx, u32 dev_addr);31int i2c_send_buf_big(u32 i2c_idx, u32 dev_addr, u8 *buf, u32 size);32int i2c_recv_buf_big(u8 *buf, u32 size, u32 i2c_idx, u32 dev_addr, u32 reg);33int i2c_send_buf_small(u32 i2c_idx, u32 dev_addr, u32 reg, const u8 *buf, u32 size);34int i2c_recv_buf_small(u8 *buf, u32 size, u32 i2c_idx, u32 dev_addr, u32 reg);35int i2c_send_byte(u32 i2c_idx, u32 dev_addr, u32 reg, u8 val);36u8 i2c_recv_byte(u32 i2c_idx, u32 dev_addr, u32 reg);3738#endif394041