SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::i2c_bsp Class Reference

#include <bsp.hpp>

Inheritance diagram for satnogs::comms::i2c_bsp:
satnogs::comms::lib::bsp::i2c

Public Member Functions

 i2c_bsp (const struct device *i2c_dev)
void read (uint16_t addr, uint8_t *rx, size_t rxlen, const uint8_t *tx, size_t txlen)
 Performs an I2C read operation.
void read (uint16_t addr, uint8_t start_addr, uint8_t *rx, size_t len)
 Simplified I2C read operation.
void write (uint16_t addr, const uint8_t *tx, size_t len)
 Performs an I2C write operation.
void write (uint16_t addr, uint8_t start_addr, const uint8_t *tx, size_t len)
 Performs an I2C write operation.
const struct device * dev ()
 Get the I2C device.
Public Member Functions inherited from satnogs::comms::lib::bsp::i2c
 i2c ()
 Construct a new I2C object.
 ~i2c ()

Detailed Description

Definition at line 254 of file bsp.hpp.

Constructor & Destructor Documentation

◆ i2c_bsp()

satnogs::comms::i2c_bsp::i2c_bsp ( const struct device * i2c_dev)

Definition at line 77 of file bsp.cpp.

Member Function Documentation

◆ dev()

const struct device * satnogs::comms::i2c_bsp::dev ( )

Get the I2C device.

This method provides access to the Zephyr I2C device allowing customization

Warning
Use this method at your own risk!
Returns
const struct device* the I@C device

Definition at line 152 of file bsp.cpp.

◆ read() [1/2]

void satnogs::comms::i2c_bsp::read ( uint16_t addr,
uint8_t * rx,
size_t rxlen,
const uint8_t * tx,
size_t txlen )
virtual

Performs an I2C read operation.

Parameters
addraddress of the I2C device
rxthe receive buffer. Should be at least rxlen bytes in size
txthe transmit buffer. Should be at least txlen bytes in size
rxlennumber of bytes to received after the write operation
txlennumber of bytes to transmit from the tx buffer

Implements satnogs::comms::lib::bsp::i2c.

Definition at line 80 of file bsp.cpp.

◆ read() [2/2]

void satnogs::comms::i2c_bsp::read ( uint16_t addr,
uint8_t start_addr,
uint8_t * rx,
size_t len )
virtual

Simplified I2C read operation.

Parameters
addraddress of the I2C device
start_addrthe peripheral internal address to start reading
rxthe receive buffer. Should be at least len bytes in size
lennumber of bytes to receive

Implements satnogs::comms::lib::bsp::i2c.

Definition at line 104 of file bsp.cpp.

◆ write() [1/2]

void satnogs::comms::i2c_bsp::write ( uint16_t addr,
const uint8_t * tx,
size_t len )
virtual

Performs an I2C write operation.

Parameters
addraddress of the I2C device
txthe transmit buffer. Should be at least len bytes in size
lennumber of bytes to be transmitted

Implements satnogs::comms::lib::bsp::i2c.

Definition at line 127 of file bsp.cpp.

◆ write() [2/2]

void satnogs::comms::i2c_bsp::write ( uint16_t addr,
uint8_t start_addr,
const uint8_t * tx,
size_t len )
virtual

Performs an I2C write operation.

Parameters
addraddress of the I2C device
start_addrthe peripheral internal address to start writing
txthe transmit buffer. Should be at least len bytes in size
lennumber of bytes to be transmitted

Implements satnogs::comms::lib::bsp::i2c.

Definition at line 135 of file bsp.cpp.


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