summaryrefslogtreecommitdiffstats
path: root/include/usrp_uhd
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-21 19:05:30 -0800
committerJosh Blum <josh@joshknows.com>2010-01-21 19:05:30 -0800
commit069a7ce0570001ea3d9512a11d238ea4d6773f1d (patch)
treecf38f9c1745d0054d8775551b1caedf5522f55b2 /include/usrp_uhd
parente3483c7451d20b7ed1d8d4865e15751f18cdef78 (diff)
downloaduhd-069a7ce0570001ea3d9512a11d238ea4d6773f1d.tar.gz
uhd-069a7ce0570001ea3d9512a11d238ea4d6773f1d.tar.bz2
uhd-069a7ce0570001ea3d9512a11d238ea4d6773f1d.zip
Added more to the mboard test and the usrp device.
Diffstat (limited to 'include/usrp_uhd')
-rw-r--r--include/usrp_uhd/device.hpp20
-rw-r--r--include/usrp_uhd/usrp/dboard/interface.hpp28
-rw-r--r--include/usrp_uhd/usrp/mboard/test.hpp4
-rw-r--r--include/usrp_uhd/usrp/usrp.hpp2
4 files changed, 24 insertions, 30 deletions
diff --git a/include/usrp_uhd/device.hpp b/include/usrp_uhd/device.hpp
index ad2d3b368..32d58b21f 100644
--- a/include/usrp_uhd/device.hpp
+++ b/include/usrp_uhd/device.hpp
@@ -26,9 +26,15 @@ public:
typedef boost::shared_ptr<device> sptr;
//argument types for send and recv raw methods
- typedef std::vector<boost::asio::const_buffer> send_args_t;
+ //the send args is an array of buffers
+ //the recv args is a callback that takes a buffer
+ typedef std::vector<boost::asio::const_buffer> send_args_t;
typedef boost::function<bool(const boost::asio::const_buffer &)> recv_args_t;
+ //structors
+ device(void);
+ virtual ~device(void);
+
/*!
* \brief Discover usrp devices attached to the host.
*
@@ -54,16 +60,6 @@ public:
static sptr make(const device_addr_t & hint, size_t which = 0);
/*!
- * Constructor: Called in derived classes.
- */
- device(void);
-
- /*!
- * Deconstructor: called automatically by the shared pointer.
- */
- virtual ~device(void);
-
- /*!
* Get the device address for this board.
*/
device_addr_t get_device_addr(void);
@@ -74,8 +70,6 @@ public:
//connect dsps and subdevs
void connect(const wax::type &src, const wax::type &sink);
-
-private:
};
} //namespace usrp_uhd
diff --git a/include/usrp_uhd/usrp/dboard/interface.hpp b/include/usrp_uhd/usrp/dboard/interface.hpp
index acbfc6d70..7af45f7a2 100644
--- a/include/usrp_uhd/usrp/dboard/interface.hpp
+++ b/include/usrp_uhd/usrp/dboard/interface.hpp
@@ -96,50 +96,44 @@ public:
/*!
* Read daughterboard GPIO pin values
*
- * \param bank GPIO_TX_BANK or GPIO_RX_BANK
+ * \param bank GPIO_TX_BANK or GPIO_RX_BANK
* \return the value of the gpio bank
*/
virtual uint16_t read_gpio(gpio_bank_t bank) = 0;
/*!
* \brief Write to I2C peripheral
- * \param i2c_addr I2C bus address (7-bits)
- * \param buf the data to write
- * Writes are limited to a maximum of of 64 bytes.
+ * \param i2c_addr I2C bus address (7-bits)
+ * \param buf the data to write
*/
- virtual void write_i2c (int i2c_addr, const std::string &buf) = 0;
+ virtual void write_i2c(int i2c_addr, const std::string &buf) = 0;
/*!
* \brief Read from I2C peripheral
- * \param i2c_addr I2C bus address (7-bits)
- * \param len number of bytes to read
+ * \param i2c_addr I2C bus address (7-bits)
+ * \param len number of bytes to read
* \return the data read if successful, else a zero length string.
- * Reads are limited to a maximum of 64 bytes.
*/
- virtual std::string read_i2c (int i2c_addr, size_t len) = 0;
+ virtual std::string read_i2c(int i2c_addr, size_t len) = 0;
/*!
* \brief Write data to SPI bus peripheral.
*
* \param dev which spi device
* \param push args for writing
- * \param buf the data to write
- *
- * Writes are limited to a maximum of 64 bytes.
+ * \param buf the data to write
*/
- virtual void write_spi (spi_dev_t dev, spi_push_t push, const std::string &buf) = 0;
+ virtual void write_spi(spi_dev_t dev, spi_push_t push, const std::string &buf) = 0;
/*!
* \brief Read data from SPI bus peripheral.
*
* \param dev which spi device
* \param push args for reading
- * \param len number of bytes to read. Must be in [0,64].
+ * \param len number of bytes to read
* \return the data read if sucessful, else a zero length string.
- *
- * Reads are limited to a maximum of 64 bytes.
*/
- virtual std::string read_spi (spi_dev_t dev, spi_latch_t latch, size_t len) = 0;
+ virtual std::string read_spi(spi_dev_t dev, spi_latch_t latch, size_t len) = 0;
};
}}} //namespace
diff --git a/include/usrp_uhd/usrp/mboard/test.hpp b/include/usrp_uhd/usrp/mboard/test.hpp
index f3c2899cf..10b46c7fc 100644
--- a/include/usrp_uhd/usrp/mboard/test.hpp
+++ b/include/usrp_uhd/usrp/mboard/test.hpp
@@ -7,6 +7,8 @@
#include <usrp_uhd/usrp/mboard/base.hpp>
#include <usrp_uhd/device_addr.hpp>
+#include <usrp_uhd/usrp/dboard/manager.hpp>
+#include <vector>
namespace usrp_uhd{ namespace usrp{ namespace mboard{
@@ -22,6 +24,8 @@ public:
private:
void get(const wax::type &, wax::type &);
void set(const wax::type &, const wax::type &);
+
+ std::vector<dboard::manager::sptr> _dboard_managers;
};
}}} //namespace
diff --git a/include/usrp_uhd/usrp/usrp.hpp b/include/usrp_uhd/usrp/usrp.hpp
index b280b0d40..7506f798f 100644
--- a/include/usrp_uhd/usrp/usrp.hpp
+++ b/include/usrp_uhd/usrp/usrp.hpp
@@ -30,6 +30,8 @@ private:
void set(const wax::type &, const wax::type &);
std::vector<mboard::base::sptr> _mboards;
+ boost::function<void(const device::send_args_t &)> _send_raw_cb;
+ boost::function<void(const device::recv_args_t &)> _recv_raw_cb;
};
}} //namespace