DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::timing::I2CMasterNode Class Reference

#include <I2CMasterNode.hpp>

Inheritance diagram for dunedaq::timing::I2CMasterNode:
[legend]
Collaboration diagram for dunedaq::timing::I2CMasterNode:
[legend]

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 I2CSlaveget_slave (const std::string &name) const
 
void reset () const
 
virtual uint8_t read_i2c (uint8_t i2c_device_address, uint32_t i2c_reg_address) 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) 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) 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
 

Detailed Description

Definition at line 40 of file I2CMasterNode.hpp.

Constructor & Destructor Documentation

◆ I2CMasterNode() [1/2]

I2CMasterNode::I2CMasterNode ( const uhal::Node & node)
explicit

Definition at line 59 of file I2CMasterNode.cpp.

60 : uhal::Node(node)
61{
63}

◆ I2CMasterNode() [2/2]

I2CMasterNode::I2CMasterNode ( const I2CMasterNode & node)

Definition at line 67 of file I2CMasterNode.cpp.

68 : uhal::Node(node)
69{
71}

◆ ~I2CMasterNode()

I2CMasterNode::~I2CMasterNode ( )
virtual

Definition at line 98 of file I2CMasterNode.cpp.

99{
100 std::unordered_map<std::string, I2CSlave*>::iterator it;
101 for (it = m_i2c_devices.begin(); it != m_i2c_devices.end(); ++it) {
102 // Delete slaves
103 delete it->second; // NOLINT
104 }
105}
std::unordered_map< std::string, I2CSlave * > m_i2c_devices
I2C slaves attached to this node.

Member Function Documentation

◆ constructor()

void I2CMasterNode::constructor ( )
private

Definition at line 76 of file I2CMasterNode.cpp.

77{
78 // 16 bit clock prescale factor.
79 // formula: m_clockPrescale = (input_frequency / 5 / desired_frequency) -1
80 // for typical IPbus applications: input frequency = IPbus clock = 31.x MHz
81 // target frequency 100 kHz to play it safe (first revision of i2c standard),
82 m_clock_prescale = 0x40;
83 // m_clock_prescale = 0x100;
84
85 // Build the list of slaves
86 // Loop over node parameters. Each parameter becomes a slave node.
87 const std::unordered_map<std::string, std::string>& parameters = this->getParameters();
88 std::unordered_map<std::string, std::string>::const_iterator it;
89 for (it = parameters.begin(); it != parameters.end(); ++it) {
90 uint32_t slave_addr = (boost::lexical_cast<timing::stoul<uint32_t>>(it->second) & 0x7f); // NOLINT(build/unsigned)
91 m_i2c_device_addresses.insert(std::make_pair(it->first, slave_addr));
92 m_i2c_devices.insert(std::make_pair(it->first, new I2CSlave(this, slave_addr)));
93 }
94}
Class to provide OpenCode I2C interface to a ipbus node.
std::unordered_map< std::string, uint8_t > m_i2c_device_addresses
Slaves.
uint16_t m_clock_prescale
clock prescale factor
Cannot create std::string fatal Incorrect parameters

◆ get_i2c_clock_prescale()

virtual uint16_t dunedaq::timing::I2CMasterNode::get_i2c_clock_prescale ( ) const
inlinevirtual

Definition at line 49 of file I2CMasterNode.hpp.

49{ return m_clock_prescale; } // NOLINT(build/unsigned)

◆ get_slave()

const I2CSlave & I2CMasterNode::get_slave ( const std::string & name) const
virtual

Definition at line 134 of file I2CMasterNode.cpp.

135{
136 std::unordered_map<std::string, I2CSlave*>::const_iterator it = m_i2c_devices.find(name);
137 if (it == m_i2c_devices.end()) {
138 throw I2CDeviceNotFound(ERS_HERE, getId(), name);
139 }
140 return *(it->second);
141}
#define ERS_HERE

◆ get_slave_address()

uint8_t I2CMasterNode::get_slave_address ( const std::string & name) const
virtual

Definition at line 121 of file I2CMasterNode.cpp.

