NinjaFlight
|
#include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#include "system.h"
#include "gpio.h"
#include "bus_i2c.h"
#include "sensor.h"
#include "accgyro.h"
#include "accgyro_mma845x.h"
Functions | |
bool | mma8452Detect (acc_t *accel) |
#define MMA8451_DEVICE_SIGNATURE 0x1A |
#define MMA8452_ADDRESS 0x1C |
#define MMA8452_CTRL_REG1 0x2A |
#define MMA8452_CTRL_REG1_ACTIVE 0x01 |
#define MMA8452_CTRL_REG1_LNOISE 0x04 |
#define MMA8452_CTRL_REG2 0x2B |
#define MMA8452_CTRL_REG2_B0_MODS0 0x01 |
#define MMA8452_CTRL_REG2_B1_MODS1 0x02 |
#define MMA8452_CTRL_REG2_B2_SLPE 0x04 |
#define MMA8452_CTRL_REG2_B3_SMODS0 0x08 |
#define MMA8452_CTRL_REG2_B4_SMODS1 0x10 |
#define MMA8452_CTRL_REG2_B6_RST 0x40 |
#define MMA8452_CTRL_REG2_B7_ST 0x80 |
#define MMA8452_CTRL_REG2_MODS_HR 0x02 |
#define MMA8452_CTRL_REG2_MODS_LNLP 0x01 |
#define MMA8452_CTRL_REG2_MODS_LP 0x03 |
#define MMA8452_CTRL_REG2_MODS_NOR 0x00 |
#define MMA8452_CTRL_REG3 0x2C |
#define MMA8452_CTRL_REG3_IPOL 0x02 |
#define MMA8452_CTRL_REG4 0x2D |
#define MMA8452_CTRL_REG4_INT_EN_DRDY 0x01 |
#define MMA8452_CTRL_REG5 0x2E |
#define MMA8452_DEVICE_SIGNATURE 0x2A |
#define MMA8452_FS_RANGE_2G 0x00 |
#define MMA8452_FS_RANGE_4G 0x01 |
#define MMA8452_FS_RANGE_8G 0x02 |
#define MMA8452_HP_FILTER_CUTOFF 0x0F |
#define MMA8452_HPF_CUTOFF_LV1 0x00 |
#define MMA8452_HPF_CUTOFF_LV2 0x01 |
#define MMA8452_HPF_CUTOFF_LV3 0x02 |
#define MMA8452_HPF_CUTOFF_LV4 0x03 |
#define MMA8452_OUT_X_MSB 0x01 |
#define MMA8452_STATUS 0x00 |
#define MMA8452_WHO_AM_I 0x0D |
#define MMA8452_XYZ_DATA_CFG 0x0E |
bool mma8452Detect | ( | acc_t * | accel | ) |