Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
db37cd8c
Commit
db37cd8c
authored
5 years ago
by
liubaoxu
Committed by
Lorenz Meier
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
BMP280:fix definition misspelling
from BPM280 to BMP280
parent
2b680766
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/drivers/barometer/bmp280/bmp280.cpp
+10
-10
10 additions, 10 deletions
src/drivers/barometer/bmp280/bmp280.cpp
src/drivers/barometer/bmp280/bmp280.h
+42
-42
42 additions, 42 deletions
src/drivers/barometer/bmp280/bmp280.h
with
52 additions
and
52 deletions
src/drivers/barometer/bmp280/bmp280.cpp
+
10
−
10
View file @
db37cd8c
...
...
@@ -214,23 +214,23 @@ BMP280::init()
_class_instance
=
register_class_devname
(
BARO_BASE_DEVICE_PATH
);
/* reset sensor */
_interface
->
set_reg
(
B
P
M280_VALUE_RESET
,
B
P
M280_ADDR_RESET
);
_interface
->
set_reg
(
BM
P
280_VALUE_RESET
,
BM
P
280_ADDR_RESET
);
usleep
(
10000
);
/* check id*/
if
(
_interface
->
get_reg
(
B
P
M280_ADDR_ID
)
!=
B
P
M280_VALUE_ID
)
{
PX4_WARN
(
"id of your baro is not: 0x%02x"
,
B
P
M280_VALUE_ID
);
if
(
_interface
->
get_reg
(
BM
P
280_ADDR_ID
)
!=
BM
P
280_VALUE_ID
)
{
PX4_WARN
(
"id of your baro is not: 0x%02x"
,
BM
P
280_VALUE_ID
);
return
-
EIO
;
}
/* set config, recommended settings */
_curr_ctrl
=
B
P
M280_CTRL_P16
|
B
P
M280_CTRL_T2
;
_interface
->
set_reg
(
_curr_ctrl
,
B
P
M280_ADDR_CTRL
);
_max_mesure_ticks
=
USEC2TICK
(
B
P
M280_MT_INIT
+
B
P
M280_MT
*
(
16
-
1
+
2
-
1
));
_interface
->
set_reg
(
B
P
M280_CONFIG_F16
,
B
P
M280_ADDR_CONFIG
);
_curr_ctrl
=
BM
P
280_CTRL_P16
|
BM
P
280_CTRL_T2
;
_interface
->
set_reg
(
_curr_ctrl
,
BM
P
280_ADDR_CTRL
);
_max_mesure_ticks
=
USEC2TICK
(
BM
P
280_MT_INIT
+
BM
P
280_MT
*
(
16
-
1
+
2
-
1
));
_interface
->
set_reg
(
BM
P
280_CONFIG_F16
,
BM
P
280_ADDR_CONFIG
);
/* get calibration and pre process them*/
_cal
=
_interface
->
get_calibration
(
B
P
M280_ADDR_CAL
);
_cal
=
_interface
->
get_calibration
(
BM
P
280_ADDR_CAL
);
_fcal
.
t1
=
_cal
->
t1
*
powf
(
2
,
4
);
_fcal
.
t2
=
_cal
->
t2
*
powf
(
2
,
-
14
);
...
...
@@ -445,7 +445,7 @@ BMP280::measure()
perf_begin
(
_measure_perf
);
/* start measure */
int
ret
=
_interface
->
set_reg
(
_curr_ctrl
|
B
P
M280_CTRL_MODE_FORCE
,
B
P
M280_ADDR_CTRL
);
int
ret
=
_interface
->
set_reg
(
_curr_ctrl
|
BM
P
280_CTRL_MODE_FORCE
,
BM
P
280_ADDR_CTRL
);
if
(
ret
!=
OK
)
{
perf_count
(
_comms_errors
);
...
...
@@ -470,7 +470,7 @@ BMP280::collect()
report
.
timestamp
=
hrt_absolute_time
();
report
.
error_count
=
perf_event_count
(
_comms_errors
);
bmp280
::
data_s
*
data
=
_interface
->
get_data
(
B
P
M280_ADDR_DATA
);
bmp280
::
data_s
*
data
=
_interface
->
get_data
(
BM
P
280_ADDR_DATA
);
if
(
data
==
nullptr
)
{
perf_count
(
_comms_errors
);
...
...
This diff is collapsed.
Click to expand it.
src/drivers/barometer/bmp280/bmp280.h
+
42
−
42
View file @
db37cd8c
...
...
@@ -38,48 +38,48 @@
*/
#pragma once
#define B
P
M280_ADDR_CAL 0x88
/* address of 12x 2 bytes calibration data */
#define B
P
M280_ADDR_DATA 0xF7
/* address of 2x 3 bytes p-t data */
#define B
P
M280_ADDR_CONFIG 0xF5
/* configuration */
#define B
P
M280_ADDR_CTRL 0xF4
/* controll */
#define B
P
M280_ADDR_STATUS 0xF3
/* state */
#define B
P
M280_ADDR_RESET 0xE0
/* reset */
#define B
P
M280_ADDR_ID 0xD0
/* id */
#define B
P
M280_VALUE_ID 0x58
/* chip id */
#define B
P
M280_VALUE_RESET 0xB6
/* reset */
#define B
P
M280_STATUS_MEASURING (1<<3)
/* if in process of measure */
#define B
P
M280_STATUS_COPING (1<<0)
/* if in process of data copy */
#define B
P
M280_CTRL_P0 (0x0<<2)
/* no p measure */
#define B
P
M280_CTRL_P1 (0x1<<2)
#define B
P
M280_CTRL_P2 (0x2<<2)
#define B
P
M280_CTRL_P4 (0x3<<2)
#define B
P
M280_CTRL_P8 (0x4<<2)
#define B
P
M280_CTRL_P16 (0x5<<2)
#define B
P
M280_CTRL_T0 (0x0<<5)
/* no t measure */
#define B
P
M280_CTRL_T1 (0x1<<5)
#define B
P
M280_CTRL_T2 (0x2<<5)
#define B
P
M280_CTRL_T4 (0x3<<5)
#define B
P
M280_CTRL_T8 (0x4<<5)
#define B
P
M280_CTRL_T16 (0x5<<5)
#define B
P
M280_CONFIG_F0 (0x0<<2)
/* no filter */
#define B
P
M280_CONFIG_F2 (0x1<<2)
#define B
P
M280_CONFIG_F4 (0x2<<2)
#define B
P
M280_CONFIG_F8 (0x3<<2)
#define B
P
M280_CONFIG_F16 (0x4<<2)
#define B
P
M280_CTRL_MODE_SLEEP 0x0
#define B
P
M280_CTRL_MODE_FORCE 0x1
/* on demand, goes to sleep after */
#define B
P
M280_CTRL_MODE_NORMAL 0x3
#define B
P
M280_MT_INIT 6400
/* max measure time of initial p + t in us */
#define B
P
M280_MT 2300
/* max measure time of p or t in us */
#define BM
P
280_ADDR_CAL 0x88
/* address of 12x 2 bytes calibration data */
#define BM
P
280_ADDR_DATA 0xF7
/* address of 2x 3 bytes p-t data */
#define BM
P
280_ADDR_CONFIG 0xF5
/* configuration */
#define BM
P
280_ADDR_CTRL 0xF4
/* controll */
#define BM
P
280_ADDR_STATUS 0xF3
/* state */
#define BM
P
280_ADDR_RESET 0xE0
/* reset */
#define BM
P
280_ADDR_ID 0xD0
/* id */
#define BM
P
280_VALUE_ID 0x58
/* chip id */
#define BM
P
280_VALUE_RESET 0xB6
/* reset */
#define BM
P
280_STATUS_MEASURING (1<<3)
/* if in process of measure */
#define BM
P
280_STATUS_COPING (1<<0)
/* if in process of data copy */
#define BM
P
280_CTRL_P0 (0x0<<2)
/* no p measure */
#define BM
P
280_CTRL_P1 (0x1<<2)
#define BM
P
280_CTRL_P2 (0x2<<2)
#define BM
P
280_CTRL_P4 (0x3<<2)
#define BM
P
280_CTRL_P8 (0x4<<2)
#define BM
P
280_CTRL_P16 (0x5<<2)
#define BM
P
280_CTRL_T0 (0x0<<5)
/* no t measure */
#define BM
P
280_CTRL_T1 (0x1<<5)
#define BM
P
280_CTRL_T2 (0x2<<5)
#define BM
P
280_CTRL_T4 (0x3<<5)
#define BM
P
280_CTRL_T8 (0x4<<5)
#define BM
P
280_CTRL_T16 (0x5<<5)
#define BM
P
280_CONFIG_F0 (0x0<<2)
/* no filter */
#define BM
P
280_CONFIG_F2 (0x1<<2)
#define BM
P
280_CONFIG_F4 (0x2<<2)
#define BM
P
280_CONFIG_F8 (0x3<<2)
#define BM
P
280_CONFIG_F16 (0x4<<2)
#define BM
P
280_CTRL_MODE_SLEEP 0x0
#define BM
P
280_CTRL_MODE_FORCE 0x1
/* on demand, goes to sleep after */
#define BM
P
280_CTRL_MODE_NORMAL 0x3
#define BM
P
280_MT_INIT 6400
/* max measure time of initial p + t in us */
#define BM
P
280_MT 2300
/* max measure time of p or t in us */
namespace
bmp280
{
...
...
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