aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
index e0544862d..9cd3afc6c 100644
--- a/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_fifo_ctrl.cpp
@@ -33,7 +33,7 @@ static const size_t POKE32_CMD = (1 << 8);
static const size_t PEEK32_CMD = 0;
static const double ACK_TIMEOUT = 0.5;
static const double MASSIVE_TIMEOUT = 10.0; //for when we wait on a timed command
-static const boost::uint32_t MAX_SEQS_OUT = 63;
+static const uint32_t MAX_SEQS_OUT = 63;
#define SPI_DIV SR_SPI_CORE + 0
#define SPI_CTRL SR_SPI_CORE + 1
@@ -67,7 +67,7 @@ public:
/*******************************************************************
* Peek and poke 32 bit implementation
******************************************************************/
- void poke32(const wb_addr_type addr, const boost::uint32_t data){
+ void poke32(const wb_addr_type addr, const uint32_t data){
boost::mutex::scoped_lock lock(_mutex);
this->send_pkt((addr - SETTING_REGS_BASE)/4, data, POKE32_CMD);
@@ -75,7 +75,7 @@ public:
this->wait_for_ack(_seq_out-MAX_SEQS_OUT);
}
- boost::uint32_t peek32(const wb_addr_type addr){
+ uint32_t peek32(const wb_addr_type addr){
boost::mutex::scoped_lock lock(_mutex);
this->send_pkt((addr - READBACK_BASE)/4, 0, PEEK32_CMD);
@@ -86,11 +86,11 @@ public:
/*******************************************************************
* Peek and poke 16 bit not implemented
******************************************************************/
- void poke16(const wb_addr_type, const boost::uint16_t){
+ void poke16(const wb_addr_type, const uint16_t){
throw uhd::not_implemented_error("poke16 not implemented in fifo ctrl module");
}
- boost::uint16_t peek16(const wb_addr_type){
+ uint16_t peek16(const wb_addr_type){
throw uhd::not_implemented_error("peek16 not implemented in fifo ctrl module");
}
@@ -106,24 +106,24 @@ public:
_ctrl_word_cache = 0; // force update first time around
}
- boost::uint32_t transact_spi(
+ uint32_t transact_spi(
int which_slave,
const spi_config_t &config,
- boost::uint32_t data,
+ uint32_t data,
size_t num_bits,
bool readback
){
boost::mutex::scoped_lock lock(_mutex);
//load control word
- boost::uint32_t ctrl_word = 0;
+ uint32_t ctrl_word = 0;
ctrl_word |= ((which_slave & 0xffffff) << 0);
ctrl_word |= ((num_bits & 0x3ff) << 24);
if (config.mosi_edge == spi_config_t::EDGE_FALL) ctrl_word |= (1 << 31);
if (config.miso_edge == spi_config_t::EDGE_RISE) ctrl_word |= (1 << 30);
//load data word (must be in upper bits)
- const boost::uint32_t data_out = data << (32 - num_bits);
+ const uint32_t data_out = data << (32 - num_bits);
//conditionally send control word
if (_ctrl_word_cache != ctrl_word){
@@ -171,20 +171,20 @@ private:
/*******************************************************************
* Primary control and interaction private methods
******************************************************************/
- UHD_INLINE void send_pkt(wb_addr_type addr, boost::uint32_t data, int cmd){
+ UHD_INLINE void send_pkt(wb_addr_type addr, uint32_t data, int cmd){
managed_send_buffer::sptr buff = _xport->get_send_buff(0.0);
if (not buff){
throw uhd::runtime_error("fifo ctrl timed out getting a send buffer");
}
- boost::uint32_t *trans = buff->cast<boost::uint32_t *>();
+ uint32_t *trans = buff->cast<uint32_t *>();
trans[0] = htonl(++_seq_out);
- boost::uint32_t *pkt = trans + 1;
+ uint32_t *pkt = trans + 1;
//load packet info
vrt::if_packet_info_t packet_info;
packet_info.packet_type = vrt::if_packet_info_t::PACKET_TYPE_CONTEXT;
packet_info.num_payload_words32 = 2;
- packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(boost::uint32_t);
+ packet_info.num_payload_bytes = packet_info.num_payload_words32*sizeof(uint32_t);
packet_info.packet_count = _seq_out;
packet_info.tsf = _time.to_ticks(_tick_rate);
packet_info.sob = false;
@@ -199,30 +199,30 @@ private:
vrt::if_hdr_pack_be(pkt, packet_info);
//load payload
- const boost::uint32_t ctrl_word = (addr & 0xff) | cmd | (_seq_out << 16);
+ const uint32_t ctrl_word = (addr & 0xff) | cmd | (_seq_out << 16);
pkt[packet_info.num_header_words32+0] = htonl(ctrl_word);
pkt[packet_info.num_header_words32+1] = htonl(data);
//send the buffer over the interface
- buff->commit(sizeof(boost::uint32_t)*(packet_info.num_packet_words32+1));
+ buff->commit(sizeof(uint32_t)*(packet_info.num_packet_words32+1));
}
- UHD_INLINE bool wraparound_lt16(const boost::int16_t i0, const boost::int16_t i1){
+ UHD_INLINE bool wraparound_lt16(const int16_t i0, const int16_t i1){
if (((i0 ^ i1) & 0x8000) == 0) //same sign bits
- return boost::uint16_t(i0) < boost::uint16_t(i1);
- return boost::int16_t(i1 - i0) > 0;
+ return uint16_t(i0) < uint16_t(i1);
+ return int16_t(i1 - i0) > 0;
}
- UHD_INLINE boost::uint32_t wait_for_ack(const boost::uint16_t seq_to_ack){
+ UHD_INLINE uint32_t wait_for_ack(const uint16_t seq_to_ack){
while (wraparound_lt16(_seq_ack, seq_to_ack)){
managed_recv_buffer::sptr buff = _xport->get_recv_buff(_timeout);
if (not buff){
throw uhd::runtime_error("fifo ctrl timed out looking for acks");
}
- const boost::uint32_t *pkt = buff->cast<const boost::uint32_t *>();
+ const uint32_t *pkt = buff->cast<const uint32_t *>();
vrt::if_packet_info_t packet_info;
- packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t);
+ packet_info.num_packet_words32 = buff->size()/sizeof(uint32_t);
vrt::if_hdr_unpack_be(pkt, packet_info);
_seq_ack = ntohl(pkt[packet_info.num_header_words32+0]) >> 16;
if (_seq_ack == seq_to_ack){
@@ -235,13 +235,13 @@ private:
zero_copy_if::sptr _xport;
boost::mutex _mutex;
- boost::uint16_t _seq_out;
- boost::uint16_t _seq_ack;
+ uint16_t _seq_out;
+ uint16_t _seq_ack;
uhd::time_spec_t _time;
bool _use_time;
double _tick_rate;
double _timeout;
- boost::uint32_t _ctrl_word_cache;
+ uint32_t _ctrl_word_cache;
};