NinjaFlight
|
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <platform.h>
#include "debug.h"
#include "common/axis.h"
#include "common/maths.h"
#include "system.h"
#include "nvic.h"
#include "gpio.h"
#include "bus_i2c.h"
#include "light_led.h"
#include "sensor.h"
#include "compass.h"
#include "compass_hmc5883l.h"
Macros | |
#define | MAG_ADDRESS 0x1E |
#define | MAG_DATA_REGISTER 0x03 |
#define | HMC58X3_R_CONFA 0 |
#define | HMC58X3_R_CONFB 1 |
#define | HMC58X3_R_MODE 2 |
#define | HMC58X3_X_SELF_TEST_GAUSS (+1.16f) |
#define | HMC58X3_Y_SELF_TEST_GAUSS (+1.16f) |
#define | HMC58X3_Z_SELF_TEST_GAUSS (+1.08f) |
#define | SELF_TEST_LOW_LIMIT (243.0f / 390.0f) |
#define | SELF_TEST_HIGH_LIMIT (575.0f / 390.0f) |
#define | HMC_POS_BIAS 1 |
#define | HMC_NEG_BIAS 2 |
Functions | |
void | MAG_DATA_READY_EXTI_Handler (void) |
bool | hmc5883lDetect (mag_t *mag, const hmc5883Config_t *hmc5883ConfigToUse) |
void | hmc5883lInit (void) |
bool | hmc5883lRead (int16_t *magData) |
#define HMC58X3_R_CONFA 0 |
#define HMC58X3_R_CONFB 1 |
#define HMC58X3_R_MODE 2 |
#define HMC58X3_X_SELF_TEST_GAUSS (+1.16f) |
#define HMC58X3_Y_SELF_TEST_GAUSS (+1.16f) |
#define HMC58X3_Z_SELF_TEST_GAUSS (+1.08f) |
#define HMC_NEG_BIAS 2 |
#define HMC_POS_BIAS 1 |
#define MAG_ADDRESS 0x1E |
#define MAG_DATA_REGISTER 0x03 |
#define SELF_TEST_HIGH_LIMIT (575.0f / 390.0f) |
#define SELF_TEST_LOW_LIMIT (243.0f / 390.0f) |
bool hmc5883lDetect | ( | mag_t * | mag, |
const hmc5883Config_t * | hmc5883ConfigToUse | ||
) |
void hmc5883lInit | ( | void | ) |
bool hmc5883lRead | ( | int16_t * | magData | ) |
void MAG_DATA_READY_EXTI_Handler | ( | void | ) |