Skip to content

Commit 1e51e8c

Browse files
committed
Update Device Tree
1 parent 1a81717 commit 1e51e8c

File tree

10 files changed

+53
-43
lines changed

10 files changed

+53
-43
lines changed

FprimeZephyrReference/Components/Drv/Ina219Manager/Ina219Manager.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "FprimeZephyrReference/Components/Drv/Ina219Manager/Ina219Manager.hpp"
88
#include <Fw/Types/Assert.hpp>
99

10-
1110
namespace Drv {
1211

1312
// ----------------------------------------------------------------------
@@ -18,7 +17,7 @@ Ina219Manager ::Ina219Manager(const char* const compName) : Ina219ManagerCompone
1817

1918
Ina219Manager ::~Ina219Manager() {}
2019

21-
void Ina219Manager::configure(const struct device *dev) {
20+
void Ina219Manager::configure(const struct device* dev) {
2221
this->m_dev = dev;
2322
}
2423

@@ -27,13 +26,13 @@ void Ina219Manager::configure(const struct device *dev) {
2726
// ----------------------------------------------------------------------
2827

2928
F64 Ina219Manager ::currentGet_handler(FwIndexType portNum) {
30-
if(!device_is_ready(this->m_dev)) {
29+
if (!device_is_ready(this->m_dev)) {
3130
this->log_WARNING_HI_DeviceNotReady();
3231
return 0;
3332
}
3433
this->log_WARNING_HI_DeviceNotReady_ThrottleClear();
3534

36-
struct sensor_value current;
35+
struct sensor_value current;
3736

3837
sensor_sample_fetch_chan(this->m_dev, SENSOR_CHAN_CURRENT);
3938

@@ -45,38 +44,38 @@ F64 Ina219Manager ::currentGet_handler(FwIndexType portNum) {
4544
}
4645

4746
F64 Ina219Manager ::powerGet_handler(FwIndexType portNum) {
48-
if(!device_is_ready(this->m_dev)) {
47+
if (!device_is_ready(this->m_dev)) {
4948
this->log_WARNING_HI_DeviceNotReady();
5049
return 0;
5150
}
5251
this->log_WARNING_HI_DeviceNotReady_ThrottleClear();
5352

54-
struct sensor_value power;
53+
struct sensor_value power;
5554

5655
sensor_sample_fetch_chan(this->m_dev, SENSOR_CHAN_POWER);
5756

5857
sensor_channel_get(this->m_dev, SENSOR_CHAN_POWER, &power);
5958

6059
this->tlmWrite_Current(sensor_value_to_double(&power));
61-
60+
6261
return sensor_value_to_double(&power);
6362
}
6463

6564
F64 Ina219Manager ::voltageGet_handler(FwIndexType portNum) {
66-
if(!device_is_ready(this->m_dev)) {
65+
if (!device_is_ready(this->m_dev)) {
6766
this->log_WARNING_HI_DeviceNotReady();
6867
return 0;
6968
}
7069
this->log_WARNING_HI_DeviceNotReady_ThrottleClear();
7170

72-
struct sensor_value voltage;
71+
struct sensor_value voltage;
7372

7473
sensor_sample_fetch_chan(this->m_dev, SENSOR_CHAN_VOLTAGE);
7574

7675
sensor_channel_get(this->m_dev, SENSOR_CHAN_VOLTAGE, &voltage);
7776

7877
this->tlmWrite_Current(sensor_value_to_double(&voltage));
79-
78+
8079
return sensor_value_to_double(&voltage);
8180
}
8281

FprimeZephyrReference/Components/Drv/Ina219Manager/Ina219Manager.fpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Drv {
88
@ Manager for Ina219 device
99
passive component Ina219Manager {
1010

11-
#Ports
11+
#Ports
1212
@ Port to read the voltage in volts
1313
sync input port voltageGet: VoltageGet
1414

@@ -18,20 +18,20 @@ module Drv {
1818
@ Port to read the power in watts
1919
sync input port powerGet: PowerGet
2020

21-
# Telemetry channels
21+
# Telemetry channels
2222

23-
@ Telemtry channel for voltage in volts
23+
@ Telemetry channel for voltage in volts
2424
telemetry Voltage: F64
2525

26-
@ Telemtry channel for current in amps
26+
@ Telemetry channel for current in amps
2727
telemetry Current: F64
2828

29-
@ Telemtry channel for power in watts
29+
@ Telemetry channel for power in watts
3030
telemetry Power: F64
3131

32-
@ Event for reporting INA219 not ready error
32+
@ Event for reporting INA219 not ready error
3333
event DeviceNotReady() severity warning high format "INA219 device not ready" throttle 5
34-
34+
3535

3636
###############################################################################
3737
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
@@ -49,4 +49,4 @@ module Drv {
4949
telemetry port tlmOut
5050

5151
}
52-
}
52+
}

FprimeZephyrReference/Components/Drv/Ina219Manager/Ina219Manager.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Ina219Manager final : public Ina219ManagerComponentBase {
2727
//! Destroy Ina219Manager object
2828
~Ina219Manager();
2929

30-
void configure(const struct device *dev); // helper function to configure device for the class
30+
void configure(const struct device* dev); // helper function to configure device for the class
3131

3232
private:
3333
// ----------------------------------------------------------------------
@@ -52,13 +52,12 @@ class Ina219Manager final : public Ina219ManagerComponentBase {
5252
F64 voltageGet_handler(FwIndexType portNum //!< The port number
5353
) override;
5454

55-
5655
// ----------------------------------------------------------------------
5756
// Member variables
5857
// ----------------------------------------------------------------------
5958

6059
//! Zephyr device stores the initialized LIS2MDL sensor
61-
const struct device* m_dev;
60+
const struct device* m_dev;
6261
};
6362

6463
} // namespace Drv

FprimeZephyrReference/Components/Drv/Ina219Manager/docs/sdd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Add requirements in the chart below
6363
## Change Log
6464
| Date | Description |
6565
|---|---|
66-
|---| Initial Draft |
66+
|---| Initial Draft |

FprimeZephyrReference/Components/PowerMonitor/PowerMonitor.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ module Components {
1919
time get port timeCaller
2020

2121
}
22-
}
22+
}

FprimeZephyrReference/Components/PowerMonitor/docs/sdd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Add requirements in the chart below
6363
## Change Log
6464
| Date | Description |
6565
|---|---|
66-
|---| Initial Draft |
66+
|---| Initial Draft |

FprimeZephyrReference/ReferenceDeployment/Main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const struct device* ina219Sol = device_get_binding("INA219 sol");
1515
const struct device* serial = DEVICE_DT_GET(DT_NODELABEL(cdc_acm_uart0));
1616
const struct device* lora = DEVICE_DT_GET(DT_NODELABEL(lora0));
1717

18-
1918
int main(int argc, char* argv[]) {
2019
// ** DO NOT REMOVE **//
2120
//
@@ -30,8 +29,6 @@ int main(int argc, char* argv[]) {
3029
inputs.loraDevice = lora;
3130
inputs.uartDevice = serial;
3231
inputs.baudRate = 115200;
33-
34-
3532

3633
// Setup, cycle, and teardown topology
3734
ReferenceDeployment::setupTopology(inputs);

FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopologyDefs.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ namespace ReferenceDeployment {
6969
* autocoder. The contents are entirely up to the definition of the project. This deployment uses subtopologies.
7070
*/
7171
struct TopologyState {
72-
const device* ina219SysDevice; //!< device path for battery board ina219
73-
const device* ina219SolDevice; //!< device path for solar panel ina219
72+
const device* ina219SysDevice; //!< device path for battery board ina219
73+
const device* ina219SolDevice; //!< device path for solar panel ina219
7474
const device* uartDevice; //!< UART device path for communication
7575
const device* loraDevice; //!< LoRa device path for communication
7676
U32 baudRate; //!< Baud rate for UART communication

boards/bronco_space/proves_flight_control_board_v5/proves_flight_control_board_v5-pinctrl.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
input-enable;
2222
};
2323
};
24+
i2c0_default: i2c0_default {
25+
group1 {
26+
pinmux = <I2C0_SCL_P24>, <I2C0_SDA_P25>;
27+
input-enable;
28+
};
29+
};
2430
i2c1_default: i2c1_default {
2531
group1 {
2632
pinmux = <I2C1_SCL_P3>, <I2C1_SDA_P2>;

boards/bronco_space/proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,29 @@ zephyr_udc0: &usbd {
135135
};
136136
};
137137

138+
&i2c0 {
139+
status = "okay";
140+
pinctrl-0 = <&i2c0_default>;
141+
pinctrl-names = "default";
142+
clock-frequency = <100000>;
143+
144+
ina219Sys: ina219Sys@40 {
145+
compatible = "ti,ina219";
146+
reg = <0x40>;
147+
shunt-milliohm = <2>;
148+
lsb-microamp = <100>;
149+
label = "INA219 sys";
150+
};
151+
ina219Sol: ina219Sol@41 {
152+
compatible = "ti,ina219";
153+
reg = <0x41>;
154+
shunt-milliohm = <2>;
155+
lsb-microamp = <100>;
156+
label = "INA219 sol";
157+
};
158+
};
159+
160+
138161
&i2c1 {
139162
status = "okay";
140163
pinctrl-0 = <&i2c1_default>;
@@ -159,18 +182,4 @@ zephyr_udc0: &usbd {
159182
backup-switch-mode = "direct";
160183
label = "RV3028";
161184
};
162-
ina219Sys: ina219Sys@40 {
163-
compatible = "ti,ina219";
164-
reg = <0x40>;
165-
shunt-milliohm = <2>;
166-
lsb-microamp = <100>;
167-
label = "INA219 sys";
168-
};
169-
ina219Sol: ina219Sol@41 {
170-
compatible = "ti,ina219";
171-
reg = <0x41>;
172-
shunt-milliohm = <2>;
173-
lsb-microamp = <100>;
174-
label = "INA219 sol";
175-
};
176185
};

0 commit comments

Comments
 (0)