122{
123 std::unordered_map<std::string, uint8_t>::const_iterator it = // NOLINT(build/unsigned)
124 m_i2c_device_addresses.find(name);
125 if (it == m_i2c_device_addresses.end()) {
126 throw I2CDeviceNotFound(ERS_HERE, getId(), name);
127 }
128 return it->second;
129}

◆ get_slaves()

std::vector< std::string > I2CMasterNode::get_slaves ( ) const
virtual

Definition at line 110 of file I2CMasterNode.cpp.

111{
112 std::vector<std::string> slaves;
113
114 boost::copy(m_i2c_device_addresses | boost::adaptors::map_keys, std::back_inserter(slaves));
115 return slaves;
116}

◆ ping()

bool I2CMasterNode::ping ( uint8_t i2c_device_address) const

Definition at line 301 of file I2CMasterNode.cpp.

302{
303 // Reset bus before beginning
304 reset();
305
306 try {
307 send_i2c_command_and_write_data(kStartCmd, (i2c_device_address << 1) | 0x01);
309 return true;
310 } catch (const timing::I2CException& excp) {
311 return false;
312 }
313}
void send_i2c_command_and_write_data(uint8_t command, uint8_t data) const
uint8_t send_i2c_command_and_read_data(uint8_t command) const

◆ read_block_i2c()

std::vector< uint8_t > I2CMasterNode::read_block_i2c ( uint8_t i2c_device_address,
uint32_t number_of_bytes ) const
protectedvirtual

Definition at line 264 of file I2CMasterNode.cpp.

265{
266 // transmit reg definitions
267 // bits 7-1: 7-bit slave address during address transfer
268 // or first 7 bits of byte during data transfer
269 // bit 0: RW flag during address transfer or LSB during data transfer.
270 // '1' = reading from slave
271 // '0' = writing to slave
272 // command reg definitions
273 // bit 7: Generate start condition
274 // bit 6: Generate stop condition
275 // bit 5: Read from slave
276 // bit 4: Write to slave
277 // bit 3: 0 when acknowledgement is received
278 // bit 2:1: Reserved
279 // bit 0: Interrupt acknowledge. When set, clears a pending interrupt
280
281 // Reset bus before beginning
282 reset();
283
284 // Open the connection & send the target i2c address. Bit 0 set to 1 (read)
285 send_i2c_command_and_write_data(kStartCmd, (i2c_device_address << 1) | 0x01);
286
287 std::vector<uint8_t> lArray; // NOLINT(build/unsigned)
288 for (unsigned ibyte = 0; ibyte < number_of_bytes; ibyte++) {
289
290 uint8_t cmd = ((ibyte == number_of_bytes - 1) ? (kStopCmd | kAckCmd) : 0x0); // NOLINT(build/unsigned)
291
292 // Push the cmd on the bus, retrieve the result and put it in the arrary
293 lArray.push_back(send_i2c_command_and_read_data(cmd));
294 }
295 return lArray;
296}

◆ read_i2c()

uint8_t I2CMasterNode::read_i2c ( uint8_t i2c_device_address,
uint32_t i2c_reg_address ) const
virtual

commodity functions

Definition at line 146 of file I2CMasterNode.cpp.

147{
148 // // write one word containing the address
149 // std::vector<uint8_t> array(1, i2c_reg_address & 0x7f);
150 // this->write_block_i2c(i2c_device_address, array);
151 // // request the content at the specific address
152 // return this->read_block_i2c(i2c_device_address, 1) [0];
153 return this->read_i2cArray(i2c_device_address, i2c_reg_address, 1)[0];
154}
virtual std::vector< uint8_t > read_i2cArray(uint8_t i2c_device_address, uint32_t i2c_reg_address, uint32_t number_of_words) const

◆ read_i2cArray()

std::vector< uint8_t > I2CMasterNode::read_i2cArray ( uint8_t i2c_device_address,
uint32_t i2c_reg_address,
uint32_t number_of_words ) const
virtual

Definition at line 175 of file I2CMasterNode.cpp.

