LibDriver MMA7660FC
Loading...
Searching...
No Matches
driver_mma7660fc.c File Reference

driver mma7660fc source file More...

#include "driver_mma7660fc.h"
Include dependency graph for driver_mma7660fc.c:

Go to the source code of this file.

Macros

#define CHIP_NAME   "NXP MMA7660FC"
 chip information definition
#define MANUFACTURER_NAME   "NXP"
#define SUPPLY_VOLTAGE_MIN   2.4f
#define SUPPLY_VOLTAGE_MAX   3.6f
#define MAX_CURRENT   0.294f
#define TEMPERATURE_MIN   -40.0f
#define TEMPERATURE_MAX   85.0f
#define DRIVER_VERSION   1000
#define MMA7660FC_ADDRESS   0x98
 chip address definition
#define MMA7660FC_REG_XOUT   0x00
 chip register definition
#define MMA7660FC_REG_YOUT   0x01
#define MMA7660FC_REG_ZOUT   0x02
#define MMA7660FC_REG_TILT   0x03
#define MMA7660FC_REG_SRST   0x04
#define MMA7660FC_REG_SPCNT   0x05
#define MMA7660FC_REG_INTSU   0x06
#define MMA7660FC_REG_MODE   0x07
#define MMA7660FC_REG_SR   0x08
#define MMA7660FC_REG_PDET   0x09
#define MMA7660FC_REG_PD   0x0A

Functions

uint8_t mma7660fc_get_tilt_status (mma7660fc_handle_t *handle, uint8_t *status)
 get tilt status
