DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <I2CMasterNode.hpp>
Public Member Functions | |
I2CMasterNode (const uhal::Node &node) | |
I2CMasterNode (const I2CMasterNode &node) | |
virtual | ~I2CMasterNode () |
virtual uint16_t | get_i2c_clock_prescale () const |
virtual std::vector< std::string > | get_slaves () const |
virtual uint8_t | get_slave_address (const std::string &name) const |
virtual const I2CSlave & | get_slave (const std::string &name) const |
void | reset () const |
virtual uint8_t | read_i2c (uint8_t i2c_device_address, uint32_t i2c_reg_address, bool atomic=false) const |
commodity functions | |
virtual void | write_i2c (uint8_t i2c_device_address, uint32_t i2c_reg_address, uint8_t data, bool send_stop=true) const |
virtual std::vector< uint8_t > | read_i2cArray (uint8_t i2c_device_address, uint32_t i2c_reg_address, uint32_t number_of_words, bool atomic=false) const |
virtual void | write_i2cArray (uint8_t i2c_device_address, uint32_t i2c_reg_address, std::vector< uint8_t > data, bool send_stop=true) const |
virtual std::vector< uint8_t > | read_i2cPrimitive (uint8_t i2c_device_address, uint32_t number_of_bytes) const |
virtual void | write_i2cPrimitive (uint8_t i2c_device_address, const std::vector< uint8_t > &data, bool send_stop=true) const |
bool | ping (uint8_t i2c_device_address) const |
std::vector< uint8_t > | scan () const |
Protected Member Functions | |
virtual std::vector< uint8_t > | read_block_i2c (uint8_t i2c_device_address, uint32_t number_of_bytes, bool send_reset=true) const |
virtual void | write_block_i2c (uint8_t i2c_device_address, const std::vector< uint8_t > &data, bool send_stop=true) const |
uint8_t | send_i2c_command_and_read_data (uint8_t command) const |
void | send_i2c_command_and_write_data (uint8_t command, uint8_t data) const |
Protected Attributes | |
std::unordered_map< std::string, uint8_t > | m_i2c_device_addresses |
Slaves. | |
Private Member Functions | |
void | constructor () |
void | wait_until_finished (bool require_acknowledgement=true, bool require_bus_idle_at_end=false) const |
Private Attributes | |
uint16_t | m_clock_prescale |
clock prescale factor | |
std::unordered_map< std::string, I2CSlave * > | m_i2c_devices |
I2C slaves attached to this node. | |
Static Private Attributes | |
static const std::string | kPreHiNode = "ps_hi" |
IPBus register names for i2c bus. | |
static const std::string | kPreLoNode = "ps_lo" |
static const std::string | kCtrlNode = "ctrl" |
static const std::string | kTxNode = "data" |
static const std::string | kRxNode = "data" |
static const std::string | kCmdNode = "cmd_stat" |
static const std::string | kStatusNode = "cmd_stat" |
static const uint8_t | kStartCmd = 0x80 |
static const uint8_t | kStopCmd = 0x40 |
static const uint8_t | kReadFromSlaveCmd = 0x20 |
static const uint8_t | kWriteToSlaveCmd = 0x10 |
static const uint8_t | kAckCmd = 0x08 |
static const uint8_t | kInterruptAck = 0x01 |
static const uint8_t | kReceivedAckBit = 0x80 |
static const uint8_t | kBusyBit = 0x40 |
static const uint8_t | kArbitrationLostBit = 0x20 |
static const uint8_t | kInProgressBit = 0x2 |
static const uint8_t | kInterruptBit = 0x1 |
Friends | |
class | I2CSlave |
Definition at line 40 of file I2CMasterNode.hpp.
|
explicit |
Definition at line 59 of file I2CMasterNode.cpp.
I2CMasterNode::I2CMasterNode | ( | const I2CMasterNode & | node | ) |
Definition at line 67 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 98 of file I2CMasterNode.cpp.
|
private |
Definition at line 76 of file I2CMasterNode.cpp.
|
inlinevirtual |
Definition at line 49 of file I2CMasterNode.hpp.
|
virtual |
Definition at line 134 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 121 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 110 of file I2CMasterNode.cpp.
bool I2CMasterNode::ping | ( | uint8_t | i2c_device_address | ) | const |
Definition at line 309 of file I2CMasterNode.cpp.
|
protectedvirtual |
Definition at line 269 of file I2CMasterNode.cpp.
|
virtual |
commodity functions
Definition at line 146 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 175 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 213 of file I2CMasterNode.cpp.
void I2CMasterNode::reset | ( | ) | const |
Definition at line 353 of file I2CMasterNode.cpp.
std::vector< uint8_t > I2CMasterNode::scan | ( | ) | const |
Definition at line 326 of file I2CMasterNode.cpp.
|
protected |
Definition at line 400 of file I2CMasterNode.cpp.
|
protected |
Definition at line 427 of file I2CMasterNode.cpp.
|
private |
Definition at line 457 of file I2CMasterNode.cpp.
|
protectedvirtual |
Definition at line 231 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 159 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 194 of file I2CMasterNode.cpp.
|
virtual |
Definition at line 221 of file I2CMasterNode.cpp.
|
friend |
Definition at line 134 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 118 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 123 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 122 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 111 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 108 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 124 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 119 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 125 of file I2CMasterNode.hpp.
|
staticprivate |
IPBus register names for i2c bus.
Definition at line 106 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 107 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 116 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 121 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 110 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 114 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 112 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 115 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 109 of file I2CMasterNode.hpp.
|
staticprivate |
Definition at line 117 of file I2CMasterNode.hpp.
|
private |
clock prescale factor
Definition at line 128 of file I2CMasterNode.hpp.
|
protected |
Slaves.
Definition at line 96 of file I2CMasterNode.hpp.
|
private |
I2C slaves attached to this node.
Definition at line 132 of file I2CMasterNode.hpp.