i2c.h File Reference
I2C generic driver functions (interface). More...
#include "cfg/cfg_i2c.h"
#include <cfg/compiler.h>
Go to the source code of this file.
Defines | |
| #define | I2C_BACKEND_BUILTIN 0 |
| I2C Backends. | |
| #define | I2C_BACKEND_BITBANG 1 |
| Uses emulated bitbang driver. | |
Functions | |
| bool | i2c_send (const void *_buf, size_t count) |
| Send a sequence of bytes in master transmitter mode to the selected slave device through the I2C bus. | |
| bool | i2c_recv (void *_buf, size_t count) |
| Receive a sequence of one or more bytes from the selected slave device in master receive mode through the I2C bus. | |
| void | i2c_builtin_init (void) |
| I2c builtin prototypes. | |
| bool | i2c_builtin_start_w (uint8_t id) |
| Send START condition and select slave for write. | |
| bool | i2c_builtin_start_r (uint8_t id) |
| Send START condition and select slave for read. | |
| void | i2c_builtin_stop (void) |
| Send STOP condition. | |
| bool | i2c_builtin_put (uint8_t _data) |
| Put a single byte in master transmitter mode to the selected slave device through the TWI bus. | |
| int | i2c_builtin_get (bool ack) |
| Get 1 byte from slave in master transmitter mode to the selected slave device through the TWI bus. | |
| void | i2c_bitbang_init (void) |
| I2c bitbang prototypes. | |
Detailed Description
I2C generic driver functions (interface).
- Version:
- $Id$
Definition in file i2c.h.
Define Documentation
| #define I2C_BACKEND_BUILTIN 0 |
Function Documentation
| void i2c_bitbang_init | ( | void | ) |
I2c bitbang prototypes.
Same thing here: do NOT use these function directly, instead, you can call the ones named without "_bitbang_" and specify in cfg_i2c.h (
- See also:
- CONFIG_I2C_BACKEND) that you want the bitbang backend.
Definition at line 172 of file i2c_bitbang.c.
| int i2c_builtin_get | ( | bool | ack | ) |
| void i2c_builtin_init | ( | void | ) |
I2c builtin prototypes.
Do NOT use these function directly, instead, you can call the ones named without "_builtin_" and specify in cfg_i2c.h (
- See also:
- CONFIG_I2C_BACKEND) that you want the builtin backend.
| bool i2c_builtin_put | ( | const uint8_t | data | ) |
| bool i2c_builtin_start_r | ( | uint8_t | id | ) |
| bool i2c_builtin_start_w | ( | uint8_t | id | ) |
| bool i2c_recv | ( | void * | _buf, | |
| size_t | count | |||
| ) |
| bool i2c_send | ( | const void * | _buf, | |
| size_t | count | |||
| ) |
