-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.h
46 lines (39 loc) · 1 KB
/
main.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
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
#include <string.h>
#include <math.h>
#include "rtl-sdr.h"
#define BUF_LENGTH 32768
#define SAMPLE_RATE 300000 // 300ksps
struct fm_state {
int now_r, now_j;
int pre_r, pre_j;
int prev_index;
int downsample;
int output_scale;
uint8_t buf[BUF_LENGTH];
uint32_t buf_len;
int signal[BUF_LENGTH]; // 16bit I/Q pairs
uint32_t signal_len;
uint32_t phase_acc;
int32_t dir_current;
uint32_t counter;
uint32_t sr_data;
uint32_t sync_status;
uint32_t bit_counter;
uint32_t timeout;
};
int sdr_init(void);
int tune_to(uint32_t frequency);
void tweet(const char *text);
void send_dm(const char *text);
void multiply(int ar, int aj, int br, int bj, int *cr, int *cj);
int rot_direction(int ar, int aj, int br, int bj);
void full_demod(struct fm_state *fm);
int init_LEDs(FILE ** f_green_led, FILE ** f_red_led);
void set_LED(FILE * f_led, int state);
extern rtlsdr_dev_t * dev;
extern uint32_t scan_index;
extern char txt_buffer[128];