NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
compass_hmc5883l.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight 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.
8  *
9  * Ninjaflight 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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
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;
29 
31  uint32_t exti_line;
32  uint8_t exti_pin_source;
35 
36 bool hmc5883lDetect(mag_t* mag, const hmc5883Config_t *hmc5883ConfigToUse);
37 void hmc5883lInit(void);
38 bool hmc5883lRead(int16_t *magData);
struct mag_config mag
Definition: config.h:94
bool hmc5883lRead(int16_t *magData)
Definition: compass_hmc5883l.c:307
uint16_t gpioPin
Definition: compass_hmc5883l.h:27
void hmc5883lInit(void)
Definition: compass_hmc5883l.c:216
struct hmc5883Config_s hmc5883Config_t
Definition: compass.h:33
uint32_t exti_line
Definition: compass_hmc5883l.h:31
IRQn_Type
Definition: platform.h:56
Definition: platform.h:43
bool hmc5883lDetect(mag_t *mag, const hmc5883Config_t *hmc5883ConfigToUse)
Definition: compass_hmc5883l.c:199
GPIO_TypeDef * gpioPort
Definition: compass_hmc5883l.h:28
Definition: compass_hmc5883l.h:20
uint8_t exti_pin_source
Definition: compass_hmc5883l.h:32
uint8_t exti_port_source
Definition: compass_hmc5883l.h:30
IRQn_Type exti_irqn
Definition: compass_hmc5883l.h:33