Merge pull request #11297 from SteveCEvans/baro_state
[betaflight.git] / src / main / drivers / resource.h
blob9a9a569f062d78c108c8ab698734b56db00cece6
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 typedef enum {
24 OWNER_FREE = 0,
25 OWNER_PWMINPUT,
26 OWNER_PPMINPUT,
27 OWNER_MOTOR,
28 OWNER_SERVO,
29 OWNER_LED,
30 OWNER_ADC,
31 OWNER_ADC_BATT,
32 OWNER_ADC_CURR,
33 OWNER_ADC_EXT,
34 OWNER_ADC_RSSI,
35 OWNER_SERIAL_TX,
36 OWNER_SERIAL_RX,
37 OWNER_PINDEBUG,
38 OWNER_TIMER,
39 OWNER_SONAR_TRIGGER,
40 OWNER_SONAR_ECHO,
41 OWNER_SYSTEM,
42 OWNER_SPI_SCK,
43 OWNER_SPI_MISO,
44 OWNER_SPI_MOSI,
45 OWNER_I2C_SCL,
46 OWNER_I2C_SDA,
47 OWNER_SDCARD,
48 OWNER_SDIO_CK,
49 OWNER_SDIO_CMD,
50 OWNER_SDIO_D0,
51 OWNER_SDIO_D1,
52 OWNER_SDIO_D2,
53 OWNER_SDIO_D3,
54 OWNER_SDCARD_CS,
55 OWNER_SDCARD_DETECT,
56 OWNER_FLASH_CS,
57 OWNER_BARO_CS,
58 OWNER_GYRO_CS,
59 OWNER_OSD_CS,
60 OWNER_RX_SPI_CS,
61 OWNER_SPI_CS,
62 OWNER_GYRO_EXTI,
63 OWNER_BARO_EOC,
64 OWNER_COMPASS_EXTI,
65 OWNER_USB,
66 OWNER_USB_DETECT,
67 OWNER_BEEPER,
68 OWNER_OSD,
69 OWNER_RX_BIND,
70 OWNER_INVERTER,
71 OWNER_LED_STRIP,
72 OWNER_TRANSPONDER,
73 OWNER_VTX_POWER,
74 OWNER_VTX_CS,
75 OWNER_VTX_DATA,
76 OWNER_VTX_CLK,
77 OWNER_COMPASS_CS,
78 OWNER_RX_BIND_PLUG,
79 OWNER_ESCSERIAL,
80 OWNER_CAMERA_CONTROL,
81 OWNER_TIMUP,
82 OWNER_RANGEFINDER,
83 OWNER_RX_SPI,
84 OWNER_PINIO,
85 OWNER_USB_MSC_PIN,
86 OWNER_MCO,
87 OWNER_RX_SPI_BIND,
88 OWNER_RX_SPI_LED,
89 OWNER_PREINIT,
90 OWNER_RX_SPI_EXTI,
91 OWNER_RX_SPI_CC2500_TX_EN,
92 OWNER_RX_SPI_CC2500_LNA_EN,
93 OWNER_RX_SPI_CC2500_ANT_SEL,
94 OWNER_QUADSPI_CLK,
95 OWNER_QUADSPI_BK1IO0,
96 OWNER_QUADSPI_BK1IO1,
97 OWNER_QUADSPI_BK1IO2,
98 OWNER_QUADSPI_BK1IO3,
99 OWNER_QUADSPI_BK1CS,
100 OWNER_QUADSPI_BK2IO0,
101 OWNER_QUADSPI_BK2IO1,
102 OWNER_QUADSPI_BK2IO2,
103 OWNER_QUADSPI_BK2IO3,
104 OWNER_QUADSPI_BK2CS,
105 OWNER_BARO_XCLR,
106 OWNER_PULLUP,
107 OWNER_PULLDOWN,
108 OWNER_DSHOT_BITBANG,
109 OWNER_SWD,
110 OWNER_RX_SPI_EXPRESSLRS_RESET,
111 OWNER_RX_SPI_EXPRESSLRS_BUSY,
112 OWNER_TOTAL_COUNT
113 } resourceOwner_e;
115 typedef struct resourceOwner_s {
116 resourceOwner_e owner;
117 uint8_t resourceIndex;
118 } resourceOwner_t;
120 extern const char * const ownerNames[OWNER_TOTAL_COUNT];
122 #define RESOURCE_INDEX(x) (x + 1)
123 #define RESOURCE_SOFT_OFFSET 10