Imported Upstream version 3.2.2
[debian/gnuradio] / usrp2 / host / include / usrp2 / metadata.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008 Free Software Foundation, Inc.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 #ifndef INCLUDED_USRP2_METADATA_H
19 #define INCLUDED_USRP2_METADATA_H
20
21 #include <stdint.h>
22
23 namespace usrp2 {
24
25   //! type of the timestamp returned from the USRP2 FPGA
26   typedef uint32_t      fpga_timestamp;
27
28   /*!
29    * \brief metadata associated with received frames
30    * \ingroup usrp2
31    */
32   struct rx_metadata {
33     uint32_t            word0;                  //< debugging, extensions
34     fpga_timestamp      timestamp;              //< time that first sample of frame was received
35     unsigned int        start_of_burst : 1;     //< this frame is the start of a burst
36     unsigned int        end_of_burst   : 1;     //< this frame is the end of a burst
37     unsigned int        rx_overrun     : 1;     //< An Rx overrun occurred in the FPGA
38     // rssi
39     // agc_mode
40
41     rx_metadata() :
42       word0(0), timestamp(0), start_of_burst(0), end_of_burst(0), rx_overrun(0) {}
43   };
44
45   /*!
46    * \brief metadata associated with transmitted frames
47    * \ingroup usrp2
48    */
49   struct tx_metadata {
50     fpga_timestamp      timestamp;              //< time to transmit first sample of frame
51     unsigned int        send_now       : 1;     //< ignore timestamp, send now
52     unsigned int        start_of_burst : 1;     //< this frame is the start of a burst
53     unsigned int        end_of_burst   : 1;     //< this frame is the end of a burst
54     // ...
55
56     tx_metadata() :
57       timestamp(0), send_now(0), start_of_burst(0), end_of_burst(0) {}
58   };
59
60 }; // usrp2
61
62 #endif /* INCLUDED_USRP2_METADATA_H */