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
Added 2 IMU I2C drivers, SPI mode and bus speed option, fixed 1 I2C read bug, etc. #14168
Closed
Closed
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
72a03b7
add I2C drivers to 2 IMU sensors, add SPI mode and bus frequency opti…
55e0d4c
merge with upstream master
UAV-Pilot a95c88e
re-formatted imu code changes for text alignment
UAV-Pilot 07fe515
reformatted code according to astyle requirement
UAV-Pilot 14f8815
handle format identifier %u %lu %llu on different platforms
UAV-Pilot 622b753
handle format identifier %u %lu %llu for 1 file
UAV-Pilot fdfaf8f
Update src/drivers/distance_sensor/vl53lxx/vl53lxx.cpp
UAV-Pilot 768a519
Update src/drivers/imu/bmi088/BMI088_accel.hpp
UAV-Pilot 63cd80a
get rid of the platform define __PX4_NUTTX; use px4_usleep on all pla…
UAV-Pilot 921b5a3
fixed inconsistent parameter issue with MPU9250_I2C_interface
UAV-Pilot 5961031
roll one %lu back to %llu
UAV-Pilot 34f9281
Merge remote-tracking branch 'upstream/master'
UAV-Pilot c1a67de
fixed an implicit conversion issue
UAV-Pilot 0c14cc9
Merge branch 'master' of https://github.com/PX4/Firmware
UAV-Pilot f55d8f9
Merge remote-tracking branch 'upstream/master'
UAV-Pilot 0e73d4b
changed some size_t to int per review comments and changed %lu back t…
UAV-Pilot 8340418
removed one cast
UAV-Pilot 9527be3
Merge remote-tracking branch 'upstream/master'
UAV-Pilot a5afb96
moved SPI/I2C read/write register APIs to upper classes, plus other m…
UAV-Pilot 4ddcc18
removed some PX4_INFO, etc
UAV-Pilot 291601f
add return type to write_reg for more sensors
UAV-Pilot 2bead77
handle return type of write_reg in more drivers
UAV-Pilot 25d786d
sync to upstream
UAV-Pilot 238f0dd
removed some override
UAV-Pilot 849a853
removed more PX4_INFO and corrected some formats, etc
UAV-Pilot d7ebc0c
match ioctl API with the one in its super class
UAV-Pilot 247e2a0
added using file_t
UAV-Pilot bf963ed
Merge branch 'master' into master
dagar 501ae72
To fix fxas21002c SPI issue on NuttX, and to prevent accidentally ena…
UAV-Pilot 6c78716
Merge branch 'master' of https://github.com/UAV-Pilot/Firmware
UAV-Pilot d8e2575
remove read_reg/write_reg from base classes
UAV-Pilot a68f6d6
Merge branch 'master' of https://github.com/UAV-Pilot/Firmware
UAV-Pilot File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is setting the spi mode on the command line necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The host system currently cannot support default SPI Mode 3, so a way to use other mode is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't the host system change the SPI mode?
In the case of the bmp280 it appears to support both SPI mode 0 and 3. We could also simply change the only supported bmp280 spi mode depending on where this requirement is coming from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPI mode 3 currently does not work on the host system. With mode 3, it cannot go pass probe (whoami) phase. But the host system is currently working with spi mode 0. Changing default spi mode of bmp280 to spi mode 0 might break other systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which host system is this? Can we set the SPI mode from the board configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct SPI communication between SPI master and slaves highly depends on maximum supported frequency and relative timing of CLK, CS, MISO and MOSI signal, so no matter what kind of host system is in use, it's better to have option to customize bus frequency and SPI mode. I guess the intent to set SPI mode in board configuration is to apply the same SPI mode to all SPI sensors attached to the board, but it cannot deal with the case that some sensors work with only one SPI mode while others only work with a different SPI mode. Setting SPI mode at individual sensor level is more flexible as it allows choosing the best matching mode between master and slave for an individual sensor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, we can also do it per-device. I'm working on some general improvements around that in #14156. I don't have a clear preference.