37#ifndef DRIVER_MMA7660FC_H
38#define DRIVER_MMA7660FC_H
188 uint8_t (*
iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
189 uint8_t (*
iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
229#define DRIVER_MMA7660FC_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
237#define DRIVER_MMA7660FC_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
245#define DRIVER_MMA7660FC_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
253#define DRIVER_MMA7660FC_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
261#define DRIVER_MMA7660FC_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
269#define DRIVER_MMA7660FC_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
277#define DRIVER_MMA7660FC_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
285#define DRIVER_MMA7660FC_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
mma7660fc_status_t
mma7660fc status enumeration definition
uint8_t mma7660fc_get_sleep_count(mma7660fc_handle_t *handle, uint8_t *count)
get sleep count
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_sleep_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get auto sleep interrupt status
uint8_t mma7660fc_init(mma7660fc_handle_t *handle)
initialize the chip
mma7660fc_interrupt_pin_type_t
mma7660fc interrupt pin type enumeration definition
mma7660fc_bool_t
mma7660fc bool enumeration definition
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_x_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable shake x interrupt
uint8_t mma7660fc_get_shake_y_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get shake y interrupt status
uint8_t mma7660fc_get_tap_y_detection(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get tap y detection status
uint8_t mma7660fc_get_shake_z_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get shake z interrupt status
uint8_t mma7660fc_get_auto_wake_up(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get auto wake up 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_tilt_status(mma7660fc_handle_t *handle, uint8_t *status)
get tilt status
uint8_t mma7660fc_set_interrupt_pin_type(mma7660fc_handle_t *handle, mma7660fc_interrupt_pin_type_t type)
set interrupt pin type
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_get_auto_sleep(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get auto sleep status
uint8_t mma7660fc_read(mma7660fc_handle_t *handle, int8_t raw[3], float g[3])
read the data
uint8_t mma7660fc_set_tap_detection_threshold(mma7660fc_handle_t *handle, uint8_t threshold)
set tap detection threshold
uint8_t mma7660fc_deinit(mma7660fc_handle_t *handle)
close the chip
uint8_t mma7660fc_set_shake_z_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable shake z interrupt
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_get_sleep_counter_prescaler(mma7660fc_handle_t *handle, mma7660fc_sleep_counter_prescaler_t *prescaler)
get sleep counter prescaler
uint8_t mma7660fc_get_update_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get update interrupt status
uint8_t mma7660fc_info(mma7660fc_info_t *info)
get chip's information
uint8_t mma7660fc_set_tilt_debounce_filter(mma7660fc_handle_t *handle, mma7660fc_tilt_debounce_filter_t filter)
set tilt debounce filter
uint8_t mma7660fc_set_auto_wake_rate(mma7660fc_handle_t *handle, mma7660fc_auto_wake_rate_t rate)
set auto wake rate
struct mma7660fc_info_s mma7660fc_info_t
mma7660fc information structure definition
uint8_t mma7660fc_get_tap_pulse_debounce_count(mma7660fc_handle_t *handle, uint8_t *count)
get tap pulse debounce count
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_mode(mma7660fc_handle_t *handle, mma7660fc_mode_t mode)
set mode
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_front_back_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get front back interrupt status
uint8_t mma7660fc_get_tilt_debounce_filter(mma7660fc_handle_t *handle, mma7660fc_tilt_debounce_filter_t *filter)
get tilt debounce filter
uint8_t mma7660fc_get_tap_detection_rate(mma7660fc_handle_t *handle, mma7660fc_auto_sleep_rate_t *rate)
get tap detection rate
struct mma7660fc_handle_s mma7660fc_handle_t
mma7660fc handle structure definition
mma7660fc_interrupt_active_level_t
mma7660fc interrupt active level enumeration definition
uint8_t mma7660fc_set_update_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable update interrupt status
uint8_t mma7660fc_set_front_back_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable front back interrupt
uint8_t mma7660fc_set_tap_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable tap interrupt
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_z_detection(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get tap z 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_set_auto_sleep(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable auto sleep
mma7660fc_sleep_counter_prescaler_t
mma7660fc sleep counter prescaler enumeration definition
uint8_t mma7660fc_get_tap_detection_threshold(mma7660fc_handle_t *handle, uint8_t *threshold)
get tap detection threshold
uint8_t mma7660fc_set_interrupt_active_level(mma7660fc_handle_t *handle, mma7660fc_interrupt_active_level_t level)
set interrupt active level
uint8_t mma7660fc_set_tap_pulse_debounce_count(mma7660fc_handle_t *handle, uint8_t count)
set tap pulse debounce count
mma7660fc_auto_sleep_rate_t
mma7660fc auto sleep rate enumeration definition
uint8_t mma7660fc_irq_handler(mma7660fc_handle_t *handle)
irq handler
mma7660fc_tilt_debounce_filter_t
mma7660fc tilt debounce filter enumeration definition
uint8_t mma7660fc_get_mode(mma7660fc_handle_t *handle, mma7660fc_mode_t *mode)
get mode
mma7660fc_mode_t
mma7660fc mode enumeration definition
uint8_t mma7660fc_get_interrupt_active_level(mma7660fc_handle_t *handle, mma7660fc_interrupt_active_level_t *level)
get interrupt active level
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_tap_detection_rate(mma7660fc_handle_t *handle, mma7660fc_auto_sleep_rate_t rate)
set tap detection rate
uint8_t mma7660fc_get_auto_sleep_status(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get auto sleep 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_set_sleep_count(mma7660fc_handle_t *handle, uint8_t count)
set sleep count
uint8_t mma7660fc_get_interrupt_pin_type(mma7660fc_handle_t *handle, mma7660fc_interrupt_pin_type_t *type)
get interrupt pin type
uint8_t mma7660fc_get_auto_wake_up_status(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get auto wake up status
uint8_t mma7660fc_get_tap_interrupt(mma7660fc_handle_t *handle, mma7660fc_bool_t *enable)
get tap interrupt status
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_z_detection(mma7660fc_handle_t *handle, mma7660fc_bool_t enable)
enable or disable tap z detection
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
mma7660fc_auto_wake_rate_t
mma7660fc auto wake rate enumeration definition
@ MMA7660FC_STATUS_AUTO_SLEEP
@ MMA7660FC_STATUS_AUTO_WAKE_UP
@ MMA7660FC_STATUS_UPDATE
@ MMA7660FC_INTERRUPT_PIN_TYPE_PUSH_PULL
@ MMA7660FC_INTERRUPT_PIN_TYPE_OPEN_DRAIN
@ MMA7660FC_INTERRUPT_ACTIVE_LEVEL_LOW
@ MMA7660FC_INTERRUPT_ACTIVE_LEVEL_HIGH
@ MMA7660FC_SLEEP_COUNTER_PRESCALER_16
@ MMA7660FC_SLEEP_COUNTER_PRESCALER_1
@ MMA7660FC_AUTO_SLEEP_RATE_1
@ MMA7660FC_AUTO_SLEEP_RATE_120
@ MMA7660FC_AUTO_SLEEP_RATE_64
@ MMA7660FC_AUTO_SLEEP_RATE_8
@ MMA7660FC_AUTO_SLEEP_RATE_2
@ MMA7660FC_AUTO_SLEEP_RATE_16
@ MMA7660FC_AUTO_SLEEP_RATE_32
@ MMA7660FC_AUTO_SLEEP_RATE_4
@ MMA7660FC_TILT_DEBOUNCE_FILTER_DISABLE
@ MMA7660FC_TILT_DEBOUNCE_FILTER_5
@ MMA7660FC_TILT_DEBOUNCE_FILTER_2
@ MMA7660FC_TILT_DEBOUNCE_FILTER_8
@ MMA7660FC_TILT_DEBOUNCE_FILTER_4
@ MMA7660FC_TILT_DEBOUNCE_FILTER_3
@ MMA7660FC_TILT_DEBOUNCE_FILTER_7
@ MMA7660FC_TILT_DEBOUNCE_FILTER_6
@ MMA7660FC_AUTO_WAKE_RATE_16
@ MMA7660FC_AUTO_WAKE_RATE_8
@ MMA7660FC_AUTO_WAKE_RATE_32
@ MMA7660FC_AUTO_WAKE_RATE_1
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
mma7660fc handle structure definition
void(* delay_ms)(uint32_t ms)
void(* receive_callback)(uint8_t type)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
mma7660fc information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v