1 /*
2  * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
3  *
4  * This file is part of HackRF.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; see the file COPYING.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef __I2C_LPC_H__
23 #define __I2C_LPC_H__
24 
25 #include <stdint.h>
26 #include <stddef.h>
27 #include <stdbool.h>
28 
29 #include "i2c_bus.h"
30 
31 typedef struct i2c_lpc_config_t {
32 	const uint16_t duty_cycle_count;
33 } i2c_lpc_config_t;
34 
35 void i2c_lpc_start(i2c_bus_t* const bus, const void* const config);
36 void i2c_lpc_stop(i2c_bus_t* const bus);
37 void i2c_lpc_transfer(i2c_bus_t* const bus,
38 	const uint_fast8_t peripheral_address,
39 	const uint8_t* const data_tx, const size_t count_tx,
40 	uint8_t* const data_rx, const size_t count_rx
41 );
42 bool i2c_probe(i2c_bus_t* const bus, const uint_fast8_t device_address);
43 
44 #endif/*__I2C_LPC_H__*/
45