Device interface library for multiple platforms including Mbed.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
I2CMaster Class Reference
Wrapper for mbed::I2C. More...
#include <I2CMaster.hpp>
Inherits MaximInterfaceCore::I2CMaster.
Public Types | |
enum | ErrorValue { NackError = 1 } |
Public Member Functions | |
virtual MaximInterfaceCore::Result < void > | start (uint_least8_t address) |
Send start condition and address on the bus. | |
virtual MaximInterfaceCore::Result < void > | stop () |
Send stop condition on the bus. | |
virtual MaximInterfaceCore::Result < void > | writeByte (uint_least8_t data) |
Write data byte to the bus. | |
virtual MaximInterfaceCore::Result < void > | writePacket (uint_least8_t address, MaximInterfaceCore::span< const uint_least8_t > data, DoStop doStop) |
Perform a complete write transaction on the bus. | |
virtual MaximInterfaceCore::Result < uint_least8_t > | readByte (DoAck doAck) |
Read data byte from the bus. | |
virtual MaximInterfaceCore::Result < void > | readPacket (uint_least8_t address, MaximInterfaceCore::span< uint_least8_t > data, DoStop doStop) |
Perform a complete read transaction on the bus. | |
virtual MaximInterfaceCore_EXPORT Result< void > | writeBlock (span< const uint_least8_t > data) |
Write data block to the bus. | |
virtual MaximInterfaceCore_EXPORT Result< void > | readBlock (span< uint_least8_t > data, DoAck doAck) |
Read data block from the bus. |
Detailed Description
Wrapper for mbed::I2C.
Definition at line 42 of file MaximInterfaceMbed/I2CMaster.hpp.
Member Enumeration Documentation
enum ErrorValue [inherited] |
Definition at line 47 of file MaximInterfaceCore/I2CMaster.hpp.
Member Function Documentation
Result< void > readBlock | ( | span< uint_least8_t > | data, |
DoAck | doAck | ||
) | [virtual, inherited] |
Read data block from the bus.
- Parameters:
-
[out] data Data read from the bus if successful. doAck Determines whether an ACK or NACK is done after reading.
Definition at line 61 of file MaximInterfaceCore/I2CMaster.cpp.
virtual MaximInterfaceCore::Result<uint_least8_t> readByte | ( | DoAck | doAck ) | [virtual] |
Read data byte from the bus.
- Parameters:
-
doAck Determines whether an ACK or NACK is done after reading.
- Returns:
- data Data read from the bus if successful.
Implements I2CMaster.
virtual MaximInterfaceCore::Result<void> readPacket | ( | uint_least8_t | address, |
MaximInterfaceCore::span< uint_least8_t > | data, | ||
DoStop | doStop | ||
) | [virtual] |
Perform a complete read transaction on the bus.
- Parameters:
-
address Address in 8-bit format. [out] data Data read from the bus if successful. doStop Determines whether to do a stop condition or set up a repeated start.
Reimplemented from I2CMaster.
virtual MaximInterfaceCore::Result<void> start | ( | uint_least8_t | address ) | [virtual] |
Send start condition and address on the bus.
- Parameters:
-
address Address with R/W bit.
Implements I2CMaster.
virtual MaximInterfaceCore::Result<void> stop | ( | ) | [virtual] |
Send stop condition on the bus.
Implements I2CMaster.
Result< void > writeBlock | ( | span< const uint_least8_t > | data ) | [virtual, inherited] |
Write data block to the bus.
Definition at line 38 of file MaximInterfaceCore/I2CMaster.cpp.
virtual MaximInterfaceCore::Result<void> writeByte | ( | uint_least8_t | data ) | [virtual] |
Write data byte to the bus.
Implements I2CMaster.
virtual MaximInterfaceCore::Result<void> writePacket | ( | uint_least8_t | address, |
MaximInterfaceCore::span< const uint_least8_t > | data, | ||
DoStop | doStop | ||
) | [virtual] |
Perform a complete write transaction on the bus.
- Parameters:
-
address Address in 8-bit format. data Data to write to the bus. doStop Determines whether to do a stop condition or set up a repeated start.
Reimplemented from I2CMaster.
Generated on Tue Jul 12 2022 11:13:25 by 1.7.2