dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_openlrs.h
Go to the documentation of this file.
1 
16 /*
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful, but
23  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25  * for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with this program; if not, see <http://www.gnu.org/licenses/>
29  */
30 
31 #ifndef PIOS_OPENLRS_H
32 #define PIOS_OPENLRS_H
33 
34 #include <hwshared.h>
35 
36 struct pios_openlrs_cfg;
37 
38 #ifdef PIOS_INCLUDE_OPENLRS
39 enum gpio_direction { GPIO0_TX_GPIO1_RX, GPIO0_RX_GPIO1_TX };
40 
41 /* Global Types */
42 struct pios_openlrs_cfg {
43  const struct pios_spi_cfg *spi_cfg;
44  /* Pointer to SPI interface configuration */
45  const struct pios_exti_cfg *exti_cfg;
46  /* Pointer to the EXTI configuration */
47 
48  const struct stm32_gpio *bind_button;
49  /* Binding button, if not NULL. */
50 
51  bool bind_active_high;
52 
53  enum gpio_direction gpio_direction;
54 };
55 
56 struct pios_openlrs_dev;
57 typedef struct pios_openlrs_dev *pios_openlrs_t;
58 
59 int32_t PIOS_OpenLRS_Init(pios_openlrs_t *openlrs_id, pios_spi_t spi_id,
60  uint32_t slave_num, const struct pios_openlrs_cfg *cfg,
61  HwSharedRfBandOptions rf_band,
62  HwSharedMaxRfPowerOptions rf_power);
63 
64 int32_t PIOS_OpenLRS_Start(pios_openlrs_t openlrs_id);
65 
66 void PIOS_OpenLRS_RegisterRcvr(pios_openlrs_t openlrs_id,
67  uintptr_t rfm22b_rcvr_id);
68 uint8_t PIOS_OpenLRS_RSSI_Get(void);
69 
70 bool PIOS_OpenLRS_EXT_Int(pios_openlrs_t openlrs_id);
71 
72 #endif
73 #endif /* PIOS_OPENLRS_H */
74 
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49