pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::lpgbt::I2CwithMux Class Reference

Synchronous I2C implementation. More...

#include <I2C.h>

Inheritance diagram for pflib::lpgbt::I2CwithMux:
[legend]
Collaboration diagram for pflib::lpgbt::I2CwithMux:
[legend]

Public Member Functions

 I2CwithMux (lpGBT &lpGBT, int ibus, uint8_t muxaddr, uint8_t tochoose)
 
virtual void write_byte (uint8_t i2c_dev_addr, uint8_t data)
 Write a single byte using the efficient interface, and wait for completion.
 
virtual uint8_t read_byte (uint8_t i2c_dev_addr)
 Read a single byte using the efficient interface.
 
virtual std::vector< uint8_t > general_write_read (uint8_t i2c_dev_addr, const std::vector< uint8_t > &wdata, int nread=0)
 Carry out a write of zero or more bytes followed a by a read of zero or more bytes.
 
- Public Member Functions inherited from pflib::lpgbt::I2C
 I2C (lpGBT &lpGBT, int ibus)
 
virtual void set_bus_speed (int speed=100)
 Set the speed for the bus in kbps.
 
virtual int get_bus_speed ()
 Get the speed for the bus in kbps.
 
- Public Member Functions inherited from pflib::I2C

Private Attributes

uint8_t muxaddr_
 
uint8_t wval_
 

Additional Inherited Members

- Protected Member Functions inherited from pflib::I2C
- Protected Attributes inherited from pflib::I2C
logging::logger the_log_ {logging::get("I2C")}
 

Detailed Description

Synchronous I2C implementation.

Member Function Documentation

◆ general_write_read()

std::vector< uint8_t > pflib::lpgbt::I2CwithMux::general_write_read ( uint8_t i2c_dev_addr,
const std::vector< uint8_t > & wdata,
int nread = 0 )
virtual

Carry out a write of zero or more bytes followed a by a read of zero or more bytes.

If either write or read is zero bytes long, it is omitted.

Exceptions
pflib::Exceptionin the case of I2C communication failure

Reimplemented from pflib::lpgbt::I2C.

◆ read_byte()

uint8_t pflib::lpgbt::I2CwithMux::read_byte ( uint8_t i2c_dev_addr)
virtual

Read a single byte using the efficient interface.

Exceptions
pflib::Exceptionin the case of I2C communication failure

Reimplemented from pflib::lpgbt::I2C.

◆ write_byte()

void pflib::lpgbt::I2CwithMux::write_byte ( uint8_t i2c_dev_addr,
uint8_t data )
virtual

Write a single byte using the efficient interface, and wait for completion.

Exceptions
pflib::Exceptionin the case of I2C communication failure

Reimplemented from pflib::lpgbt::I2C.


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