]> Git Repo - linux.git/blob - drivers/staging/pi433/rf69.h
mfd: cros-ec: Increase maximum mkbp event size
[linux.git] / drivers / staging / pi433 / rf69.h
1 /*
2  * hardware abstraction/register access for HopeRf rf69 radio module
3  *
4  * Copyright (C) 2016 Wolf-Entwicklungen
5  *      Marcus Wolf <[email protected]>
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  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  */
17 #ifndef RF69_H
18 #define RF69_H
19
20 #include "rf69_enum.h"
21 #include "rf69_registers.h"
22
23 #define F_OSC           32000000  /* in Hz */
24 #define FREQUENCY       433920000 /* in Hz, modifying this value impacts CE certification */
25 #define FIFO_SIZE       66              /* in byte */
26 #define FIFO_THRESHOLD  15              /* in byte */
27
28 int rf69_set_mode(struct spi_device *spi, enum mode mode);
29 int rf69_set_data_mode(struct spi_device *spi, u8 data_mode);
30 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
31 int rf69_set_modulation_shaping(struct spi_device *spi,
32                                 enum mod_shaping mod_shaping);
33 int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate);
34 int rf69_set_deviation(struct spi_device *spi, u32 deviation);
35 int rf69_set_frequency(struct spi_device *spi, u32 frequency);
36 int rf69_enable_amplifier(struct spi_device *spi, u8 amplifier_mask);
37 int rf69_disable_amplifier(struct spi_device *spi, u8 amplifier_mask);
38 int rf69_set_output_power_level(struct spi_device *spi, u8 power_level);
39 int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp pa_ramp);
40 int rf69_set_antenna_impedance(struct spi_device *spi,
41                                enum antenna_impedance antenna_impedance);
42 int rf69_set_lna_gain(struct spi_device *spi, enum lna_gain lna_gain);
43 int rf69_set_bandwidth(struct spi_device *spi, enum mantisse mantisse,
44                        u8 exponent);
45 int rf69_set_bandwidth_during_afc(struct spi_device *spi,
46                                   enum mantisse mantisse,
47                                   u8 exponent);
48 int rf69_set_ook_threshold_dec(struct spi_device *spi,
49                                enum threshold_decrement threshold_decrement);
50 int rf69_set_dio_mapping(struct spi_device *spi, u8 dio_number, u8 value);
51 bool rf69_get_flag(struct spi_device *spi, enum flag flag);
52 int rf69_set_rssi_threshold(struct spi_device *spi, u8 threshold);
53 int rf69_set_preamble_length(struct spi_device *spi, u16 preamble_length);
54 int rf69_enable_sync(struct spi_device *spi);
55 int rf69_disable_sync(struct spi_device *spi);
56 int rf69_set_fifo_fill_condition(struct spi_device *spi,
57                                  enum fifo_fill_condition fifo_fill_condition);
58 int rf69_set_sync_size(struct spi_device *spi, u8 sync_size);
59 int rf69_set_sync_values(struct spi_device *spi, u8 sync_values[8]);
60 int rf69_set_packet_format(struct spi_device *spi,
61                            enum packet_format packet_format);
62 int rf69_enable_crc(struct spi_device *spi);
63 int rf69_disable_crc(struct spi_device *spi);
64 int rf69_set_address_filtering(struct spi_device *spi,
65                                enum address_filtering address_filtering);
66 int rf69_set_payload_length(struct spi_device *spi, u8 payload_length);
67 int rf69_set_node_address(struct spi_device *spi, u8 node_address);
68 int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcast_address);
69 int rf69_set_tx_start_condition(struct spi_device *spi,
70                                 enum tx_start_condition tx_start_condition);
71 int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold);
72 int rf69_set_dagc(struct spi_device *spi, enum dagc dagc);
73
74 int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
75 int rf69_write_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
76
77 #endif
This page took 0.036025 seconds and 4 git commands to generate.