uint8_t mma7660fc_get_auto_sleep_status (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get auto sleep status
uint8_t mma7660fc_get_auto_wake_up_status (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get auto wake up status
uint8_t mma7660fc_set_sleep_count (mma7660fc_handle_t *handle, uint8_t count)
 set sleep count
uint8_t mma7660fc_get_sleep_count (mma7660fc_handle_t *handle, uint8_t *count)
 get sleep count
uint8_t mma7660fc_set_front_back_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable front back interrupt
uint8_t mma7660fc_get_front_back_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get front back interrupt status
uint8_t mma7660fc_set_up_down_right_left_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable up down right left interrupt
uint8_t mma7660fc_get_up_down_right_left_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get up down right left interrupt status
uint8_t mma7660fc_set_tap_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable tap interrupt
uint8_t mma7660fc_get_tap_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get tap interrupt status
uint8_t mma7660fc_set_auto_sleep_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable auto sleep interrupt
uint8_t mma7660fc_get_auto_sleep_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get auto sleep interrupt status
uint8_t mma7660fc_set_update_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable update interrupt status
uint8_t mma7660fc_get_update_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get update interrupt status
uint8_t mma7660fc_set_shake_x_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable shake x interrupt
uint8_t mma7660fc_get_shake_x_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get shake x interrupt status
uint8_t mma7660fc_set_shake_y_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable shake y interrupt
uint8_t mma7660fc_get_shake_y_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get shake y interrupt status
uint8_t mma7660fc_set_shake_z_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable shake z interrupt
uint8_t mma7660fc_get_shake_z_interrupt (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get shake z interrupt status
uint8_t mma7660fc_set_mode (mma7660fc_handle_t *handle, mma7660fc_mode_t mode)
 set mode
uint8_t mma7660fc_get_mode (mma7660fc_handle_t *handle, mma7660fc_mode_t *mode)
 get mode
uint8_t mma7660fc_set_auto_wake_up (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable auto wake up
uint8_t mma7660fc_get_auto_wake_up (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get auto wake up status
uint8_t mma7660fc_set_auto_sleep (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable auto sleep
uint8_t mma7660fc_get_auto_sleep (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get auto sleep status
uint8_t mma7660fc_set_sleep_counter_prescaler (mma7660fc_handle_t *handle, mma7660fc_sleep_counter_prescaler_t prescaler)
 set sleep counter prescaler
uint8_t mma7660fc_get_sleep_counter_prescaler (mma7660fc_handle_t *handle, mma7660fc_sleep_counter_prescaler_t *prescaler)
 get sleep counter prescaler
uint8_t mma7660fc_set_interrupt_pin_type (mma7660fc_handle_t *handle, mma7660fc_interrupt_pin_type_t type)
 set interrupt pin type
uint8_t mma7660fc_get_interrupt_pin_type (mma7660fc_handle_t *handle, mma7660fc_interrupt_pin_type_t *type)
 get interrupt pin type
uint8_t mma7660fc_set_interrupt_active_level (mma7660fc_handle_t *handle, mma7660fc_interrupt_active_level_t level)
 set interrupt active level
uint8_t mma7660fc_get_interrupt_active_level (mma7660fc_handle_t *handle, mma7660fc_interrupt_active_level_t *level)
 get interrupt active level
uint8_t mma7660fc_set_tap_detection_rate (mma7660fc_handle_t *handle, mma7660fc_auto_sleep_rate_t rate)
 set tap detection rate
uint8_t mma7660fc_get_tap_detection_rate (mma7660fc_handle_t *handle, mma7660fc_auto_sleep_rate_t *rate)
 get tap detection rate
uint8_t mma7660fc_set_auto_wake_rate (mma7660fc_handle_t *handle, mma7660fc_auto_wake_rate_t rate)
 set auto wake rate
uint8_t mma7660fc_get_auto_wake_rate (mma7660fc_handle_t *handle, mma7660fc_auto_wake_rate_t *rate)
 get auto wake rate
uint8_t mma7660fc_set_tilt_debounce_filter (mma7660fc_handle_t *handle, mma7660fc_tilt_debounce_filter_t filter)
 set tilt debounce filter
uint8_t mma7660fc_get_tilt_debounce_filter (mma7660fc_handle_t *handle, mma7660fc_tilt_debounce_filter_t *filter)
 get tilt debounce filter
uint8_t mma7660fc_set_tap_detection_threshold (mma7660fc_handle_t *handle, uint8_t threshold)
 set tap detection threshold
uint8_t mma7660fc_get_tap_detection_threshold (mma7660fc_handle_t *handle, uint8_t *threshold)
 get tap detection threshold
uint8_t mma7660fc_set_tap_x_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable tap x detection
uint8_t mma7660fc_get_tap_x_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get tap x detection status
uint8_t mma7660fc_set_tap_y_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable tap y detection
uint8_t mma7660fc_get_tap_y_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get tap y detection status
uint8_t mma7660fc_set_tap_z_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
 enable or disable tap z detection
uint8_t mma7660fc_get_tap_z_detection (mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
 get tap z detection status
uint8_t mma7660fc_set_tap_pulse_debounce_count (mma7660fc_handle_t *handle, uint8_t count)
 set tap pulse debounce count
uint8_t mma7660fc_get_tap_pulse_debounce_count (mma7660fc_handle_t *handle, uint8_t *count)
 get tap pulse debounce count
uint8_t mma7660fc_tap_pulse_debounce_convert_to_register (mma7660fc_handle_t *handle, float ms, uint8_t *reg)
 convert tap pulse debounce to the register raw data
uint8_t mma7660fc_tap_pulse_debounce_convert_to_data (mma7660fc_handle_t *handle, uint8_t reg, float *ms)
 convert the register raw data to tap pulse debounce
uint8_t mma7660fc_irq_handler (mma7660fc_handle_t *handle)
 irq handler
uint8_t mma7660fc_init (mma7660fc_handle_t *handle)
 initialize the chip
uint8_t mma7660fc_deinit (mma7660fc_handle_t *handle)
 close the chip
uint8_t mma7660fc_read (mma7660fc_handle_t *handle, int8_t raw[3], float g[3])
 read the data
uint8_t mma7660fc_set_reg (mma7660fc_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t mma7660fc_get_reg (mma7660fc_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register
uint8_t mma7660fc_info (mma7660fc_info_t *info)
 get chip's information

Detailed Description

driver mma7660fc source file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2025-03-31

history

Date Version Author Description
2025/03/31 1.0 Shifeng Li first upload

Definition in file driver_mma7660fc.c.

Macro Definition Documentation

◆ CHIP_NAME

#define CHIP_NAME   "NXP MMA7660FC"

chip information definition

chip name

Definition at line 42 of file driver_mma7660fc.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   1000

driver version

Definition at line 49 of file driver_mma7660fc.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "NXP"

manufacturer name

Definition at line 43 of file driver_mma7660fc.c.

◆ MAX_CURRENT

#define MAX_CURRENT   0.294f

chip max current

Definition at line 46 of file driver_mma7660fc.c.

◆ MMA7660FC_ADDRESS

#define MMA7660FC_ADDRESS   0x98

chip address definition

iic device address

Definition at line 54 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_INTSU

#define MMA7660FC_REG_INTSU   0x06

intsu register

Definition at line 65 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_MODE

#define MMA7660FC_REG_MODE   0x07

mode register

Definition at line 66 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_PD

#define MMA7660FC_REG_PD   0x0A

pd register

Definition at line 69 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_PDET

#define MMA7660FC_REG_PDET   0x09

pdet register

Definition at line 68 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_SPCNT

#define MMA7660FC_REG_SPCNT   0x05

spcnt register

Definition at line 64 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_SR

#define MMA7660FC_REG_SR   0x08

sr register

Definition at line 67 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_SRST

#define MMA7660FC_REG_SRST   0x04

srst register

Definition at line 63 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_TILT

#define MMA7660FC_REG_TILT   0x03

tilt register

Definition at line 62 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_XOUT

#define MMA7660FC_REG_XOUT   0x00

chip register definition

xout register

Definition at line 59 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_YOUT

#define MMA7660FC_REG_YOUT   0x01

yout register

Definition at line 60 of file driver_mma7660fc.c.

◆ MMA7660FC_REG_ZOUT

#define MMA7660FC_REG_ZOUT   0x02

zout register

Definition at line 61 of file driver_mma7660fc.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   3.6f

chip max supply voltage

Definition at line 45 of file driver_mma7660fc.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   2.4f

chip min supply voltage

Definition at line 44 of file driver_mma7660fc.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   85.0f

chip max operating temperature

Definition at line 48 of file driver_mma7660fc.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -40.0f

chip min operating temperature

Definition at line 47 of file driver_mma7660fc.c.