Device interface library for multiple platforms including Mbed.
Dependents: DeepCover Embedded Security in IoT MaximInterface MAXREFDES155#
I2CMaster Class Reference
I2C master interface. More...
#include <I2CMaster.hpp>
Inherited by I2CMasterDecorator, DS9400, and I2CMaster.
Public Types | |
enum | ErrorValue { NackError = 1 } |
Public Member Functions | |
virtual Result< void > | start (uint_least8_t address)=0 |
Send start condition and address on the bus. | |
virtual Result< void > | stop ()=0 |
Send stop condition on the bus. | |
virtual Result< void > | writeByte (uint_least8_t data)=0 |
Write data byte to 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 > | writePacket (uint_least8_t address, span< const uint_least8_t > data, DoStop doStop) |
Perform a complete write transaction on the bus. | |
virtual Result< uint_least8_t > | readByte (DoAck doAck)=0 |
Read data byte from the bus. | |
virtual MaximInterfaceCore_EXPORT Result< void > | readBlock (span< uint_least8_t > data, DoAck doAck) |
Read data block from the bus. | |
virtual MaximInterfaceCore_EXPORT Result< void > | readPacket (uint_least8_t address, span< uint_least8_t > data, DoStop doStop) |
Perform a complete read transaction on the bus. |
Detailed Description
I2C master interface.
Definition at line 45 of file MaximInterfaceCore/I2CMaster.hpp.
Member Enumeration Documentation
enum ErrorValue |
Definition at line 47 of file MaximInterfaceCore/I2CMaster.hpp.
Member Function Documentation
Result< void > readBlock | ( | span< uint_least8_t > | data, |
DoAck | doAck | ||
) | [virtual] |
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.
Result< uint_least8_t > readByte | ( | DoAck | doAck ) | [pure 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.
Implemented in I2CMaster.
Definition at line 67 of file MaximInterfaceMbed/I2CMaster.cpp.
Result< void > readPacket | ( | uint_least8_t | address, |
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 in I2CMaster.
Definition at line 69 of file MaximInterfaceCore/I2CMaster.cpp.
Result< void > start | ( | uint_least8_t | address ) | [pure virtual] |
Send start condition and address on the bus.
- Parameters:
-
address Address with R/W bit.
Implemented in I2CMaster.
Definition at line 39 of file MaximInterfaceMbed/I2CMaster.cpp.
Result< void > stop | ( | ) | [pure virtual] |
Send stop condition on the bus.
Implemented in I2CMaster.
Definition at line 44 of file MaximInterfaceMbed/I2CMaster.cpp.
Result< void > writeBlock | ( | span< const uint_least8_t > | data ) | [virtual] |
Write data block to the bus.
Definition at line 38 of file MaximInterfaceCore/I2CMaster.cpp.
Result< void > writeByte | ( | uint_least8_t | data ) | [pure virtual] |
Write data byte to the bus.
Implemented in I2CMaster.
Definition at line 49 of file MaximInterfaceMbed/I2CMaster.cpp.
Result< void > writePacket | ( | uint_least8_t | address, |
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 in I2CMaster.
Definition at line 45 of file MaximInterfaceCore/I2CMaster.cpp.
Generated on Fri May 29 2020 21:20:50 by
