}
}
+// Platform sensor orientatation
+#define DEF_ORIENT_ACCEL_X -1
+#define DEF_ORIENT_ACCEL_Y -1
+#define DEF_ORIENT_ACCEL_Z -1
+
+#define DEF_ORIENT_GYRO_X -1
+#define DEF_ORIENT_GYRO_Y -1
+#define DEF_ORIENT_GYRO_Z -1
+
// G to m/s2
#define CONVERT_FROM_VTF16(s,d,x) (convert_from_vtf_format(s,d,x))
-#define CONVERT_A_G_VTF16E14_X(s,d,x) (convert_from_vtf_format(s,d,x)*GRAVITY)
-#define CONVERT_A_G_VTF16E14_Y(s,d,x) (convert_from_vtf_format(s,d,x)*GRAVITY)
-#define CONVERT_A_G_VTF16E14_Z(s,d,x) (convert_from_vtf_format(s,d,x)*GRAVITY)
+#define CONVERT_A_G_VTF16E14_X(s,d,x) (DEF_ORIENT_ACCEL_X *\
+ convert_from_vtf_format(s,d,x)*GRAVITY)
+#define CONVERT_A_G_VTF16E14_Y(s,d,x) (DEF_ORIENT_ACCEL_Y *\
+ convert_from_vtf_format(s,d,x)*GRAVITY)
+#define CONVERT_A_G_VTF16E14_Z(s,d,x) (DEF_ORIENT_ACCEL_Z *\
+ convert_from_vtf_format(s,d,x)*GRAVITY)
// Degree/sec to radian/sec
-#define CONVERT_G_D_VTF16E14_X(s,d,x) (convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
-#define CONVERT_G_D_VTF16E14_Y(s,d,x) (convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
-#define CONVERT_G_D_VTF16E14_Z(s,d,x) (convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
+#define CONVERT_G_D_VTF16E14_X(s,d,x) (DEF_ORIENT_GYRO_X *\
+ convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
+#define CONVERT_G_D_VTF16E14_Y(s,d,x) (DEF_ORIENT_GYRO_Y *\
+ convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
+#define CONVERT_G_D_VTF16E14_Z(s,d,x) (DEF_ORIENT_GYRO_Z *\
+ convert_from_vtf_format(s,d,x) * ((float)M_PI/180.0f))
// Milli gauss to micro tesla
#define CONVERT_M_MG_VTF16E14_X(s,d,x) (convert_from_vtf_format(s,d,x)/10)
static const std::string IIO_DIR = "/sys/bus/iio/devices";
static const int DEF_BUFFER_LEN = 2;
+static const int DEF_HYST_VALUE = 0;
SensorIIODev::SensorIIODev(const std::string& dev_name, const std::string& units,
const std::string& exponent,
goto err_ret;
if (DeviceActivate(GetDeviceNumber(), 1) < 0)
goto err_ret;
- if (DeviceSetSensitivity(GetDeviceNumber(), 1) < 0)
+ if (DeviceSetSensitivity(GetDeviceNumber(), DEF_HYST_VALUE) < 0)
goto err_ret;
if (AllocateRxBuffer() < 0)
goto err_ret;