28 #include <mraa/gpio.h>
30 #define MMA7660_I2C_BUS 0
31 #define MMA7660_DEFAULT_I2C_ADDR 0x4c
67 typedef enum { REG_XOUT = 0x00,
82 typedef enum { INTR_NONE = 0x00,
94 typedef enum { MODE_MODE = 0x01,
105 typedef enum { BF_UNKNOWN = 0x00,
106 BF_LYING_FRONT = 0x01,
111 typedef enum { LP_UNKNOWN = 0x00,
112 LP_LANDSCAPE_LEFT = 0x01,
113 LP_LANDSCAPE_RIGHT = 0x02,
119 typedef enum { AUTOSLEEP_120 = 0x00,
127 } MMA7660_AUTOSLEEP_T;
135 MMA7660(
int bus, uint8_t address = MMA7660_DEFAULT_I2C_ADDR);
149 bool writeByte(uint8_t reg, uint8_t byte);
168 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
186 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
269 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
272 void installISR(
int pin,
void (*isr)(
void *),
void *arg);
300 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
301 void installISR(
int pin,
void (*isr)(
void *),
void *arg);
305 mraa_i2c_context m_i2c;
306 mraa_gpio_context m_gpio;
bool writeByte(uint8_t reg, uint8_t byte)
Definition: mma7660.cxx:67
void setModeStandby()
Definition: mma7660.cxx:114
void installISR(int pin, void(*isr)(void *), void *arg)
Definition: mma7660.cxx:216
bool tiltTap()
Definition: mma7660.cxx:189
API for the MMA7660 I2C 3-Axis Digital Accelerometer.
Definition: mma7660.h:63
bool setSampleRate(MMA7660_AUTOSLEEP_T sr)
Definition: mma7660.cxx:251
bool tiltShake()
Definition: mma7660.cxx:199
bool setInterruptBits(uint8_t ibits)
Definition: mma7660.cxx:246
void setModeActive()
Definition: mma7660.cxx:102
void getRawValues(int *x, int *y, int *z)
Definition: mma7660.cxx:86
uint8_t readByte(uint8_t reg)
Definition: mma7660.cxx:81
uint8_t tiltBackFront()
Definition: mma7660.cxx:170
uint8_t tiltLandscapePortrait()
Definition: mma7660.cxx:179
uint8_t getVerifiedTilt()
Definition: mma7660.cxx:154
void getAcceleration(float *ax, float *ay, float *az)
Definition: mma7660.cxx:256
void uninstallISR()
Definition: mma7660.cxx:236
int getVerifiedAxis(MMA7660_REG_T axis)
Definition: mma7660.cxx:127
~MMA7660()
Definition: mma7660.cxx:58
MMA7660(int bus, uint8_t address=MMA7660_DEFAULT_I2C_ADDR)
Definition: mma7660.cxx:35