Create set-home.md
[u360gts.git] / src / main / drivers / compass_hmc5883l.h
blob53c4c9f3e56064e7bbef2de2403b4a5a8ff8dc89
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 typedef struct hmc5883Config_s {
21 #ifdef STM32F303
22 uint32_t gpioAHBPeripherals;
23 #endif
24 #ifdef STM32F10X
25 uint32_t gpioAPB2Peripherals;
26 #endif
27 uint16_t gpioPin;
28 GPIO_TypeDef *gpioPort;
30 uint8_t exti_port_source;
31 uint32_t exti_line;
32 uint8_t exti_pin_source;
33 IRQn_Type exti_irqn;
34 } hmc5883Config_t;
36 bool hmc5883lDetect(mag_t* mag, const hmc5883Config_t *hmc5883ConfigToUse);
37 void hmc5883lInit(void);
38 bool hmc5883lRead(int16_t *magData);