178{
179 // write one word containing the address
180 std::vector<uint8_t> lArray{ (uint8_t)(i2c_reg_address & 0xff) }; // NOLINT(build/unsigned)
181 this->write_block_i2c(i2c_device_address, lArray);
182 // request the content at the specific address
183 return this->read_block_i2c(i2c_device_address, number_of_words);
184}
virtual std::vector< uint8_t > read_block_i2c(uint8_t i2c_device_address, uint32_t number_of_bytes) const
virtual void write_block_i2c(uint8_t i2c_device_address, const std::vector< uint8_t > &data, bool send_stop=true) const

◆ read_i2cPrimitive()

std::vector< uint8_t > I2CMasterNode::read_i2cPrimitive ( uint8_t i2c_device_address,
uint32_t number_of_bytes ) const
virtual

Definition at line 208 of file I2CMasterNode.cpp.

209{
210 return this->read_block_i2c(i2c_device_address, number_of_bytes);
211}

◆ reset()

void I2CMasterNode::reset ( ) const

Definition at line 345 of file I2CMasterNode.cpp.

346{
347 // Resets the I2C bus
348 //
349 // This function does the following:
350 // 1) Disables the I2C core
351 // 2) Sets the clock prescale registers
352 // 3) Enables the I2C core
353 // 4) Sets all writable bus-master registers to default values
354
355 auto ctrl = getNode(kCtrlNode).read();
356 auto pre_hi = getNode(kPreHiNode).read();
357 auto pre_lo = getNode(kPreLoNode).read();
358 getClient().dispatch();
359
360 bool full_reset(false);
361
362 full_reset = (m_clock_prescale != (pre_hi << 8) + pre_lo);
363
364 if (full_reset) {
365 // disable the I2C core
366 getNode(kCtrlNode).write(0x00);
367 getClient().dispatch();
368 // set the clock prescale
369 getNode(kPreHiNode).write((m_clock_prescale & 0xff00) >> 8);
370 // getClient().dispatch();
371 getNode(kPreLoNode).write(m_clock_prescale & 0xff);
372 // getClient().dispatch();
373 // set all writable bus-master registers to default values
374 getNode(kTxNode).write(0x00);
375 getNode(kCmdNode).write(0x00);
376 getClient().dispatch();
377
378 // enable the I2C core
379 getNode(kCtrlNode).write(0x80);
380 getClient().dispatch();
381 } else {
382 // set all writable bus-master registers to default values
383 getNode(kTxNode).write(0x00);
384 getNode(kCmdNode).write(0x00);
385 getClient().dispatch();
386 }
387}
static const std::string kCtrlNode
static const std::string kCmdNode
static const std::string kPreHiNode
IPBus register names for i2c bus.
static const std::string kPreLoNode
static const std::string kTxNode

◆ scan()

std::vector< uint8_t > I2CMasterNode::scan ( ) const

Definition at line 318 of file I2CMasterNode.cpp.

319{
320
321 std::vector<uint8_t> address_vector; // NOLINT(build/unsigned)
322
323 // Reset bus before beginning
324 reset();
325
326 for (uint8_t iaddr(0); iaddr < 0x7f; ++iaddr) { // NOLINT(build/unsigned)
327 // Open the connection & send the target i2c address. Bit 0 set to 1 (read)
328 try {
329 send_i2c_command_and_write_data(kStartCmd, (iaddr << 1) | 0x01);
331 } catch (const timing::I2CException& excp) {
332 // TIMING_LOG(kError) << std::showbase << std::hex << (uint32_t)iaddr << " " << excp.what();
333 continue;
334 }
335 address_vector.push_back(iaddr);
336 // TIMING_LOG(kNotice) << std::showbase << std::hex << (uint32_t)iaddr << " found";
337 }
338
339 return address_vector;
340}

◆ send_i2c_command_and_read_data()

uint8_t I2CMasterNode::send_i2c_command_and_read_data ( uint8_t command) const
protected

Definition at line 392 of file I2CMasterNode.cpp.

