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.
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
SNS - Time-of-flight Sensor #25
base: master
Are you sure you want to change the base?
SNS - Time-of-flight Sensor #25
Changes from 16 commits
5532a5c
38d92d0
bb9f4e7
870d204
e1a1434
8f980a2
6651f1b
97bf3d2
d0078d0
ecc2815
027bf56
e9d43a6
549cfea
006b989
f411a77
e6b983c
792f914
a40394d
e77ffe7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
what are these for?
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 sensor has two modes of operation: Single shot, and continuous. Single shot is a single measurement, while continuous will repeatedly measure the range with a time interval based on the value of
kSysRangeIntermeasurementPeriod
. Before reading in a given mode, registerkSysRangeStart
has to be set to either 1 or 3Because the code to check that
kSysRangeStart
has the correct value is the same whether its checking for continuous or single-shot, and because the register to read the range from is the same in both cases ifkSysRangeStart
has the correct value (kResultRangeVal
),getRangeSingleShot()
andgetRangeContinuous()
call these separate functions to retrieve the rangeAs for which value will be wanted, single shot or continous, that's yet to be decided
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.
this is scary, we need to be able to guarantee that it can't get stuck in this loop
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 sure where exactly they've been taken from, or what they all mean - Are these 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.
The datasheet gives this register an address of
0x040
, but the application note AN4545 gives this register an address of0x0041
on page 24There 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.
lmfao of course it does
engineers write a useful datasheet challenge (impossible)