Repository navigation
Expand file tree
/
Copy pathtypes.go
More file actions
83 lines (75 loc) · 2.68 KB
/
Copy pathtypes.go
File metadata and controls
83 lines (75 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package hackrf
// #include <libhackrf/hackrf.h>
import "C"
// PartIDSerialNo holds the MCU (LPC43xx) part ID and unique serial number, as
// read by Device.BoardPartIDSerialNoRead (read_partid_serialno_t).
type PartIDSerialNo struct {
PartID [2]uint32
SerialNo [4]uint32
}
// M0State is the state of the SGPIO loop running on the M0 core
// (hackrf_m0_state), as read by Device.M0State.
type M0State struct {
// RequestedMode: 0=IDLE, 1=WAIT, 2=RX, 3=TX_START, 4=TX_RUN.
RequestedMode uint16
// RequestFlag: 0 means the request is completed; non-zero means pending.
RequestFlag uint16
// ActiveMode uses the same values as RequestedMode.
ActiveMode uint32
// M0Count is the number of bytes transferred by the M0.
M0Count uint32
// M4Count is the number of bytes transferred by the M4.
M4Count uint32
// NumShortfalls is the number of shortfalls.
NumShortfalls uint32
// LongestShortfall is the longest shortfall in bytes.
LongestShortfall uint32
// ShortfallLimit is the shortfall limit in bytes.
ShortfallLimit uint32
// Threshold is the M0Count value (bytes) for the next mode change.
Threshold uint32
// NextMode is the mode switched to when Threshold is reached (same values
// as RequestedMode).
NextMode uint32
// Error that caused the M0 to revert to IDLE: 0=NONE, 1=RX_TIMEOUT,
// 2=TX_TIMEOUT, 3=MISSED_DEADLINE.
Error uint32
}
// SelfTest holds the result of Device.ReadSelfTest (hackrf_selftest).
type SelfTest struct {
Pass bool
Msg string
}
// BiasTUserSetting is a single bias-tee default override
// (hackrf_bool_user_settting). If DoUpdate is true, ChangeOnModeEntry and
// Enabled become the new default; otherwise the current default is unchanged.
type BiasTUserSetting struct {
DoUpdate bool
ChangeOnModeEntry bool
Enabled bool
}
// BiasTUserSettingReq configures bias-tee defaults for each RF state
// (hackrf_bias_t_user_settting_req). See Device.SetUserBiasTOpts.
type BiasTUserSettingReq struct {
TX BiasTUserSetting
RX BiasTUserSetting
Off BiasTUserSetting
}
// OperacakeDwellTime is an Opera Cake port setting for time-based operation
// (hackrf_operacake_dwell_time). See Device.SetOperacakeDwellTimes.
type OperacakeDwellTime struct {
// Dwell time for the port, in number of samples.
Dwell uint32
// Port to connect A0 to (B0 mirrors this choice).
Port OperacakePort
}
// OperacakeFreqRange is an Opera Cake port setting for frequency-based
// operation (hackrf_operacake_freq_range). See Device.SetOperacakeFreqRanges.
type OperacakeFreqRange struct {
// FreqMin is the start frequency in MHz.
FreqMin uint16
// FreqMax is the stop frequency in MHz.
FreqMax uint16
// Port (A0) to use for this range; B0 mirrors it.
Port OperacakePort
}