Root/tools/atrf-path/sweep.h

Source at commit 805db6ebf5d80692158acadf88e239da9d3e67af created 6 years 3 months ago.
By Stefan Schmidt, fw/atusb: add extra steps needed for HULUSB in README
1/*
2 * atrf-path/sweep.h - Measure path characteristics
3 *
4 * Written 2011 by Werner Almesberger
5 * Copyright 2011 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef SWEEP_H
15#define SWEEP_H
16
17#include <stdint.h>
18
19#include "atrf.h"
20
21
22#define N_CHAN 16
23
24#define MIN_DIFF -97.0 /* RSSI(min)-TX(max) = -94 - 3 */
25#define MAX_DIFF 7.0 /* RSSI(max)-TX(min) = -10 - (-17) */
26
27
28struct sweep {
29    struct atrf_dsc *tx;
30    struct atrf_dsc *rx;
31    int trim_tx;
32    int trim_rx;
33    int power;
34    uint8_t cont_tx;
35    int samples;
36    double min[N_CHAN];
37    double max[N_CHAN];
38};
39
40struct sample {
41    double avg;
42    double min, max;
43};
44
45
46/*
47 * do_sweep returns whether the signal is within the limits:
48 *
49 * 1: at least one sample is above the maximum
50 * 0: all samples are between minimum and maximum
51 * -1: at least one sample below the minimum, and none above the maximum
52 */
53
54int do_sweep(const struct sweep *sweep, struct sample *res);
55
56void print_sweep(const struct sweep *sweep, const struct sample *res);
57
58#endif /* !SWEEP_H */
59

Archive Download this file



interactive