LibDriver MMA7660FC
Loading...
Searching...
No Matches
mma7660fc base driver function

mma7660fc base driver modules More...

Collaboration diagram for mma7660fc base driver function:

Data Structures

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

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

Detailed Description

mma7660fc base driver modules

Typedef Documentation

◆ mma7660fc_handle_t

mma7660fc handle structure definition

◆ mma7660fc_info_t

mma7660fc information structure definition

Enumeration Type Documentation

◆ mma7660fc_auto_sleep_rate_t

mma7660fc auto sleep rate enumeration definition

AUTO_SLEEP_RATE SLEEP_COUNTER_PRESCALER_1 SLEEP_COUNTER_PRESCALER_16 minimum maximum minimum maximum AUTO_SLEEP_RATE_1 1s 256s 16s 4096s AUTO_SLEEP_RATE_2 0.5s 128s 8s 2048s AUTO_SLEEP_RATE_4 0.25s 64s 4s 1024s AUTO_SLEEP_RATE_8 0.125s 32s 2s 512s AUTO_SLEEP_RATE_16 0.0625s 16s 1s 256s AUTO_SLEEP_RATE_32 0.03125s 8s 0.5s 128s AUTO_SLEEP_RATE_64 0.01560s 4s 0.25s 64s AUTO_SLEEP_RATE_120 0.00836s 2s 0.133s 34.24s

Enumerator
MMA7660FC_AUTO_SLEEP_RATE_120 

120 samples/second

MMA7660FC_AUTO_SLEEP_RATE_64 

64 samples/second

MMA7660FC_AUTO_SLEEP_RATE_32 

32 samples/second

MMA7660FC_AUTO_SLEEP_RATE_16 

16 samples/second

MMA7660FC_AUTO_SLEEP_RATE_8 

8 samples/second

MMA7660FC_AUTO_SLEEP_RATE_4 

4 samples/second

MMA7660FC_AUTO_SLEEP_RATE_2 

2 samples/second

MMA7660FC_AUTO_SLEEP_RATE_1 

1 samples/second

Definition at line 137 of file driver_mma7660fc.h.

◆ mma7660fc_auto_wake_rate_t

mma7660fc auto wake rate enumeration definition

WAKE_RATE         TIME

AUTO_WAKE_RATE_32 31.25ms AUTO_WAKE_RATE_16 62.5ms AUTO_WAKE_RATE_8 125ms AUTO_WAKE_RATE_1 1000ms

Enumerator
MMA7660FC_AUTO_WAKE_RATE_32 

32 samples/second

MMA7660FC_AUTO_WAKE_RATE_16 

16 samples/second

MMA7660FC_AUTO_WAKE_RATE_8 

8 samples/second

MMA7660FC_AUTO_WAKE_RATE_1 

1 samples/second

Definition at line 158 of file driver_mma7660fc.h.

◆ mma7660fc_bool_t

mma7660fc bool enumeration definition

Enumerator
MMA7660FC_BOOL_FALSE 

disable

MMA7660FC_BOOL_TRUE 

enable

Definition at line 62 of file driver_mma7660fc.h.

◆ mma7660fc_interrupt_active_level_t

mma7660fc interrupt active level enumeration definition

Enumerator
MMA7660FC_INTERRUPT_ACTIVE_LEVEL_LOW 

active low

MMA7660FC_INTERRUPT_ACTIVE_LEVEL_HIGH 

active high

Definition at line 117 of file driver_mma7660fc.h.

◆ mma7660fc_interrupt_pin_type_t

mma7660fc interrupt pin type enumeration definition

Enumerator
MMA7660FC_INTERRUPT_PIN_TYPE_OPEN_DRAIN 

open drain

MMA7660FC_INTERRUPT_PIN_TYPE_PUSH_PULL 

push-pull

Definition at line 108 of file driver_mma7660fc.h.

◆ mma7660fc_mode_t

mma7660fc mode enumeration definition

