Class which encapsulates the I2C controller in the Polarfire.
More...
#include <I2C.h>
|
| I2C (WishboneInterface *wb, int target=tgt_I2C) |
|
void | set_active_bus (int ibus) |
| Pick the active bus Set the value -1 to determ.
|
|
int | get_active_bus () |
| Get the currently active bus.
|
|
int | get_bus_count () |
| Get the number of available busses.
|
|
void | set_bus_speed (int speed=100) |
| Set the speed for the bus in kbps.
|
|
int | get_bus_speed () |
| Get the speed for the bus in kbps.
|
|
void | write_byte (uint8_t i2c_dev_addr, uint8_t data) |
| Write a single byte using the efficient interface, and wait for completion. More...
|
|
uint8_t | read_byte (uint8_t i2c_dev_addr) |
| Read a single byte using the efficient interface. More...
|
|
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. More...
|
|
void | backplane_hack (bool enable) |
| Turn on/off the horrible hack for the V1 backplane.
|
|
| WishboneTarget (WishboneInterface *wb, int target) |
| simply store pointer to interface and target we will interact with
|
|
int | target_type () |
| Get the Wishbone target type/flavor by number.
|
|
std::string | target_type_str () |
| Get the Wishbone target type/flavor by name if known.
|
|
int | firmware_version () |
| Get the subblock firmware version.
|
|
|
bool | i2c_wait (bool nack_ok=false) |
| utility for software-mode I2C
|
|
|
int | usec_per_byte_ |
| microseconds per byte
|
|
|
void | wb_write (uint32_t addr, uint32_t data) |
| Write data to an address on the target stored within us. More...
|
|
uint32_t | wb_read (uint32_t addr) |
| Read data from address on the target stored within us. More...
|
|
void | wb_rmw (uint32_t addr, uint32_t data, uint32_t mask) |
| Read the word at the address and then put our data bits into that address using the provided mask. More...
|
|
WishboneInterface * | wb_ |
| Handle to the interface.
|
|
int | target_ |
| Target id.
|
|
Class which encapsulates the I2C controller in the Polarfire.
◆ general_write_read()
std::vector< uint8_t > pflib::I2C::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.
If either write or read is zero bytes long, it is omitted. Currently implemented using software (slow), while waiting for better support in the firmware.
- Exceptions
-
◆ read_byte()
uint8_t pflib::I2C::read_byte |
( |
uint8_t |
i2c_dev_addr | ) |
|
Read a single byte using the efficient interface.
- Exceptions
-
◆ write_byte()
void pflib::I2C::write_byte |
( |
uint8_t |
i2c_dev_addr, |
|
|
uint8_t |
data |
|
) |
| |
Write a single byte using the efficient interface, and wait for completion.
- Exceptions
-
The documentation for this class was generated from the following files:
- include/pflib/I2C.h
- src/pflib/I2C.cxx