~ubuntu-branches/ubuntu/precise/gnuradio/precise

« back to all changes in this revision

Viewing changes to usrp2/firmware/lib/db.h

  • Committer: Bazaar Package Importer
  • Author(s): Kamal Mostafa
  • Date: 2010-03-13 07:46:01 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100313074601-zjsa893a87bozyh7
Tags: 3.2.2.dfsg-1ubuntu1
* Fix build for Ubuntu lucid (LP: #260406)
  - add binary package dep for libusrp0, libusrp2-0: adduser
  - debian/rules clean: remove pre-built Qt moc files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c++ -*- */
 
2
/*
 
3
 * Copyright 2008,2009 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
 
 
19
/*
 
20
 * Interface to daughterboard code
 
21
 */
 
22
 
 
23
#ifndef INCLUDED_DB_H
 
24
#define INCLUDED_DB_H
 
25
 
 
26
#include <usrp2_types.h>
 
27
 
 
28
 
 
29
struct db_base;
 
30
 
 
31
/* pointers to daughterboard structures */
 
32
extern struct db_base *tx_dboard;
 
33
extern struct db_base *rx_dboard;
 
34
 
 
35
 
 
36
//! Intermediate tuning information
 
37
 
 
38
struct tune_result
 
39
{
 
40
  //! The RF frequency that corresponds to DC in the IF from the daughterboard
 
41
  u2_fxpt_freq_t        baseband_freq;
 
42
 
 
43
  //! The DDC/DUC frequency used to down/up convert to/from the target frequency
 
44
  u2_fxpt_freq_t        dxc_freq;
 
45
 
 
46
  //! Any differerence btwn target and actual (typically < 0.01 Hz)
 
47
  u2_fxpt_freq_t        residual_freq;
 
48
 
 
49
  //! Is the complex baseband spectrum inverted
 
50
  bool                  inverted;
 
51
};
 
52
 
 
53
 
 
54
/*!
 
55
 * \brief One-time init at powerup
 
56
 *
 
57
 *  Sets rx_dboard, tx_dboard and initializes daughterboards.
 
58
 */
 
59
void 
 
60
db_init(void);
 
61
 
 
62
/*!
 
63
 * \brief Set daughterboard LO offset frequency.
 
64
 *
 
65
 * \param[in] db is the daughterboard instance
 
66
 * \param[in] offset is the amount to add to tuning requests
 
67
 * \param[out] success or failure
 
68
 */
 
69
bool
 
70
db_set_lo_offset(struct db_base *db, u2_fxpt_freq_t offset);
 
71
 
 
72
/*!
 
73
 * \brief Two stage tuning.  Given target_freq, tune LO and DDC/DUC
 
74
 *
 
75
 * \param[in] db is the daughterboard instance
 
76
 * \param[in] target_freq is the freq to translate the complex baseband to/from.
 
77
 * \param[out] result provides details of the resulting configuration.
 
78
 * 
 
79
 */
 
80
bool
 
81
db_tune(struct db_base *db, u2_fxpt_freq_t target_freq, struct tune_result *result);
 
82
 
 
83
 
 
84
/*
 
85
 * Set only the DDC frequency
 
86
 */
 
87
bool
 
88
db_set_ddc_freq(u2_fxpt_freq_t dxc_freq, u2_fxpt_freq_t *actual_dxc_freq);
 
89
 
 
90
/*
 
91
 * Set only the DUC frequency
 
92
 */
 
93
bool
 
94
db_set_duc_freq(u2_fxpt_freq_t dxc_freq, u2_fxpt_freq_t *actual_dxc_freq);
 
95
 
 
96
 
 
97
/*!
 
98
 * \brief Set gain
 
99
 */
 
100
bool
 
101
db_set_gain(struct db_base *db, u2_fxpt_gain_t gain);
 
102
 
 
103
 
 
104
#endif /* INCLUDED_DB_H */