Enumerator
MMA7660FC_MODE_STANDBY 

standby mode

MMA7660FC_MODE_TEST 

test mode

MMA7660FC_MODE_ACTIVE 

active mode

Definition at line 89 of file driver_mma7660fc.h.

◆ mma7660fc_sleep_counter_prescaler_t

mma7660fc sleep counter prescaler enumeration definition

Enumerator
MMA7660FC_SLEEP_COUNTER_PRESCALER_1 

divide-by-1

MMA7660FC_SLEEP_COUNTER_PRESCALER_16 

divide-by-16

Definition at line 99 of file driver_mma7660fc.h.

◆ mma7660fc_status_t

mma7660fc status enumeration definition

Enumerator
MMA7660FC_STATUS_FRONT 

equipment is lying on its front

MMA7660FC_STATUS_BACK 

equipment is lying on its back

MMA7660FC_STATUS_LEFT 

equipment is landscape mode to the left

MMA7660FC_STATUS_RIGHT 

equipment is landscape mode to the right

MMA7660FC_STATUS_DOWN 

equipment is standing vertically in inverted orientation

MMA7660FC_STATUS_UP 

equipment is standing vertically in normal orientation

MMA7660FC_STATUS_TAP 

equipment has detected a tap

MMA7660FC_STATUS_UPDATE 

register data is invalid

MMA7660FC_STATUS_SHAKE 

equipment is experiencing shake in one or more of the axes

MMA7660FC_STATUS_AUTO_SLEEP 

auto sleep

MMA7660FC_STATUS_AUTO_WAKE_UP 

auto wake up

Definition at line 71 of file driver_mma7660fc.h.

◆ mma7660fc_tilt_debounce_filter_t

mma7660fc tilt debounce filter enumeration definition

Enumerator
MMA7660FC_TILT_DEBOUNCE_FILTER_DISABLE 

disabled

MMA7660FC_TILT_DEBOUNCE_FILTER_2 

2 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_3 

3 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_4 

4 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_5 

5 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_6 

6 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_7 

7 measurement samples at the rate

MMA7660FC_TILT_DEBOUNCE_FILTER_8 

8 measurement samples at the rate

Definition at line 169 of file driver_mma7660fc.h.

Function Documentation

◆ mma7660fc_deinit()