393{
394
395 assert(!(command & kWriteToSlaveCmd));
396
397 uint8_t full_cmd = command | kReadFromSlaveCmd; // NOLINT(build/unsigned)
398 TLOG_DEBUG(10) << ">> sending read cmd = " << format_reg_value((uint32_t)full_cmd); // NOLINT(build/unsigned)
399
400 // Force the read bit high and set them cmd bits
401 getNode(kCmdNode).write(full_cmd);
402 getClient().dispatch();
403
404 // Wait for transaction to finish. Require idle bus at the end if stop bit is high)
405 wait_until_finished(/*req ack*/ false, command & kStopCmd);
406
407 // Pull the data out of the rx register.
408 uhal::ValWord<uint32_t> result = getNode(kRxNode).read(); // NOLINT(build/unsigned)
409 getClient().dispatch();
410
411 TLOG_DEBUG(10) << "<< receive data = " << format_reg_value((uint32_t)result); // NOLINT(build/unsigned)v
412
413 return (result & 0xff);
414}
static const uint8_t kWriteToSlaveCmd
void wait_until_finished(bool require_acknowledgement=true, bool require_bus_idle_at_end=false) const
static const uint8_t kReadFromSlaveCmd
static const std::string kRxNode
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
std::string format_reg_value(T reg_value, uint32_t base)
Definition toolbox.hxx:117

◆ send_i2c_command_and_write_data()

void I2CMasterNode::send_i2c_command_and_write_data ( uint8_t command,
uint8_t data ) const
protected

Definition at line 419 of file I2CMasterNode.cpp.

420{
421
422 //
423 assert(!(command & kReadFromSlaveCmd));
424
425 uint8_t full_cmd = command | kWriteToSlaveCmd; // NOLINT(build/unsigned)
426 std::stringstream debug_stream;
427 debug_stream << ">> sending write cmd = " << std::showbase << std::hex << (uint32_t)full_cmd // NOLINT(build/unsigned)
428 << " data = " << std::showbase << std::hex << (uint32_t)data; // NOLINT(build/unsigned)
429 TLOG_DEBUG(10) << debug_stream.str();
430
431 // write the payload
432 getNode(kTxNode).write(data);
433 getClient().dispatch();
434
435 // Force the write bit high and set them cmd bits
436 getNode(kCmdNode).write(full_cmd);
437
438 // Run the commands and wait for transaction to finish
439 getClient().dispatch();
440
441 // Wait for transaction to finish. Require idle bus at the end if stop bit is high
442 // wait_until_finished(req_hack, requ_idle)
443 wait_until_finished( true, command & kStopCmd); // NOLINT
444}

◆ wait_until_finished()

void I2CMasterNode::wait_until_finished ( bool require_acknowledgement = true,
bool require_bus_idle_at_end = false ) const
private

Definition at line 449 of file I2CMasterNode.cpp.

450{
451 // Ensures the current bus transaction has finished successfully
452 // before allowing further I2C bus transactions
453 // This method monitors the status register
454 // and will not allow execution to continue until the
455 // I2C bus has completed properly. It will throw an exception
456 // if it picks up bus problems or a bus timeout occurs.
457 const unsigned max_retry = 20;
458 unsigned attempt = 1;
459 bool received_acknowledge, busy;
460
461 const uhal::Node& status_node = getNode(kStatusNode);
462
463 while (attempt <= max_retry) {
464 usleep(10);
465 // Get the status
466 uhal::ValWord<uint32_t> i2c_status = status_node.read(); // NOLINT(build/unsigned)
467 getClient().dispatch();
468
469 received_acknowledge = !(i2c_status & kReceivedAckBit);
470 busy = (i2c_status & kBusyBit);
471 bool arbitration_lost = (i2c_status & kArbitrationLostBit);
472 bool transfer_in_progress = (i2c_status & kInProgressBit);
473
474 if (arbitration_lost) {
475 // This is an instant error at any time
476 throw I2CBusArbitrationLost(ERS_HERE, getId());
477 }
478
479 if (!transfer_in_progress) {
480 // The transfer looks to have completed successfully,
481 // pending further checks
482 break;
483 }
484
485 attempt += 1;
486 }
487
488 // At this point, we've either had too many retries, or the
489 // Transfer in Progress (TIP) bit went low. If the TIP bit
490 // did go low, then we do a couple of other checks to see if
491 // the bus operated as expected:
492
493 if (attempt > max_retry) {
494 throw I2CTransactionTimeout(ERS_HERE, getId());
495 }
496
497 if (require_acknowledgement && !received_acknowledge) {
498 throw I2CNoAcknowledgeReceived(ERS_HERE, getId());
499 }
500
501 if (require_bus_idle_at_end && busy) {
502 throw I2CTransferFinishedBusStillBusy(ERS_HERE, getId());
503 }
504}
static const std::string kStatusNode
static const uint8_t kInProgressBit
static const uint8_t kArbitrationLostBit
static const uint8_t kReceivedAckBit

