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

Synchronous I2C implementation. More...

#include <I2C.h>

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

Public Member Functions

 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.
 
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::I2C

Private Attributes

lpGBTlpgbt_
 
int ibus_
 
int ispeed_
 

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::I2C::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

Implements pflib::I2C.

Reimplemented in pflib::lpgbt::I2CwithMux.

◆ get_bus_speed()

int pflib::lpgbt::I2C::get_bus_speed ( )
virtual

Get the speed for the bus in kbps.

Implements pflib::I2C.

◆ read_byte()

uint8_t pflib::lpgbt::I2C::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

Implements pflib::I2C.

Reimplemented in pflib::lpgbt::I2CwithMux.

◆ set_bus_speed()

void pflib::lpgbt::I2C::set_bus_speed ( int speed = 100)
virtual

Set the speed for the bus in kbps.

Implements pflib::I2C.

◆ write_byte()

void pflib::lpgbt::I2C::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

Implements pflib::I2C.

Reimplemented in pflib::lpgbt::I2CwithMux.


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