aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/dboard_iface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/dboard_iface.cpp')
-rw-r--r--host/lib/usrp/usrp2/dboard_iface.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp
index f6d2b718a..c79044bce 100644
--- a/host/lib/usrp/usrp2/dboard_iface.cpp
+++ b/host/lib/usrp/usrp2/dboard_iface.cpp
@@ -176,8 +176,8 @@ void usrp2_dboard_iface::set_pin_ctrl(unit_t unit, boost::uint16_t value){
//write the selection mux value to register
switch(unit){
- case UNIT_RX: _iface->poke32(U2_REG_GPIO_RX_SEL, new_sels); return;
- case UNIT_TX: _iface->poke32(U2_REG_GPIO_TX_SEL, new_sels); return;
+ case UNIT_RX: _iface->poke32(_iface->regs.gpio_rx_sel, new_sels); return;
+ case UNIT_TX: _iface->poke32(_iface->regs.gpio_tx_sel, new_sels); return;
}
}
@@ -185,18 +185,18 @@ void usrp2_dboard_iface::set_gpio_ddr(unit_t unit, boost::uint16_t value){
_ddr_shadow = \
(_ddr_shadow & ~(0xffff << unit_to_shift[unit])) |
(boost::uint32_t(value) << unit_to_shift[unit]);
- _iface->poke32(U2_REG_GPIO_DDR, _ddr_shadow);
+ _iface->poke32(_iface->regs.gpio_ddr, _ddr_shadow);
}
void usrp2_dboard_iface::write_gpio(unit_t unit, boost::uint16_t value){
_gpio_shadow = \
(_gpio_shadow & ~(0xffff << unit_to_shift[unit])) |
(boost::uint32_t(value) << unit_to_shift[unit]);
- _iface->poke32(U2_REG_GPIO_IO, _gpio_shadow);
+ _iface->poke32(_iface->regs.gpio_io, _gpio_shadow);
}
boost::uint16_t usrp2_dboard_iface::read_gpio(unit_t unit){
- return boost::uint16_t(_iface->peek32(U2_REG_GPIO_IO) >> unit_to_shift[unit]);
+ return boost::uint16_t(_iface->peek32(_iface->regs.gpio_io) >> unit_to_shift[unit]);
}
void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t value){
@@ -205,16 +205,16 @@ void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t
unit_t, uhd::dict<atr_reg_t, boost::uint32_t>
> unit_to_atr_to_addr = map_list_of
(UNIT_RX, map_list_of
- (ATR_REG_IDLE, U2_REG_ATR_IDLE_RXSIDE)
- (ATR_REG_TX_ONLY, U2_REG_ATR_INTX_RXSIDE)
- (ATR_REG_RX_ONLY, U2_REG_ATR_INRX_RXSIDE)
- (ATR_REG_FULL_DUPLEX, U2_REG_ATR_FULL_RXSIDE)
+ (ATR_REG_IDLE, _iface->regs.atr_idle_rxside)
+ (ATR_REG_TX_ONLY, _iface->regs.atr_intx_rxside)
+ (ATR_REG_RX_ONLY, _iface->regs.atr_inrx_rxside)
+ (ATR_REG_FULL_DUPLEX, _iface->regs.atr_full_rxside)
)
(UNIT_TX, map_list_of
- (ATR_REG_IDLE, U2_REG_ATR_IDLE_TXSIDE)
- (ATR_REG_TX_ONLY, U2_REG_ATR_INTX_TXSIDE)
- (ATR_REG_RX_ONLY, U2_REG_ATR_INRX_TXSIDE)
- (ATR_REG_FULL_DUPLEX, U2_REG_ATR_FULL_TXSIDE)
+ (ATR_REG_IDLE, _iface->regs.atr_idle_txside)
+ (ATR_REG_TX_ONLY, _iface->regs.atr_intx_txside)
+ (ATR_REG_RX_ONLY, _iface->regs.atr_inrx_txside)
+ (ATR_REG_FULL_DUPLEX, _iface->regs.atr_full_txside)
)
;
_iface->poke16(unit_to_atr_to_addr[unit][atr], value);
@@ -234,8 +234,8 @@ void usrp2_dboard_iface::set_gpio_debug(unit_t unit, int which){
//write the selection mux value to register
switch(unit){
- case UNIT_RX: _iface->poke32(U2_REG_GPIO_RX_SEL, new_sels); return;
- case UNIT_TX: _iface->poke32(U2_REG_GPIO_TX_SEL, new_sels); return;
+ case UNIT_RX: _iface->poke32(_iface->regs.gpio_rx_sel, new_sels); return;
+ case UNIT_TX: _iface->poke32(_iface->regs.gpio_tx_sel, new_sels); return;
}
}