uint8_t mma7660fc_deinit ( mma7660fc_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a mma7660fc handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 2354 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_sleep()

uint8_t mma7660fc_get_auto_sleep ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get auto sleep status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get auto sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1170 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_sleep_interrupt()

uint8_t mma7660fc_get_auto_sleep_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get auto sleep interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get auto sleep interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 596 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_sleep_status()

uint8_t mma7660fc_get_auto_sleep_status ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get auto sleep status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool buffer
Returns
status code
  • 0 success
  • 1 get auto sleep status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 159 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_wake_rate()

uint8_t mma7660fc_get_auto_wake_rate ( mma7660fc_handle_t * handle,
mma7660fc_auto_wake_rate_t * rate )

get auto wake rate

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*ratepointer to an auto wake rate buffer
Returns
status code
  • 0 success
  • 1 get auto wake rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1580 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_wake_up()

uint8_t mma7660fc_get_auto_wake_up ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get auto wake up status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get auto wak up failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1088 of file driver_mma7660fc.c.

◆ mma7660fc_get_auto_wake_up_status()

uint8_t mma7660fc_get_auto_wake_up_status ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get auto wake up status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool buffer
Returns
status code
  • 0 success
  • 1 get auto wake up status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 196 of file driver_mma7660fc.c.

◆ mma7660fc_get_front_back_interrupt()

uint8_t mma7660fc_get_front_back_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get front back interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get front back interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 350 of file driver_mma7660fc.c.

◆ mma7660fc_get_interrupt_active_level()

uint8_t mma7660fc_get_interrupt_active_level ( mma7660fc_handle_t * handle,
mma7660fc_interrupt_active_level_t * level )

get interrupt active level

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*levelpointer to an interrupt active level buffer
Returns
status code
  • 0 success
  • 1 get interrupt active level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1416 of file driver_mma7660fc.c.

◆ mma7660fc_get_interrupt_pin_type()

uint8_t mma7660fc_get_interrupt_pin_type ( mma7660fc_handle_t * handle,
mma7660fc_interrupt_pin_type_t * type )

get interrupt pin type

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*typepointer to an interrupt pin type buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin type failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1334 of file driver_mma7660fc.c.

◆ mma7660fc_get_mode()

uint8_t mma7660fc_get_mode ( mma7660fc_handle_t * handle,
mma7660fc_mode_t * mode )

get mode

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*modepointer to a chip mode buffer
Returns
status code
  • 0 success
  • 1 get mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1006 of file driver_mma7660fc.c.

◆ mma7660fc_get_shake_x_interrupt()

uint8_t mma7660fc_get_shake_x_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get shake x interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get shake x interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 760 of file driver_mma7660fc.c.

◆ mma7660fc_get_shake_y_interrupt()

uint8_t mma7660fc_get_shake_y_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get shake y interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get shake y interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 842 of file driver_mma7660fc.c.

◆ mma7660fc_get_shake_z_interrupt()

uint8_t mma7660fc_get_shake_z_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get shake z interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get shake z interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 924 of file driver_mma7660fc.c.

◆ mma7660fc_get_sleep_count()

uint8_t mma7660fc_get_sleep_count ( mma7660fc_handle_t * handle,
uint8_t * count )

get sleep count

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*countpointer to a count buffer
Returns
status code
  • 0 success
  • 1 get sleep count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 270 of file driver_mma7660fc.c.

◆ mma7660fc_get_sleep_counter_prescaler()

uint8_t mma7660fc_get_sleep_counter_prescaler ( mma7660fc_handle_t * handle,
mma7660fc_sleep_counter_prescaler_t * prescaler )

get sleep counter prescaler

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*prescalerpointer to a sleep counter prescaler buffer
Returns
status code
  • 0 success
  • 1 get sleep counter prescaler failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1252 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_detection_rate()

uint8_t mma7660fc_get_tap_detection_rate ( mma7660fc_handle_t * handle,
mma7660fc_auto_sleep_rate_t * rate )

get tap detection rate

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*ratepointer to a tap detection rate buffer
Returns
status code
  • 0 success
  • 1 get tap detection rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1498 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_detection_threshold()

uint8_t mma7660fc_get_tap_detection_threshold ( mma7660fc_handle_t * handle,
uint8_t * threshold )

get tap detection threshold

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*thresholdpointer to a tap detection threshold buffer
Returns
status code
  • 0 success
  • 1 get tap detection threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1751 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_interrupt()

uint8_t mma7660fc_get_tap_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get tap interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 514 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_pulse_debounce_count()

uint8_t mma7660fc_get_tap_pulse_debounce_count ( mma7660fc_handle_t * handle,
uint8_t * count )

get tap pulse debounce count

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*countpointer to a tap pulse debounce count buffer
Returns
status code
  • 0 success
  • 1 get tap pulse debounce count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2071 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_x_detection()

uint8_t mma7660fc_get_tap_x_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get tap x detection status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap x detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1833 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_y_detection()

uint8_t mma7660fc_get_tap_y_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get tap y detection status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap y detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1915 of file driver_mma7660fc.c.

◆ mma7660fc_get_tap_z_detection()

uint8_t mma7660fc_get_tap_z_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get tap z detection status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get tap z detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1997 of file driver_mma7660fc.c.

◆ mma7660fc_get_tilt_debounce_filter()

uint8_t mma7660fc_get_tilt_debounce_filter ( mma7660fc_handle_t * handle,
mma7660fc_tilt_debounce_filter_t * filter )

get tilt debounce filter

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*filterpointer to a tilt debounce filter buffer
Returns
status code
  • 0 success
  • 1 get tilt debounce filter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1662 of file driver_mma7660fc.c.

◆ mma7660fc_get_tilt_status()

uint8_t mma7660fc_get_tilt_status ( mma7660fc_handle_t * handle,
uint8_t * status )

get tilt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 124 of file driver_mma7660fc.c.

◆ mma7660fc_get_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

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get up down right left interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 432 of file driver_mma7660fc.c.

◆ mma7660fc_get_update_interrupt()

uint8_t mma7660fc_get_update_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t * enable )

