-
Notifications
You must be signed in to change notification settings - Fork 12
/
sx127x.h
66 lines (57 loc) · 1.32 KB
/
sx127x.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
64
65
66
#ifndef SX127X_H_
#define SX127X_H_
#include <linux/types.h>
enum sx127x_ioctl_cmd {
SX127X_IOCTL_CMD_GETMODULATION,
SX127X_IOCTL_CMD_SETMODULATION,
SX127X_IOCTL_CMD_GETCARRIERFREQUENCY,
SX127X_IOCTL_CMD_SETCARRIERFREQUENCY,
SX127X_IOCTL_CMD_GETSF,
SX127X_IOCTL_CMD_SETSF,
SX127X_IOCTL_CMD_GETOPMODE,
SX127X_IOCTL_CMD_SETOPMODE,
SX127X_IOCTL_CMD_GETPAOUTPUT,
SX127X_IOCTL_CMD_SETPAOUTPUT,
SX127X_IOCTL_CMD_GETOUTPUTPOWER,
SX127X_IOCTL_CMD_SETOUTPUTPOWER,
SX127X_IOCTL_CMD_GETBANDWIDTH,
SX127X_IOCTL_CMD_SETBANDWIDTH,
SX127X_IOCTL_CMD_GETSYNCWORD,
SX127X_IOCTL_CMD_SETSYNCWORD,
SX127X_IOCTL_CMD_GETCRC,
SX127X_IOCTL_CMD_SETCRC,
SX127X_IOCTL_CMD_GETINVERTIQ,
SX127X_IOCTL_CMD_SETINVERTIQ,
};
enum sx127x_modulation {
SX127X_MODULATION_FSK,
SX127X_MODULATION_OOK,
SX127X_MODULATION_LORA,
SX127X_MODULATION_INVALID
};
/* the last 3 modes are only valid in lora mode */
enum sx127x_opmode {
SX127X_OPMODE_SLEEP,
SX127X_OPMODE_STANDBY,
SX127X_OPMODE_FSTX,
SX127X_OPMODE_TX,
SX127X_OPMODE_FSRX,
SX127X_OPMODE_RX,
SX127X_OPMODE_RXCONTINUOS,
SX127X_OPMODE_RXSINGLE,
SX127X_OPMODE_CAD
};
enum sx127x_pa {
SX127X_PA_RFO,
SX127X_PA_PABOOST
};
struct sx127x_pkt {
size_t len;
size_t hdrlen;
size_t payloadlen;
__s16 snr;
__s16 rssi;
__u32 fei;
__u8 crcfail;
} __attribute__ ((packed));
#endif /* SX127X_H_ */