AnsweredAssumed Answered

ADXL345 Android driver

Question asked by Mack on Apr 29, 2014
Latest reply on Apr 29, 2014 by mhennerich

Hello,

 

Below is adxl34x's platform data.

If I change the order of values in the array named  .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C} can I make each axis upside down?

 

#include <linux/input/adxl34x.h>

static const struct adxl34x_platform_data adxl34x_info = {

.x_axis_offset = 0,

.y_axis_offset = 0,

.z_axis_offset = 0,

.tap_threshold = 0x31,

.tap_duration = 0x10,

.tap_latency = 0x60,

.tap_window = 0xF0,

.tap_axis_control = 0,

.act_axis_control = 0xFF,

.activity_threshold = 5,

.inactivity_threshold = 3,

.inactivity_time = 4,

.free_fall_threshold = 0x7,

.free_fall_time = 0x20,

.data_rate = 0x8,

.data_range = ADXL_FULL_RES,

 

.ev_type = EV_ABS,

.ev_code_x = ABS_X, /* EV_REL */

.ev_code_y = ABS_Y, /* EV_REL */

.ev_code_z = ABS_Z, /* EV_REL */

 

.ev_code_tap = {BTN_0, BTN_1, BTN_2}, /* EV_KEY x,y,z */

 

/*     .ev_code_ff = KEY_F,*/ /* EV_KEY */

/*     .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */

.power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,

.fifo_mode = ADXL_FIFO_STREAM,

.orientation_enable = 0, /* Disable Orientation Reports */

.deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,

.divisor_length =  ADXL_LP_FILTER_DIVISOR_16,

/* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */

.ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},

};

 

Best Regards,

Mack.

Outcomes