I2C device abstraction.
More...
#include <i2c.hpp>
|
| | i2c () |
| | Construct a new I2C object.
|
| | ~i2c () |
| virtual void | read (uint16_t addr, uint8_t *rx, size_t rxlen, const uint8_t *tx, size_t txlen)=0 |
| | Performs an I2C read operation.
|
| virtual void | read (uint16_t addr, uint8_t start_addr, uint8_t *rx, size_t len)=0 |
| | Simplified I2C read operation.
|
| virtual void | write (uint16_t addr, const uint8_t *tx, size_t len)=0 |
| | Performs an I2C write operation.
|
| virtual void | write (uint16_t addr, uint8_t start_addr, const uint8_t *tx, size_t len)=0 |
| | Performs an I2C write operation.
|
I2C device abstraction.
This class provides a generic I2C communication abstraction.
- Warning
- Depending on the target platform/RTOS users are expected to define a class that inherits this one and implement at least the pure virtual methods
Definition at line 39 of file i2c.hpp.
◆ i2c()
| satnogs::comms::lib::bsp::i2c::i2c |
( |
| ) |
|
|
inline |
Construct a new I2C object.
Definition at line 45 of file i2c.hpp.
◆ ~i2c()
| satnogs::comms::lib::bsp::i2c::~i2c |
( |
| ) |
|
|
inline |
◆ read() [1/2]
| virtual void satnogs::comms::lib::bsp::i2c::read |
( |
uint16_t | addr, |
|
|
uint8_t * | rx, |
|
|
size_t | rxlen, |
|
|
const uint8_t * | tx, |
|
|
size_t | txlen ) |
|
pure virtual |
Performs an I2C read operation.
- Parameters
-
| addr | address of the I2C device |
| rx | the receive buffer. Should be at least rxlen bytes in size |
| tx | the transmit buffer. Should be at least txlen bytes in size |
| rxlen | number of bytes to received after the write operation |
| txlen | number of bytes to transmit from the tx buffer |
Implemented in satnogs::comms::i2c_bsp.
◆ read() [2/2]
| virtual void satnogs::comms::lib::bsp::i2c::read |
( |
uint16_t | addr, |
|
|
uint8_t | start_addr, |
|
|
uint8_t * | rx, |
|
|
size_t | len ) |
|
pure virtual |
Simplified I2C read operation.
- Parameters
-
| addr | address of the I2C device |
| start_addr | the peripheral internal address to start reading |
| rx | the receive buffer. Should be at least len bytes in size |
| len | number of bytes to receive |
Implemented in satnogs::comms::i2c_bsp.
◆ write() [1/2]
| virtual void satnogs::comms::lib::bsp::i2c::write |
( |
uint16_t | addr, |
|
|
const uint8_t * | tx, |
|
|
size_t | len ) |
|
pure virtual |
Performs an I2C write operation.
- Parameters
-
| addr | address of the I2C device |
| tx | the transmit buffer. Should be at least len bytes in size |
| len | number of bytes to be transmitted |
Implemented in satnogs::comms::i2c_bsp.
◆ write() [2/2]
| virtual void satnogs::comms::lib::bsp::i2c::write |
( |
uint16_t | addr, |
|
|
uint8_t | start_addr, |
|
|
const uint8_t * | tx, |
|
|
size_t | len ) |
|
pure virtual |
Performs an I2C write operation.
- Parameters
-
| addr | address of the I2C device |
| start_addr | the peripheral internal address to start writing |
| tx | the transmit buffer. Should be at least len bytes in size |
| len | number of bytes to be transmitted |
Implemented in satnogs::comms::i2c_bsp.
The documentation for this class was generated from the following file:
- libsatnogs-comms/include/satnogs-comms-lib/bsp/i2c.hpp