Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
0c6bb318
Commit
0c6bb318
authored
2 years ago
by
Fabrizio Monti
Committed by
Alberto Nidasio
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[LSM6DSRX] Modified initInterrupts() in order to have 2 spi writes instead of 4.
parent
4135c4fc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/sensors/LSM6DSRX/LSM6DSRX.cpp
+11
-13
11 additions, 13 deletions
src/shared/sensors/LSM6DSRX/LSM6DSRX.cpp
src/shared/sensors/LSM6DSRX/LSM6DSRXConfig.h
+11
-2
11 additions, 2 deletions
src/shared/sensors/LSM6DSRX/LSM6DSRXConfig.h
with
22 additions
and
15 deletions
src/shared/sensors/LSM6DSRX/LSM6DSRX.cpp
+
11
−
13
View file @
0c6bb318
...
...
@@ -210,23 +210,21 @@ void LSM6DSRX::initFifo()
void
LSM6DSRX
::
initInterrupts
()
{
uint8_t
ui8Value
=
0
;
uint8_t
buf
[]
=
{
0
,
0
}
;
SPITransaction
spi
{
spiSlave
};
// set interrupt on pin INT1
spi
.
writeRegister
(
LSM6DSRXDefs
::
REG_INT1_CTRL
,
static_cast
<
uint8_t
>
(
config
.
int1InterruptSelection
));
// set interrupt on pin INT2
spi
.
writeRegister
(
LSM6DSRXDefs
::
REG_INT2_CTRL
,
static_cast
<
uint8_t
>
(
config
.
int2InterruptSelection
));
buf
[
0
]
=
static_cast
<
uint8_t
>
(
config
.
int1InterruptSelection
);
// set interrupt on pin INT1
buf
[
1
]
=
static_cast
<
uint8_t
>
(
config
.
int2InterruptSelection
);
// set interrupt on pin INT2
spi
.
writeRegisters
(
LSM6DSRXDefs
::
REG_INT1_CTRL
,
buf
,
2
);
// set watermark level
ui8Value
=
static_cast
<
uint8_t
>
(
config
.
fifoWatermark
&
buf
[
0
]
=
static_cast
<
uint8_t
>
(
config
.
fifoWatermark
&
255
);
// the first 8bits of the number.
spi
.
writeRegister
(
LSM6DSRXDefs
::
REG_FIFO_CTRL1
,
ui8Value
);
ui8Value
=
static_cast
<
uint8_t
>
((
config
.
fifoWatermark
>>
8
)
&
buf
[
1
]
=
static_cast
<
uint8_t
>
((
config
.
fifoWatermark
>>
8
)
&
0x01
);
// the 9th bit of the number.
spi
.
writeRegister
(
LSM6DSRXDefs
::
REG_FIFO_CTRL
2
,
ui8Value
);
spi
.
writeRegister
s
(
LSM6DSRXDefs
::
REG_FIFO_CTRL
1
,
buf
,
2
);
}
bool
LSM6DSRX
::
selfTestAcc
()
...
...
This diff is collapsed.
Click to expand it.
src/shared/sensors/LSM6DSRX/LSM6DSRXConfig.h
+
11
−
2
View file @
0c6bb318
...
...
@@ -200,8 +200,17 @@ struct LSM6DSRXConfig
// interrupt
INTERRUPT
int1InterruptSelection
;
///< interrupts selected on INT1 pin.
INTERRUPT
int2InterruptSelection
;
///< interrupts selected on INT2 pin.
uint16_t
fifoWatermark
;
///< fifo watermark level (expressed as number of
///< sample). Expressed as a 9 bits number.
/**
* @brief Fifo watermark level (expressed as a 9 bits number). Warning: this
* number represents the number of samples extracted from the sensor's fifo,
* not the actual number of samples that will be present inside the driver's
* fifo `lastFifo`.
*
* The sensor's fifo max size is 511 samples, and those samples can be
* accelerometer data, gyroscope data or timestamps.
*/
uint16_t
fifoWatermark
;
};
}
// namespace Boardcore
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment