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

driver mma7660fc header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_mma7660fc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mma7660fc_handle_s
 mma7660fc handle structure definition More...
struct  mma7660fc_info_s
 mma7660fc information structure definition More...

Macros

#define DRIVER_MMA7660FC_LINK_INIT(HANDLE, STRUCTURE)
 initialize mma7660fc_handle_t structure
#define DRIVER_MMA7660FC_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_MMA7660FC_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_MMA7660FC_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_MMA7660FC_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_MMA7660FC_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_MMA7660FC_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_MMA7660FC_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct mma7660fc_handle_s mma7660fc_handle_t
 mma7660fc handle structure definition
typedef struct mma7660fc_info_s mma7660fc_info_t
 mma7660fc information structure definition

Enumerations

enum  mma7660fc_bool_t { MMA7660FC_BOOL_FALSE = 0x00 , MMA7660FC_BOOL_TRUE = 0x01 }
 mma7660fc bool enumeration definition More...
enum  mma7660fc_status_t {
  MMA7660FC_STATUS_FRONT = 0x00 , MMA7660FC_STATUS_BACK = 0x01 , MMA7660FC_STATUS_LEFT = 0x02 , MMA7660FC_STATUS_RIGHT = 0x03 ,
  MMA7660FC_STATUS_DOWN = 0x04 , MMA7660FC_STATUS_UP = 0x05 , MMA7660FC_STATUS_TAP = 0x06 , MMA7660FC_STATUS_UPDATE = 0x07 ,
  MMA7660FC_STATUS_SHAKE = 0x08 , MMA7660FC_STATUS_AUTO_SLEEP = 0x09 , MMA7660FC_STATUS_AUTO_WAKE_UP = 0x0A
}
 mma7660fc status enumeration definition More...
enum  mma7660fc_mode_t { MMA7660FC_MODE_STANDBY = 0x00 , MMA7660FC_MODE_TEST = 0x04 , MMA7660FC_MODE_ACTIVE = 0x01 }
 mma7660fc mode enumeration definition More...
enum  mma7660fc_sleep_counter_prescaler_t { MMA7660FC_SLEEP_COUNTER_PRESCALER_1 = 0x00 , MMA7660FC_SLEEP_COUNTER_PRESCALER_16 = 0x01 }
 mma7660fc sleep counter prescaler enumeration definition More...
enum  mma7660fc_interrupt_pin_type_t { MMA7660FC_INTERRUPT_PIN_TYPE_OPEN_DRAIN = 0x00 , MMA7660FC_INTERRUPT_PIN_TYPE_PUSH_PULL = 0x01 }
 mma7660fc interrupt pin type enumeration definition More...
enum  mma7660fc_interrupt_active_level_t { MMA7660FC_INTERRUPT_ACTIVE_LEVEL_LOW = 0x00 , MMA7660FC_INTERRUPT_ACTIVE_LEVEL_HIGH = 0x01 }
 mma7660fc interrupt active level enumeration definition More...
enum  mma7660fc_auto_sleep_rate_t {
  MMA7660FC_AUTO_SLEEP_RATE_120 = 0x00 , MMA7660FC_AUTO_SLEEP_RATE_64 = 0x01 , MMA7660FC_AUTO_SLEEP_RATE_32 = 0x02 , MMA7660FC_AUTO_SLEEP_RATE_16 = 0x03 ,
  MMA7660FC_AUTO_SLEEP_RATE_8 = 0x04 , MMA7660FC_AUTO_SLEEP_RATE_4 = 0x05 , MMA7660FC_AUTO_SLEEP_RATE_2 = 0x06 , MMA7660FC_AUTO_SLEEP_RATE_1 = 0x07
}
 mma7660fc auto sleep rate enumeration definition More...
enum  mma7660fc_auto_wake_rate_t { MMA7660FC_AUTO_WAKE_RATE_32 = 0x00 , MMA7660FC_AUTO_WAKE_RATE_16 = 0x01 , MMA7660FC_AUTO_WAKE_RATE_8 = 0x02 , MMA7660FC_AUTO_WAKE_RATE_1 = 0x03 }
 mma7660fc auto wake rate enumeration definition More...
enum  mma7660fc_tilt_debounce_filter_t {
  MMA7660FC_TILT_DEBOUNCE_FILTER_DISABLE = 0x00 , MMA7660FC_TILT_DEBOUNCE_FILTER_2 = 0x01 , MMA7660FC_TILT_DEBOUNCE_FILTER_3 = 0x02 , MMA7660FC_TILT_DEBOUNCE_FILTER_4 = 0x03 ,
  MMA7660FC_TILT_DEBOUNCE_FILTER_5 = 0x04 , MMA7660FC_TILT_DEBOUNCE_FILTER_6 = 0x05 , MMA7660FC_TILT_DEBOUNCE_FILTER_7 = 0x06 , MMA7660FC_TILT_DEBOUNCE_FILTER_8 = 0x07
}
 mma7660fc tilt debounce filter enumeration definition More...

Functions

uint8_t mma7660fc_info (mma7660fc_info_t *info)
 get chip's information
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_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_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

Detailed Description

driver mma7660fc header 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.h.