|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Definitions, functions, and classes related to I2C communication bus devices. More...
Classes | |
| class | activeMaster |
| class | master |
| This class provides the I2C master interface definition. More... | |
| struct | op_t |
| I2C operation definition. More... | |
Typedefs | |
| using | ao_storage = std::pair< embvm::i2c::op_t, const embvm::i2c::master::cb_t > |
| using | addr_t = uint8_t |
| I2C address storage type. More... | |
| using | commBus = commBus< i2c::op_t, i2c::baud, i2c::I2C_MASTER_REQD_STATIC_FUNCTION_SIZE, i2c::status > |
| Convenience alias for the declaration of the I2C commBus. More... | |
Enumerations | |
| enum | operation : uint8_t { operation::stop = 0, operation::restart, operation::write, operation::read, operation::writeRead, operation::writeNoStop, operation::continueWriteNoStop, operation::continueWriteStop, operation::ping } |
| I2C operation types. More... | |
| enum | state : uint8_t { state::idle = 0, state::busy, state::error } |
| Represents the state of the I2C bus. More... | |
| enum | status { status::ok = 0, status::enqueued, status::busy, status::error, status::unknown, status::addrNACK, status::dataNACK, status::bus } |
| I2C bus status. More... | |
| enum | baud { baud::lowSpeed = 10000, baud::standard = 100000, baud::fast = 400000 } |
| Valid I2C bus baudrate options. More... | |
| enum | pullups : uint8_t { pullups::external = 0, pullups::internal } |
| Pull-up configuration options for an I2C master device. More... | |
Variables | |
| static constexpr size_t | I2C_MASTER_REQD_STATIC_FUNCTION_SIZE = 96 |
| Maximum size of the I2C master callback functor object. More... | |
| static constexpr uint8_t | ReadBit = 0x01 |
| Added to slave address to indicate a read command. More... | |
Definitions, functions, and classes related to I2C communication bus devices.
| struct embvm::i2c::op_t |
I2C operation definition.
The I2C bus operates in half-duplex mode, meaning that reads and writes do not occur simultaneously. The operation type represents a variety of operations which can be performed by an I2C device. The transmit options (tx_buffer and tx_size) are required by any operations using "write". The receive options (rx_buffer and rx_size) are required by any operations using "read".
| Class Members | ||
|---|---|---|
| uint8_t | address | Slave device address (7-bit). |
| operation | op | Operation to perform. |
| uint8_t * | rx_buffer |
Pointer to the receive buffer. Does not need to be specified for write-only commands. |
| size_t | rx_size |
Number of bytes to receive. Does not need to be specified for write-only commands. |
| const uint8_t * | tx_buffer |
Pointer to the transmit buffer. Does not need to be specified for read-only commands. |
| size_t | tx_size |
Number of bytes to transmit. Does not need to be specified for read-only commands. |
| using embvm::i2c::addr_t = typedef uint8_t |
I2C address storage type.
| using embvm::i2c::ao_storage = typedef std::pair<embvm::i2c::op_t, const embvm::i2c::master::cb_t> |
| using embvm::i2c::commBus = typedef commBus<i2c::op_t, i2c::baud, i2c::I2C_MASTER_REQD_STATIC_FUNCTION_SIZE, i2c::status> |
Convenience alias for the declaration of the I2C commBus.
|
strong |
|
strong |
I2C operation types.
The operation enum defines the type of transfer that the op_t structure is to perform.
|
strong |
|
strong |
|
strong |
I2C bus status.
This enumeration represents the status of an I2C bus. This type extends the default embvm::comm::status definition with additional I2C-specific statuses.
|
static |
Maximum size of the I2C master callback functor object.
|
static |
Added to slave address to indicate a read command.
1.8.15