Revision 78
I2C is documented. This is a pre-merge commit.
i2c.h | ||
---|---|---|
1 | 1 |
/** @file i2c.h |
2 |
* @brief |
|
2 |
* @brief Header file for I2C
|
|
3 | 3 |
* |
4 |
* @author CMU Robotics Club`
|
|
4 |
* @author CMU Robotics Club, Kevin Woo, Suresh Nidhiry
|
|
5 | 5 |
*/ |
6 | 6 |
|
7 | 7 |
|
... | ... | |
10 | 10 |
|
11 | 11 |
#include <stddef.h> |
12 | 12 |
|
13 |
/** @brief */ |
|
13 |
/** @brief Address of slave receive handler function */
|
|
14 | 14 |
typedef void (*fun_srecv_t)(char); |
15 | 15 |
|
16 |
/** @brief */ |
|
16 |
/** @brief Address of master receive handler function*/
|
|
17 | 17 |
typedef int (*fun_mrecv_t)(char); |
18 | 18 |
|
19 |
/** @brief */ |
|
19 |
/** @brief Address of slave send handler function*/
|
|
20 | 20 |
typedef char (*fun_send_t)(void); |
21 | 21 |
|
22 |
/** @brief */ |
|
23 | 22 |
int i2c_init(char addr, fun_mrecv_t master_recv, fun_srecv_t slave_recv, fun_send_t slave_send); |
24 |
|
|
25 |
/** @brief A function for the master to send data to a slave. |
|
26 |
*/ |
|
27 | 23 |
int i2c_send(char dest, char* data, size_t bytes); |
28 |
|
|
29 |
/** @brief */ |
|
30 | 24 |
int i2c_request(char dest); |
31 | 25 |
|
32 | 26 |
void i2c_packet_rec (char i2c_byte); |
Also available in: Unified diff