1
|
---------------------------------------------------------------------------------------------------
|
2
|
-- Filename : usbrx.vhd
|
3
|
-- Project : OsmoSDR FPGA Firmware
|
4
|
-- Purpose : OsmoSDR package
|
5
|
---------------------------------------------------------------------------------------------------
|
6
|
|
7
|
-----------------------------------------------------------------------------------
|
8
|
-- Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany --
|
9
|
-- written by Matthias Kleffel --
|
10
|
-- --
|
11
|
-- This program is free software; you can redistribute it and/or modify --
|
12
|
-- it under the terms of the GNU General Public License as published by --
|
13
|
-- the Free Software Foundation as version 3 of the License, or --
|
14
|
-- --
|
15
|
-- This program is distributed in the hope that it will be useful, --
|
16
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
|
17
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
|
18
|
-- GNU General Public License V3 for more details. --
|
19
|
-- --
|
20
|
-- You should have received a copy of the GNU General Public License --
|
21
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>. --
|
22
|
-----------------------------------------------------------------------------------
|
23
|
|
24
|
library ieee;
|
25
|
use ieee.std_logic_1164.all;
|
26
|
use ieee.numeric_std.all;
|
27
|
|
28
|
package usbrx is
|
29
|
|
30
|
-- PWM config
|
31
|
type usbrx_pwm_config_t is record
|
32
|
freq0 : unsigned(15 downto 0);
|
33
|
freq1 : unsigned(15 downto 0);
|
34
|
duty0 : unsigned(15 downto 0);
|
35
|
duty1 : unsigned(15 downto 0);
|
36
|
end record;
|
37
|
|
38
|
-- ADC interface config
|
39
|
type usbrx_adc_config_t is record
|
40
|
clkdiv : unsigned(7 downto 0);
|
41
|
acqlen : unsigned(7 downto 0);
|
42
|
end record;
|
43
|
|
44
|
-- SSC interface config
|
45
|
type usbrx_ssc_config_t is record
|
46
|
clkdiv : unsigned(7 downto 0);
|
47
|
tmode : std_logic;
|
48
|
end record;
|
49
|
|
50
|
-- offset stage config
|
51
|
type usbrx_off_config_t is record
|
52
|
swap : std_logic;
|
53
|
ioff : signed(15 downto 0);
|
54
|
qoff : signed(15 downto 0);
|
55
|
igain : unsigned(15 downto 0);
|
56
|
qgain : unsigned(15 downto 0);
|
57
|
end record;
|
58
|
|
59
|
-- decimation filter config
|
60
|
type usbrx_fil_config_t is record
|
61
|
decim : unsigned(2 downto 0);
|
62
|
end record;
|
63
|
|
64
|
-- clock reference status
|
65
|
type usbrx_ref_status_t is record
|
66
|
lsb : unsigned(24 downto 0);
|
67
|
msb : unsigned(6 downto 0);
|
68
|
end record;
|
69
|
|
70
|
-- GPIO config
|
71
|
type usbrx_gpio_config_t is record
|
72
|
oena : std_logic_vector(10 downto 0);
|
73
|
odata : std_logic_vector(10 downto 0);
|
74
|
end record;
|
75
|
|
76
|
-- clock reference status
|
77
|
type usbrx_gpio_status_t is record
|
78
|
idata : std_logic_vector(10 downto 0);
|
79
|
end record;
|
80
|
|
81
|
end usbrx;
|
82
|
|
83
|
package body usbrx is
|
84
|
-- nothing so far
|
85
|
end usbrx;
|
86
|
|