diff --git a/bmi160_defs.h b/bmi160_defs.h index cc66c56..3e6b4cf 100644 --- a/bmi160_defs.h +++ b/bmi160_defs.h @@ -96,12 +96,12 @@ #endif #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1 +#ifndef BMI160_LITTLE_ENDIAN +#define BMI160_LITTLE_ENDIAN 1 #endif #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 1 +#ifndef BMI160_BIG_ENDIAN +#define BMI160_BIG_ENDIAN 1 #endif #else #error "Code does not support Endian format of the processor" @@ -755,7 +755,7 @@ enum bmi160_int_status_sel { */ struct bmi160_int_status_bits { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 uint32_t step : 1; uint32_t sigmot : 1; uint32_t anym : 1; @@ -788,7 +788,7 @@ struct bmi160_int_status_bits uint32_t orient_1_0 : 2; uint32_t orient_2 : 1; uint32_t flat : 1; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 uint32_t high_first_x : 1; uint32_t high_first_y : 1; uint32_t high_first_z : 1; @@ -1097,7 +1097,7 @@ enum bmi160_any_sig_motion_active_interrupt_state { }; struct bmi160_acc_tap_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! tap threshold */ uint16_t tap_thr : 5; @@ -1116,7 +1116,7 @@ struct bmi160_acc_tap_int_cfg /*! tap enable, 1 - enable, 0 - disable */ uint16_t tap_en : 1; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! tap enable, 1 - enable, 0 - disable */ uint16_t tap_en : 1; @@ -1139,7 +1139,7 @@ struct bmi160_acc_tap_int_cfg }; struct bmi160_acc_any_mot_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! 1 any-motion enable, 0 - any-motion disable */ uint8_t anymotion_en : 1; @@ -1161,7 +1161,7 @@ struct bmi160_acc_any_mot_int_cfg /*! slope threshold */ uint8_t anymotion_thr; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! slope threshold */ uint8_t anymotion_thr; @@ -1187,7 +1187,7 @@ struct bmi160_acc_any_mot_int_cfg }; struct bmi160_acc_sig_mot_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! skip time of sig-motion interrupt */ uint8_t sig_mot_skip : 2; @@ -1203,7 +1203,7 @@ struct bmi160_acc_sig_mot_int_cfg /*! sig-motion threshold */ uint8_t sig_mot_thres; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! sig-motion threshold */ uint8_t sig_mot_thres; @@ -1223,7 +1223,7 @@ struct bmi160_acc_sig_mot_int_cfg }; struct bmi160_acc_step_detect_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! 1- step detector enable, 0- step detector disable */ uint16_t step_detector_en : 1; @@ -1239,7 +1239,7 @@ struct bmi160_acc_step_detect_int_cfg /*! minimum step buffer size*/ uint16_t step_min_buf : 3; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! minimum step buffer size*/ uint16_t step_min_buf : 3; @@ -1259,7 +1259,7 @@ struct bmi160_acc_step_detect_int_cfg }; struct bmi160_acc_no_motion_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! no motion interrupt x */ uint16_t no_motion_x : 1; @@ -1281,7 +1281,7 @@ struct bmi160_acc_no_motion_int_cfg /*! no motion threshold */ uint8_t no_motion_thres; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! no motion threshold */ uint8_t no_motion_thres; @@ -1307,7 +1307,7 @@ struct bmi160_acc_no_motion_int_cfg }; struct bmi160_acc_orient_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! thresholds for switching between the different orientations */ uint16_t orient_mode : 2; @@ -1329,7 +1329,7 @@ struct bmi160_acc_orient_int_cfg /*! 1 - orient enable, 0 - orient disable */ uint8_t orient_en : 1; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! 1 - orient enable, 0 - orient disable */ uint8_t orient_en : 1; @@ -1355,7 +1355,7 @@ struct bmi160_acc_orient_int_cfg }; struct bmi160_acc_flat_detect_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! flat threshold */ uint16_t flat_theta : 6; @@ -1369,7 +1369,7 @@ struct bmi160_acc_flat_detect_int_cfg /*! 1 - flat enable, 0 - flat disable */ uint16_t flat_en : 1; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! 1 - flat enable, 0 - flat disable */ uint16_t flat_en : 1; @@ -1387,7 +1387,7 @@ struct bmi160_acc_flat_detect_int_cfg }; struct bmi160_acc_low_g_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! low-g interrupt trigger delay */ uint8_t low_dur; @@ -1406,7 +1406,7 @@ struct bmi160_acc_low_g_int_cfg /*! 1 - enable low-g, 0 - disable low-g */ uint8_t low_en : 1; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! 1 - enable low-g, 0 - disable low-g */ uint8_t low_en : 1; @@ -1429,7 +1429,7 @@ struct bmi160_acc_low_g_int_cfg }; struct bmi160_acc_high_g_int_cfg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! High-g interrupt x, 1 - enable, 0 - disable */ uint8_t high_g_x : 1; @@ -1451,7 +1451,7 @@ struct bmi160_acc_high_g_int_cfg /*! High-g duration */ uint8_t high_dur; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! High-g duration */ uint8_t high_dur; @@ -1477,7 +1477,7 @@ struct bmi160_acc_high_g_int_cfg }; struct bmi160_int_pin_settg { -#if LITTLE_ENDIAN == 1 +#if BMI160_LITTLE_ENDIAN == 1 /*! To enable either INT1 or INT2 pin as output. * 0- output disabled ,1- output enabled */ @@ -1499,7 +1499,7 @@ struct bmi160_int_pin_settg /*! latch duration*/ uint16_t latch_dur : 4; -#elif BIG_ENDIAN == 1 +#elif BMI160_BIG_ENDIAN == 1 /*! latch duration*/ uint16_t latch_dur : 4;