-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlime_beidou.h
63 lines (49 loc) · 1.13 KB
/
lime_beidou.h
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
#ifndef _LIME_BEIDOU_H
#define _LIME_BEIDOU_H
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <lime/LimeSuite.h>
#include "beidou_sim.h"
// 发送频率
#define TX_FREQUENCY 1561098000
//#define TX_SAMPLERATE 2046000
//#define TX_BANDWIDTH 4092000
#define TX_SAMPLERATE 2500000
#define TX_BANDWIDTH 5000000
// I/Q采样数量
#define NUM_IQ_SAMPLES (TX_SAMPLERATE / 10)
#define FIFO_LENGTH (NUM_IQ_SAMPLES * 2)
#define SAMPLES_PER_BUFFER (32 * 1024)
typedef struct {
pthread_t thread;
pthread_mutex_t lock;
//int error;
lms_stream_t stream;
int16_t *buffer;
} tx_t;
typedef struct {
pthread_t thread;
pthread_mutex_t lock;
//int error;
int ready;
pthread_cond_t initialization_done;
} beidou_t;
typedef struct {
tx_t tx;
beidou_t beidou;
int status;
bool finished;
int16_t *fifo;
long head;
long tail;
size_t sample_length;
pthread_cond_t fifo_read_ready;
pthread_cond_t fifo_write_ready;
double time;
} sim_t;
extern void *beidou_task(void *arg);
extern int is_fifo_write_ready(sim_t *s);
#endif