◆ write_block_i2c()

void I2CMasterNode::write_block_i2c ( uint8_t i2c_device_address,
const std::vector< uint8_t > & data,
bool send_stop = true ) const
protectedvirtual

Definition at line 226 of file I2CMasterNode.cpp.

229{
230 // transmit reg definitions
231 // bits 7-1: 7-bit slave address during address transfer
232 // or first 7 bits of byte during data transfer
233 // bit 0: RW flag during address transfer or LSB during data transfer.
234 // '1' = reading from slave
235 // '0' = writing to slave
236 // command reg definitions
237 // bit 7: Generate start condition
238 // bit 6: Generate stop condition
239 // bit 5: Read from slave
240 // bit 4: Write to slave
241 // bit 3: 0 when acknowledgement is received
242 // bit 2:1: Reserved
243 // bit 0: Interrupt acknowledge. When set, clears a pending interrupt
244
245 // Reset bus before beginning
246 reset();
247
248 // Open the connection and send the slave address, bit 0 set to zero
249 send_i2c_command_and_write_data(kStartCmd, (i2c_device_address << 1) & 0xfe);
250
251 for (unsigned ibyte = 0; ibyte < data.size(); ibyte++) {
252
253 // Send stop if last element of the array (and not vetoed)
254 uint8_t cmd = (((ibyte == data.size() - 1) && send_stop) ? kStopCmd : 0x0); // NOLINT(build/unsigned)
255
256 // Push the byte on the bus
257 send_i2c_command_and_write_data(cmd, data[ibyte]);
258 }
259}

◆ write_i2c()

void I2CMasterNode::write_i2c ( uint8_t i2c_device_address,
uint32_t i2c_reg_address,
uint8_t data,
bool send_stop = true ) const
virtual

Definition at line 159 of file I2CMasterNode.cpp.

163{
164 // std::vector<uint8_t> block(2);
165 // block[0] = (i2c_reg_address & 0xff);
166 // block[1] = (data & 0xff);
167 // this->write_block_i2c(i2c_device_address, block);
168
169 this->write_i2cArray(i2c_device_address, i2c_reg_address, { data }, send_stop);
170}
virtual void write_i2cArray(uint8_t i2c_device_address, uint32_t i2c_reg_address, std::vector< uint8_t > data, bool send_stop=true) const

◆ write_i2cArray()

void I2CMasterNode::write_i2cArray ( uint8_t i2c_device_address,
uint32_t i2c_reg_address,
std::vector< uint8_t > data,
bool send_stop = true ) const
virtual

Definition at line 189 of file I2CMasterNode.cpp.

193{
194 // std::cout << "Writing " << data.size() << " from " << std::showbase << std::hex << i2c_reg_address << " on " <<
195 // (uint32_t)i2c_device_address << std::endl; // HACK
196 std::vector<uint8_t> block(data.size() + 1); // NOLINT(build/unsigned)
197 block[0] = (i2c_reg_address & 0xff);
198
199 for (size_t i(0); i < data.size(); ++i)
200 block[i + 1] = data[i];
201
202 this->write_block_i2c(i2c_device_address, block, send_stop);
203}

◆ write_i2cPrimitive()

void I2CMasterNode::write_i2cPrimitive ( uint8_t i2c_device_address,
const std::vector< uint8_t > & data,
bool send_stop = true ) const
virtual

Definition at line 216 of file I2CMasterNode.cpp.

219{
220 this->write_block_i2c(i2c_device_address, data, send_stop);
221}

