Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename LITTLE_ENDIAN and BIG_ENDIAN defines #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions bmi160_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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 */
Expand All @@ -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;
Expand Down