Microchip® Advanced Software Framework

mma7341l.c File Reference

API driver for MMA7341L accelerometer component.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "sysclk.h"
#include "gpio.h"
#include "mma7341l.h"
#include "adc.h"
#include "pmc.h"

Macros

#define MMA7341L_SAMPLES   16
 
#define TAN15   17
 

Functions

void mma7341l_calibration (void)
 Calibrate MMA7341L component and set the present axis value. More...
 
xyz_g_t mma7341l_get_gravity_value (void)
 Get the gravity value of x,y,z axis. More...
 
uint32_t mma7341l_get_rotation_dir (void)
 Check if the tilt angle is big enough. More...
 
static xyz_t mma7341l_get_value (void)
 Get converted data from x,y,z axis. More...
 
void mma7341l_init (void)
 Initialize MMA7341L. More...
 
void mma7341l_set_mode (uint8_t uc_mode)
 Set MMA7341L working mode. More...
 
static void mma7341l_update (void)
 Update ADC channel conversion value. More...
 
static xyz_t mma7341l_xyz_add (xyz_t p, xyz_t q)
 Addition of two Position axis values. More...
 
static xyz_t mma7341l_xyz_diff (xyz_t p, xyz_t q)
 Subtraction of two Position axis values. More...
 

Variables

acc_t acc
 
static float f_volt_0g
 
static float f_volt_1g
 
static uint8_t uc_adc_channel_x
 
static uint8_t uc_adc_channel_y
 
static uint8_t uc_adc_channel_z