Friends And Related Symbol Documentation

◆ I2CSlave

friend class I2CSlave
friend

Definition at line 132 of file I2CMasterNode.hpp.

Member Data Documentation

◆ kAckCmd

const uint8_t I2CMasterNode::kAckCmd = 0x08
staticprivate

Definition at line 116 of file I2CMasterNode.hpp.

◆ kArbitrationLostBit

const uint8_t I2CMasterNode::kArbitrationLostBit = 0x20
staticprivate

Definition at line 121 of file I2CMasterNode.hpp.

◆ kBusyBit

const uint8_t I2CMasterNode::kBusyBit = 0x40
staticprivate

Definition at line 120 of file I2CMasterNode.hpp.

◆ kCmdNode

const std::string I2CMasterNode::kCmdNode = "cmd_stat"
staticprivate

Definition at line 109 of file I2CMasterNode.hpp.

◆ kCtrlNode

const std::string I2CMasterNode::kCtrlNode = "ctrl"
staticprivate

Definition at line 106 of file I2CMasterNode.hpp.

◆ kInProgressBit

const uint8_t I2CMasterNode::kInProgressBit = 0x2
staticprivate

Definition at line 122 of file I2CMasterNode.hpp.

◆ kInterruptAck

const uint8_t I2CMasterNode::kInterruptAck = 0x01
staticprivate

Definition at line 117 of file I2CMasterNode.hpp.

◆ kInterruptBit

const uint8_t I2CMasterNode::kInterruptBit = 0x1
staticprivate

Definition at line 123 of file I2CMasterNode.hpp.

◆ kPreHiNode

const std::string I2CMasterNode::kPreHiNode = "ps_hi"
staticprivate

IPBus register names for i2c bus.

Definition at line 104 of file I2CMasterNode.hpp.

◆ kPreLoNode

const std::string I2CMasterNode::kPreLoNode = "ps_lo"
staticprivate

Definition at line 105 of file I2CMasterNode.hpp.

◆ kReadFromSlaveCmd

const uint8_t I2CMasterNode::kReadFromSlaveCmd = 0x20
staticprivate

Definition at line 114 of file I2CMasterNode.hpp.

◆ kReceivedAckBit

const uint8_t I2CMasterNode::kReceivedAckBit = 0x80
staticprivate

Definition at line 119 of file I2CMasterNode.hpp.

◆ kRxNode

const std::string I2CMasterNode::kRxNode = "data"
staticprivate

Definition at line 108 of file I2CMasterNode.hpp.

◆ kStartCmd

const uint8_t I2CMasterNode::kStartCmd = 0x80
staticprivate

Definition at line 112 of file I2CMasterNode.hpp.

◆ kStatusNode

const std::string I2CMasterNode::kStatusNode = "cmd_stat"
staticprivate

Definition at line 110 of file I2CMasterNode.hpp.

◆ kStopCmd

const uint8_t I2CMasterNode::kStopCmd = 0x40
staticprivate

Definition at line 113 of file I2CMasterNode.hpp.

◆ kTxNode

const std::string I2CMasterNode::kTxNode = "data"
staticprivate

Definition at line 107 of file I2CMasterNode.hpp.

◆ kWriteToSlaveCmd

const uint8_t I2CMasterNode::kWriteToSlaveCmd = 0x10
staticprivate

Definition at line 115 of file I2CMasterNode.hpp.

◆ m_clock_prescale

uint16_t dunedaq::timing::I2CMasterNode::m_clock_prescale
private

clock prescale factor

Definition at line 126 of file I2CMasterNode.hpp.

◆ m_i2c_device_addresses

std::unordered_map<std::string, uint8_t> dunedaq::timing::I2CMasterNode::m_i2c_device_addresses
protected

Slaves.

Definition at line 94 of file I2CMasterNode.hpp.

◆ m_i2c_devices

std::unordered_map<std::string, I2CSlave*> dunedaq::timing::I2CMasterNode::m_i2c_devices
private

I2C slaves attached to this node.

Definition at line 130 of file I2CMasterNode.hpp.


The documentation for this class was generated from the following files: