dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_i2c.h
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 
29 #ifndef PIOS_I2C_H
30 #define PIOS_I2C_H
31 
32 #include <stdbool.h>
33 
34 /* Global Types */
38 };
39 
40 struct pios_i2c_txn {
41  const char *info;
42  uint16_t addr;
44  uint32_t len;
45  uint8_t *buf;
46 };
47 
48 typedef struct pios_i2c_adapter *pios_i2c_t;
49 
50 /* Public Functions */
51 extern int32_t PIOS_I2C_CheckClear(pios_i2c_t i2c_id);
52 extern int32_t PIOS_I2C_Transfer(pios_i2c_t i2c_id, const struct pios_i2c_txn txn_list[], uint32_t num_txns);
53 extern int32_t PIOS_I2C_Transfer_Callback(pios_i2c_t i2c_id, const struct pios_i2c_txn txn_list[], uint32_t, void *callback);
54 extern void PIOS_I2C_EV_IRQ_Handler(pios_i2c_t i2c_id);
55 extern void PIOS_I2C_ER_IRQ_Handler(pios_i2c_t i2c_id);
56 
57 #endif /* PIOS_I2C_H */
58 
enum pios_i2c_txn_direction rw
Definition: pios_i2c.h:43
pios_i2c_txn_direction
Definition: pios_i2c.h:35
int32_t PIOS_I2C_CheckClear(pios_i2c_t i2c_id)
uint8_t * buf
Definition: pios_i2c.h:45
struct pios_i2c_adapter * pios_i2c_t
Definition: pios_i2c.h:48
void PIOS_I2C_EV_IRQ_Handler(pios_i2c_t i2c_id)
int32_t PIOS_I2C_Transfer_Callback(pios_i2c_t i2c_id, const struct pios_i2c_txn txn_list[], uint32_t, void *callback)
int32_t PIOS_I2C_Transfer(pios_i2c_t i2c_id, const struct pios_i2c_txn txn_list[], uint32_t num_txns)
uint16_t addr
Definition: pios_i2c.h:42
void PIOS_I2C_ER_IRQ_Handler(pios_i2c_t i2c_id)
const char * info
Definition: pios_i2c.h:41
uint32_t len
Definition: pios_i2c.h:44