From 9065043544dd129e16d7bb30ae8cb8d5562c3326 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 17 May 2011 15:12:02 -0700 Subject: usrp2: moved register map into #defines, entries for new dsp frontend also fixes irq rb --- host/lib/usrp/usrp2/dboard_iface.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'host/lib/usrp/usrp2/dboard_iface.cpp') diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp index 924a6e901..4ce49b409 100644 --- a/host/lib/usrp/usrp2/dboard_iface.cpp +++ b/host/lib/usrp/usrp2/dboard_iface.cpp @@ -180,8 +180,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(_iface->regs.gpio_rx_sel, new_sels); return; - case UNIT_TX: _iface->poke32(_iface->regs.gpio_tx_sel, new_sels); return; + 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; } } @@ -189,18 +189,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(_iface->regs.gpio_ddr, _ddr_shadow); + _iface->poke32(U2_REG_GPIO_DDR, _ddr_shadow); } void usrp2_dboard_iface::_set_gpio_out(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(_iface->regs.gpio_io, _gpio_shadow); + _iface->poke32(U2_REG_GPIO_IO, _gpio_shadow); } boost::uint16_t usrp2_dboard_iface::read_gpio(unit_t unit){ - return boost::uint16_t(_iface->peek32(_iface->regs.gpio_io) >> unit_to_shift[unit]); + return boost::uint16_t(_iface->peek32(U2_REG_GPIO_IO) >> unit_to_shift[unit]); } void usrp2_dboard_iface::_set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t value){ @@ -209,16 +209,16 @@ void usrp2_dboard_iface::_set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_ unit_t, uhd::dict > unit_to_atr_to_addr = map_list_of (UNIT_RX, map_list_of - (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) + (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) ) (UNIT_TX, map_list_of - (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) + (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) ) ; _iface->poke16(unit_to_atr_to_addr[unit][atr], value); @@ -238,8 +238,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(_iface->regs.gpio_rx_sel, new_sels); return; - case UNIT_TX: _iface->poke32(_iface->regs.gpio_tx_sel, new_sels); return; + 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; } } -- cgit v1.2.3