get update interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get update interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 678 of file driver_mma7660fc.c.

◆ mma7660fc_info()

uint8_t mma7660fc_info ( mma7660fc_info_t * info)

get chip's information

Parameters
[out]*infopointer to a mma7660fc info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2546 of file driver_mma7660fc.c.

◆ mma7660fc_init()

uint8_t mma7660fc_init ( mma7660fc_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a mma7660fc handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 2285 of file driver_mma7660fc.c.

◆ mma7660fc_irq_handler()

uint8_t mma7660fc_irq_handler ( mma7660fc_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to a mma7660fc handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2166 of file driver_mma7660fc.c.

◆ mma7660fc_read()

uint8_t mma7660fc_read ( mma7660fc_handle_t * handle,
int8_t raw[3],
float g[3] )

read the data

Parameters
[in]*handlepointer to a mma7660fc handle structure
[out]*rawpointer to a raw pressure buffer
[out]*gpointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is invalid
Note
none

Definition at line 2407 of file driver_mma7660fc.c.

◆ mma7660fc_set_auto_sleep()

uint8_t mma7660fc_set_auto_sleep ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable auto sleep

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set auto sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1125 of file driver_mma7660fc.c.

◆ mma7660fc_set_auto_sleep_interrupt()

uint8_t mma7660fc_set_auto_sleep_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable auto sleep interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set auto sleep interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 551 of file driver_mma7660fc.c.

◆ mma7660fc_set_auto_wake_rate()

uint8_t mma7660fc_set_auto_wake_rate ( mma7660fc_handle_t * handle,
mma7660fc_auto_wake_rate_t rate )

set auto wake rate

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]rateauto wake rate
Returns
status code
  • 0 success
  • 1 set auto wake rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1535 of file driver_mma7660fc.c.

◆ mma7660fc_set_auto_wake_up()

uint8_t mma7660fc_set_auto_wake_up ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable auto wake up

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set auto wake up failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1043 of file driver_mma7660fc.c.

◆ mma7660fc_set_front_back_interrupt()

uint8_t mma7660fc_set_front_back_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable front back interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set front back interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 305 of file driver_mma7660fc.c.

◆ mma7660fc_set_interrupt_active_level()

uint8_t mma7660fc_set_interrupt_active_level ( mma7660fc_handle_t * handle,
mma7660fc_interrupt_active_level_t level )

set interrupt active level

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]levelinterrupt active level
Returns
status code
  • 0 success
  • 1 set interrupt active level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1371 of file driver_mma7660fc.c.

◆ mma7660fc_set_interrupt_pin_type()

uint8_t mma7660fc_set_interrupt_pin_type ( mma7660fc_handle_t * handle,
mma7660fc_interrupt_pin_type_t type )

set interrupt pin type

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]typeinterrupt pin type
Returns
status code
  • 0 success
  • 1 set interrupt pin type failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1289 of file driver_mma7660fc.c.

◆ mma7660fc_set_mode()

uint8_t mma7660fc_set_mode ( mma7660fc_handle_t * handle,
mma7660fc_mode_t mode )

set mode

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]modechip mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 961 of file driver_mma7660fc.c.

◆ mma7660fc_set_shake_x_interrupt()

