diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-24 16:31:23 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-24 16:31:23 -0700 |
commit | 39943a5b0c3c210babfd6e62711ea4bf3133866b (patch) | |
tree | 1380a4d28f55742c7e654bc585988ee45afec2c8 /host/include | |
parent | 71169b8e030d984220eadde83c4b40481f97cf6b (diff) | |
download | uhd-39943a5b0c3c210babfd6e62711ea4bf3133866b.tar.gz uhd-39943a5b0c3c210babfd6e62711ea4bf3133866b.tar.bz2 uhd-39943a5b0c3c210babfd6e62711ea4bf3133866b.zip |
Added support to set GPIO pins from dboard interface:
write gpio and set pin control (atr or gpio)
Added property to get dboard interface from the dboard obj.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/dboard_iface.hpp | 22 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_props.hpp | 3 |
2 files changed, 22 insertions, 3 deletions
diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp index 1214a1a2f..7ecfcd3c0 100644 --- a/host/include/uhd/usrp/dboard_iface.hpp +++ b/host/include/uhd/usrp/dboard_iface.hpp @@ -68,19 +68,29 @@ public: virtual float read_aux_adc(unit_t unit, int which_adc) = 0; /*! + * Set a daughterboard output pin control source. + * By default, the outputs are all GPIO controlled. + * + * \param unit which unit rx or tx + * \param value 16-bits, 0=GPIO controlled, 1=ATR controlled + */ + virtual void set_pin_ctrl(unit_t unit, boost::uint16_t value) = 0; + + /*! * Set a daughterboard ATR register. * * \param unit which unit rx or tx * \param reg which ATR register to set - * \param value 16-bits, 0=FPGA output low, 1=FPGA output high + * \param value 16-bits, 0=ATR output low, 1=ATR output high */ virtual void set_atr_reg(unit_t unit, atr_reg_t reg, boost::uint16_t value) = 0; /*! * Set daughterboard GPIO data direction register. + * By default, the GPIO pins are all inputs. * * \param unit which unit rx or tx - * \param value 16-bits, 0=FPGA input, 1=FPGA output + * \param value 16-bits, 0=GPIO input, 1=GPIO output */ virtual void set_gpio_ddr(unit_t unit, boost::uint16_t value) = 0; @@ -88,6 +98,14 @@ public: * Read daughterboard GPIO pin values. * * \param unit which unit rx or tx + * \param value 16-bits, 0=GPIO output low, 1=GPIO output high + */ + virtual void write_gpio(unit_t unit, boost::uint16_t value) = 0; + + /*! + * Read daughterboard GPIO pin values. + * + * \param unit which unit rx or tx * \return the value of the gpio unit */ virtual boost::uint16_t read_gpio(unit_t unit) = 0; diff --git a/host/include/uhd/usrp/dboard_props.hpp b/host/include/uhd/usrp/dboard_props.hpp index 0208a6c2c..4d5c5efbd 100644 --- a/host/include/uhd/usrp/dboard_props.hpp +++ b/host/include/uhd/usrp/dboard_props.hpp @@ -30,7 +30,8 @@ namespace uhd{ namespace usrp{ DBOARD_PROP_SUBDEV = 's', //ro, wax::obj DBOARD_PROP_SUBDEV_NAMES = 'S', //ro, prop_names_t DBOARD_PROP_USED_SUBDEVS = 'u', //ro, prop_names_t - DBOARD_PROP_DBOARD_ID = 'i' //rw, dboard_id_t + DBOARD_PROP_DBOARD_ID = 'i', //rw, dboard_id_t + DBOARD_PROP_DBOARD_IFACE = 'f' //ro, dboard_iface::sptr //DBOARD_PROP_CODEC //ro, wax::obj //----> not sure, dont have to deal with yet }; |