0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef PI433_H
0018 #define PI433_H
0019
0020 #include <linux/types.h>
0021 #include "rf69_enum.h"
0022
0023
0024
0025 enum option_on_off {
0026 OPTION_OFF,
0027 OPTION_ON
0028 };
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #define PI433_TX_CFG_IOCTL_NR 0
0052 struct pi433_tx_cfg {
0053 __u32 frequency;
0054 __u16 bit_rate;
0055 __u32 dev_frequency;
0056 enum modulation modulation;
0057 enum mod_shaping mod_shaping;
0058
0059 enum pa_ramp pa_ramp;
0060
0061 enum tx_start_condition tx_start_condition;
0062
0063 __u16 repetitions;
0064
0065
0066 enum option_on_off enable_preamble;
0067 enum option_on_off enable_sync;
0068 enum option_on_off enable_length_byte;
0069 enum option_on_off enable_address_byte;
0070 enum option_on_off enable_crc;
0071
0072 __u16 preamble_length;
0073 __u8 sync_length;
0074 __u8 fixed_message_length;
0075
0076 __u8 sync_pattern[8];
0077 __u8 address_byte;
0078 };
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 #define PI433_RX_CFG_IOCTL_NR 1
0100 struct pi433_rx_cfg {
0101 __u32 frequency;
0102 __u16 bit_rate;
0103 __u32 dev_frequency;
0104
0105 enum modulation modulation;
0106
0107 __u8 rssi_threshold;
0108 enum threshold_decrement threshold_decrement;
0109 enum antenna_impedance antenna_impedance;
0110 enum lna_gain lna_gain;
0111 enum mantisse bw_mantisse;
0112 __u8 bw_exponent;
0113 enum dagc dagc;
0114
0115
0116 enum option_on_off enable_sync;
0117
0118
0119 enum option_on_off enable_length_byte;
0120
0121
0122 enum address_filtering enable_address_filtering;
0123
0124
0125 enum option_on_off enable_crc;
0126
0127 __u8 sync_length;
0128 __u8 fixed_message_length;
0129 __u32 bytes_to_drop;
0130
0131 __u8 sync_pattern[8];
0132 __u8 node_address;
0133 __u8 broadcast_address;
0134 };
0135
0136 #define PI433_IOC_MAGIC 'r'
0137
0138 #define PI433_IOC_RD_TX_CFG \
0139 _IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)])
0140 #define PI433_IOC_WR_TX_CFG \
0141 _IOW(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)])
0142
0143 #define PI433_IOC_RD_RX_CFG \
0144 _IOR(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)])
0145 #define PI433_IOC_WR_RX_CFG \
0146 _IOW(PI433_IOC_MAGIC, PI433_RX_CFG_IOCTL_NR, char[sizeof(struct pi433_rx_cfg)])
0147
0148 #endif