SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
devicebladerf1values.cpp
Go to the documentation of this file.
1 // Copyright (C) 2016-2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #include "../bladerf1/devicebladerf1values.h"
19 
20 
22 unsigned int DeviceBladeRF1Bandwidths::m_halfbw[] = {
23  750,
24  875,
25  1250,
26  1375,
27  1500,
28  1920,
29  2500,
30  2750,
31  3000,
32  3500,
33  4375,
34  5000,
35  6000,
36  7000,
37  10000,
38  14000};
39 
40 unsigned int DeviceBladeRF1Bandwidths::getBandwidth(unsigned int bandwidth_index)
41 {
42  if (bandwidth_index < m_nb_halfbw)
43  {
44  return m_halfbw[bandwidth_index] * 2;
45  }
46  else
47  {
48  return m_halfbw[0] * 2;
49  }
50 }
51 
52 unsigned int DeviceBladeRF1Bandwidths::getBandwidthIndex(unsigned int bandwidth)
53 {
54  for (unsigned int i=0; i < m_nb_halfbw; i++)
55  {
56  if (bandwidth/2000 == m_halfbw[i])
57  {
58  return i;
59  }
60  }
61 
62  return 0;
63 }
64 
66 {
68 }
69 
70 
71 
static unsigned int m_halfbw[]
static unsigned int getBandwidthIndex(unsigned int bandwidth)
static unsigned int m_nb_halfbw
int32_t i
Definition: decimators.h:244
static unsigned int getBandwidth(unsigned int bandwidth_index)
static unsigned int getNbBandwidths()