uint8_t mma7660fc_set_shake_x_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable shake x interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set shake x interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 715 of file driver_mma7660fc.c.

◆ mma7660fc_set_shake_y_interrupt()

uint8_t mma7660fc_set_shake_y_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable shake y interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set shake y interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 797 of file driver_mma7660fc.c.

◆ mma7660fc_set_shake_z_interrupt()

uint8_t mma7660fc_set_shake_z_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable shake z interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set shake z interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 879 of file driver_mma7660fc.c.

◆ mma7660fc_set_sleep_count()

uint8_t mma7660fc_set_sleep_count ( mma7660fc_handle_t * handle,
uint8_t count )

set sleep count

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]countsleep count
Returns
status code
  • 0 success
  • 1 set sleep count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 233 of file driver_mma7660fc.c.

◆ mma7660fc_set_sleep_counter_prescaler()

uint8_t mma7660fc_set_sleep_counter_prescaler ( mma7660fc_handle_t * handle,
mma7660fc_sleep_counter_prescaler_t prescaler )

set sleep counter prescaler

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]prescalersleep counter prescaler
Returns
status code
  • 0 success
  • 1 set sleep counter prescaler failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1207 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_detection_rate()

uint8_t mma7660fc_set_tap_detection_rate ( mma7660fc_handle_t * handle,
mma7660fc_auto_sleep_rate_t rate )

set tap detection rate

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]ratetap detection rate
Returns
status code
  • 0 success
  • 1 set tap detection rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1453 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_detection_threshold()

uint8_t mma7660fc_set_tap_detection_threshold ( mma7660fc_handle_t * handle,
uint8_t threshold )

set tap detection threshold

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]thresholdtap detection threshold
Returns
status code
  • 0 success
  • 1 set tap detection threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 threshold > 31
Note
0 <= threshold <= 31

Definition at line 1700 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_interrupt()

uint8_t mma7660fc_set_tap_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable tap interrupt

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 469 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_pulse_debounce_count()

uint8_t mma7660fc_set_tap_pulse_debounce_count ( mma7660fc_handle_t * handle,
uint8_t count )

set tap pulse debounce count

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]counttap pulse debounce count
Returns
status code
  • 0 success
  • 1 set tap pulse debounce count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2034 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_x_detection()

uint8_t mma7660fc_set_tap_x_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable tap x detection

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap x detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1788 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_y_detection()

uint8_t mma7660fc_set_tap_y_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable tap y detection

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap y detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1870 of file driver_mma7660fc.c.

◆ mma7660fc_set_tap_z_detection()

uint8_t mma7660fc_set_tap_z_detection ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable tap z detection

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tap z detection failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1952 of file driver_mma7660fc.c.

◆ mma7660fc_set_tilt_debounce_filter()

uint8_t mma7660fc_set_tilt_debounce_filter ( mma7660fc_handle_t * handle,
mma7660fc_tilt_debounce_filter_t filter )

set tilt debounce filter

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]filtertilt debounce filter
Returns
status code
  • 0 success
  • 1 set tilt debounce filter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1617 of file driver_mma7660fc.c.

◆ mma7660fc_set_up_down_right_left_interrupt()

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

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set up down right left interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 387 of file driver_mma7660fc.c.

◆ mma7660fc_set_update_interrupt()

uint8_t mma7660fc_set_update_interrupt ( mma7660fc_handle_t * handle,
mma7660fc_bool_t enable )

enable or disable update interrupt status

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set update interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 633 of file driver_mma7660fc.c.

◆ mma7660fc_tap_pulse_debounce_convert_to_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

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]regregister raw data
[out]*mspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2133 of file driver_mma7660fc.c.

◆ mma7660fc_tap_pulse_debounce_convert_to_register()

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

Parameters
[in]*handlepointer to a mma7660fc handle structure
[in]mstime in ms
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2106 of file driver_mma7660fc.c.