Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed8c601

Browse files
davids5dagar
authored andcommitted
Added TI ina226 I2C power monitor (PX4#11755)
1 parent d78a842 commit ed8c601

File tree

6 files changed

+1031
-0
lines changed

6 files changed

+1031
-0
lines changed

boards/px4/fmu-v5/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ px4_add_board(
4444
mkblctrl
4545
pca9685
4646
pmw3901
47+
power_monitor/ina226
4748
#protocol_splitter
4849
pwm_input
4950
pwm_out_sim

msg/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ set(msg_files
8888
position_setpoint.msg
8989
position_setpoint_triplet.msg
9090
power_button_state.msg
91+
power_monitor.msg
9192
pwm_input.msg
9293
qshell_req.msg
9394
qshell_retval.msg

msg/power_monitor.msg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# power monitor message
2+
3+
uint64 timestamp # Time since system start (microseconds)
4+
5+
float32 voltage_v # Voltage in volts, 0 if unknown
6+
float32 current_a # Current in amperes, -1 if unknown
7+
float32 power_w # power in watts, -1 if unknown
8+
int16 rconf
9+
int16 rsv
10+
int16 rbv
11+
int16 rp
12+
int16 rc
13+
int16 rcal
14+
int16 me
15+
int16 al
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
############################################################################
2+
#
3+
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# 2. Redistributions in binary form must reproduce the above copyright
12+
# notice, this list of conditions and the following disclaimer in
13+
# the documentation and/or other materials provided with the
14+
# distribution.
15+
# 3. Neither the name PX4 nor the names of its contributors may be
16+
# used to endorse or promote products derived from this software
17+
# without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22+
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23+
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26+
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27+
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28+
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29+
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
# POSSIBILITY OF SUCH DAMAGE.
31+
#
32+
############################################################################
33+
px4_add_module(
34+
MODULE drivers__ina226
35+
MAIN ina226
36+
COMPILE_FLAGS
37+
-Wno-cast-align # TODO: fix and enable
38+
SRCS
39+
ina226.cpp
40+
)

0 commit comments

Comments
 (0)