Skip to content

Conversation

badfishblues
Copy link

Description

  • Library to support the Bosch BMI160 IMU with the BMM150 magnetometer connected as an auxillary sensor
  • Community effort with some untested functions, some of which have been commented out as a safety

New Features

  • getMotion9() to read all nine axis of data and the rhall values simultaneously
    • has been cross referenced and tested against Bosch API
  • misc BMM150 support

@hanyazou
Copy link
Owner

Thank you for your contribution.
Because I don't have any time to test your code for now, I'm not sure if your code run on BMI160 w/o BMI150.
Did you try your changes with BMI160 without BMM150?
If your changes does not affect existing code and behavior, I can marge your changes into the repository.

badfishblues and others added 2 commits October 31, 2019 15:35
* added suspendIMU and get_bit

* Updated to 0.2.0
* wip with compile errors

* wip: compiling

* WIP: compiling, but mag not streaming

* Almost working

* FIFO seems to work at 25hz, but can't change freq

* Minor cleanup.

* Changed library Version in library.properties
void BMI160Class::resetStepCount() {
reg_write(BMI160_RA_CMD, BMI160_CMD_STEP_CNT_CLR);
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

*/
uint8_t BMI160Class::getMotionDetectionThreshold() {
return reg_read(BMI160_RA_INT_MOTION_1);
return reg_read(BMI160_RA_INT_MOTION_1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

*/
void BMI160Class::setMotionDetectionThreshold(uint8_t threshold) {
return reg_write(BMI160_RA_INT_MOTION_1, threshold);
return reg_write(BMI160_RA_INT_MOTION_1, threshold);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

BMI160_ANYMOTION_DUR_LEN);
return 1 + reg_read_bits(BMI160_RA_INT_MOTION_0,
BMI160_ANYMOTION_DUR_BIT,
BMI160_ANYMOTION_DUR_LEN);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

BMI160_ANYMOTION_DUR_LEN);
reg_write_bits(BMI160_RA_INT_MOTION_0, samples - 1,
BMI160_ANYMOTION_DUR_BIT,
BMI160_ANYMOTION_DUR_LEN);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?


/** Get zero motion detection event acceleration threshold.
* This register configures the detection threshold for Zero Motion interrupt
* generation in the INT_MOTION[1] register. The unit of threshold is
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

uint8_t getMotionDetectionDuration();
void setMotionDetectionDuration(uint8_t duration);
uint8_t getMotionDetectionDuration();
void setMotionDetectionDuration(uint8_t duration);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

void setMagFIFOEnabled(bool enabled); //Added for BMM150 Support

bool getIntFIFOBufferFullEnabled();
void setIntFIFOBufferFullEnabled(bool enabled);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent looks strange here.

bool getIntDataReadyEnabled();
void setIntDataReadyEnabled(bool enabled);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?

void getAcceleration(int16_t* x, int16_t* y, int16_t* z);
void getMotion9(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz, uint16_t* rh); //Added for BMM150 Support
void extractMotion9(uint8_t* buffer, int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz, uint16_t* rh); //Added for BMM150 Support
void getAcceleration(int16_t* x, int16_t* y, int16_t* z);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please eliminate these unintentional changes?
Please fix indentation here.


uint8_t getRegister(uint8_t reg);
void setRegister(uint8_t reg, uint8_t data);
void setRegister(uint8_t reg, uint8_t data, uint8_t bitMask);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct the indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants