Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a563640
Add load switch component
kevinthegreat1 Oct 9, 2025
5d5648f
Fix tables
kevinthegreat1 Oct 23, 2025
8f00e03
Sarah Kevin MoMata Squad Load Switch
hyuncat Oct 23, 2025
628fcbe
Sarah Kevin and MoMata fixed a bug
hyuncat Oct 23, 2025
91b25fe
Commit farming
hyuncat Oct 23, 2025
076bf65
Added mcp23017 to v5 dtsi
moisesmata Oct 23, 2025
24a2e97
Rough initial implementation + add to topology
moisesmata Oct 23, 2025
3761180
Ion even know any mane
moisesmata Oct 23, 2025
bcb6f24
Merged in Main
Mikefly123 Nov 3, 2025
3fec032
Working Device Tree (But F Prime Crash)
Mikefly123 Nov 3, 2025
09c61fd
Update CommandDispatcherImplCfg.hpp
Mikefly123 Nov 3, 2025
b5544e7
Update Submodules
moisesmata Nov 4, 2025
5351c58
Revert "Update Submodules"
Mikefly123 Nov 5, 2025
e90ffe7
need to add manager next
yudataguy Nov 5, 2025
db0bc82
Updated Device Tree
Mikefly123 Nov 5, 2025
46e6604
Add Reset port functionality
moisesmata Nov 6, 2025
98326f2
Add remaining load switch instances
kevinthegreat1 Nov 6, 2025
9c72d7a
Small updates to extra loadSwitch instances, update max packets
moisesmata Nov 6, 2025
d7fce15
Remove output read port, add output write port
moisesmata Nov 6, 2025
c633bf9
add magnetorquer component
hrfarmer Nov 6, 2025
b456c1d
switch to use new device initialization pattern
hrfarmer Nov 6, 2025
7ee7e14
increase command limit
hrfarmer Nov 7, 2025
bdb6202
update dtsi
hrfarmer Nov 7, 2025
d476593
update everything to handle multiple devices initialized
hrfarmer Nov 7, 2025
42106ed
Merge branch 'load-switch' into magnetorquer
hrfarmer Nov 7, 2025
194a67a
Hello World
Mikefly123 Nov 7, 2025
c5f9066
current working tmp112 sensors
yudataguy Nov 8, 2025
ace3c3c
merged w/ magnetorque, then some fixes
yudataguy Nov 10, 2025
c1e1efb
maybe not the best working code, possible revert to previous commit
yudataguy Nov 12, 2025
712cc6f
Remove loadswitch
nateinaction Nov 26, 2025
59acff8
Merge branch 'main' of github.com:open-source-space-foundation/proves…
nateinaction Nov 27, 2025
2898d23
Reduce lines changed
nateinaction Nov 27, 2025
058b607
Building with Michael certified device tree
nateinaction Nov 27, 2025
47ef8b6
Return success conditions and attempt init every time
nateinaction Nov 27, 2025
6cf3048
GenericDeviceMonitor for tca and mux channels
nateinaction Nov 28, 2025
2e3fe4e
Detect mux channel state in thermal manager
nateinaction Nov 28, 2025
105d790
Rate group cycle constantly slipping, resetting board
nateinaction Nov 28, 2025
27fdc9b
Seeing i/o error
nateinaction Nov 28, 2025
ee24b13
sleepy nighttime thoughts
nateinaction Nov 28, 2025
5923d5e
Updated DTSI Mux Regs
Mikefly123 Nov 28, 2025
845f438
Revert "sleepy nighttime thoughts"
nateinaction Nov 28, 2025
2a7dd57
Merge branch 'temp-sensor' of github.com:open-source-space-foundation…
nateinaction Nov 28, 2025
c3119fe
All faces working
nateinaction Nov 28, 2025
88af688
Add mux 6
nateinaction Nov 28, 2025
65f2a4c
Starting light sensor
nateinaction Nov 29, 2025
97475a6
Remove I2C debug lines from prj.conf
nateinaction Nov 29, 2025
496ec12
Saving progress
nateinaction Nov 30, 2025
c52a18d
It's building...
nateinaction Dec 1, 2025
8f76f87
Defer init for all devices on mux
nateinaction Dec 1, 2025
8353810
Defer init for all devices on mux
nateinaction Dec 1, 2025
d4cc098
syncing latest from device tree branch
nateinaction Dec 1, 2025
7dd9052
latest from loadswitch branch
nateinaction Dec 1, 2025
8c8f4a8
Running
nateinaction Dec 1, 2025
6b86530
Revert "Running"
nateinaction Dec 1, 2025
8a47a27
Reapply "Running"
nateinaction Dec 1, 2025
c2ffb68
capitalization
nateinaction Dec 1, 2025
fdf6894
Clean up thermal manager, thanks for the tip Saidi!
nateinaction Dec 1, 2025
c578181
Fill out VELM6031 functionality
nateinaction Dec 1, 2025
2eba75d
Add ADCS component, still not in topology
nateinaction Dec 1, 2025
61b9577
not booting
nateinaction Dec 1, 2025
cc60a25
Rename light sensor
nateinaction Dec 2, 2025
a8b4a08
Merge branch 'main' of github.com:open-source-space-foundation/proves…
nateinaction Dec 2, 2025
d8c5b7f
bump max packets
nateinaction Dec 2, 2025
8a0a201
Increase Health Queue and Decrease Thread Stack Size
Mikefly123 Dec 3, 2025
b2bea66
Remove generic health monitor component
nateinaction Dec 3, 2025
325e7c1
Merge branch 'more-deditated-wham' of github.com:open-source-space-fo…
nateinaction Dec 3, 2025
c011538
Reduce logging overhead
nateinaction Dec 3, 2025
aa1dcd8
Reduce lines changed. Remove 1/6Hz rate group
nateinaction Dec 3, 2025
67ec13e
Next error
nateinaction Dec 3, 2025
797fc7e
Booting
nateinaction Dec 3, 2025
74f5466
Update param value defaults
nateinaction Dec 4, 2025
4dee50b
More defensive
nateinaction Dec 4, 2025
8aa4cbc
2 new rategroups
nateinaction Dec 4, 2025
89b9294
Merge branch 'main' of github.com:open-source-space-foundation/proves…
nateinaction Dec 4, 2025
9011012
Fix for face4 BSOD
nateinaction Dec 5, 2025
a0dcb05
with topology
nateinaction Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codespell-ignore-words.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ALS
comIn
Ines
rsource
43 changes: 43 additions & 0 deletions FprimeZephyrReference/Components/ADCS/ADCS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ======================================================================
// \title ADCS.cpp
// \brief cpp file for ADCS component implementation class
// ======================================================================

#include "FprimeZephyrReference/Components/ADCS/ADCS.hpp"

#include <Fw/Types/Assert.hpp>

namespace Components {

// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

ADCS::ADCS(const char* const compName) : ADCSComponentBase(compName) {}

ADCS::~ADCS() {}

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

void ADCS::run_handler(FwIndexType portNum, U32 context) {
Fw::Success condition;

// Visible light
for (FwIndexType i = 0; i < this->getNum_visibleLightGet_OutputPorts(); i++) {
this->visibleLightGet_out(i, condition);
}

// Infra-red light
for (FwIndexType i = 0; i < this->getNum_infraRedLightGet_OutputPorts(); i++) {
this->infraRedLightGet_out(i, condition);
}

// Ambient light
for (FwIndexType i = 0; i < this->getNum_ambientLightGet_OutputPorts(); i++) {
this->ambientLightGet_out(i, condition);
}
}

} // namespace Components
30 changes: 30 additions & 0 deletions FprimeZephyrReference/Components/ADCS/ADCS.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module Components {
@ Attitude Determination and Control Component for F Prime FSW framework.
passive component ADCS {
sync input port run: Svc.Sched

@ Port for visible light from the light sensors
output port visibleLightGet: [6] Drv.lightGet

@Port for infra-red light from the light sensors
output port infraRedLightGet: [6] Drv.lightGet

@Port for ambient light from the light sensors
output port ambientLightGet: [6] Drv.lightGet

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
@ Port for requesting the current time
time get port timeCaller

@ Port for emitting telemetry
telemetry port tlmOut

@ Port for emitting events
event port logOut

@ Port for emitting text events
text event port logTextOut
}
}
41 changes: 41 additions & 0 deletions FprimeZephyrReference/Components/ADCS/ADCS.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// ======================================================================
// \title ADCS.hpp
// \brief hpp file for ADCS component implementation class
// ======================================================================

#ifndef Components_ADCS_HPP
#define Components_ADCS_HPP

#include "FprimeZephyrReference/Components/ADCS/ADCSComponentAc.hpp"

namespace Components {

class ADCS final : public ADCSComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

//! Construct ADCS object
ADCS(const char* const compName //!< The component name
);

//! Destroy ADCS object
~ADCS();

private:
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for run
//!
//! Scheduled port for periodic temperature reading
void run_handler(FwIndexType portNum, //!< The port number
U32 context //!< The call order
) override;
};

} // namespace Components

#endif
18 changes: 18 additions & 0 deletions FprimeZephyrReference/Components/ADCS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
####
# F Prime CMakeLists.txt:
#
# SOURCES: list of source files (to be compiled)
# AUTOCODER_INPUTS: list of files to be passed to the autocoders
# DEPENDS: list of libraries that this module depends on
#
# More information in the F´ CMake API documentation:
# https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/
#
####

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/ADCS.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/ADCS.cpp"
)
2 changes: 2 additions & 0 deletions FprimeZephyrReference/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Include project-wide components here

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ADCS/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/AntennaDeployer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BootloaderTrigger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Burnwire/")
Expand All @@ -14,4 +15,5 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/NullPrmDb/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PowerMonitor/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ResetManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/StartupManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ThermalManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog")
2 changes: 2 additions & 0 deletions FprimeZephyrReference/Components/Drv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ina219Manager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lis2mdlManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/RtcManager")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Tmp112Manager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Types/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Veml6031Manager/")
36 changes: 36 additions & 0 deletions FprimeZephyrReference/Components/Drv/Tmp112Manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
####
# F Prime CMakeLists.txt:
#
# SOURCES: list of source files (to be compiled)
# AUTOCODER_INPUTS: list of files to be passed to the autocoders
# DEPENDS: list of libraries that this module depends on
#
# More information in the F´ CMake API documentation:
# https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/
#
####

# Module names are derived from the path from the nearest project/library/framework
# root when not specifically overridden by the developer. i.e. The module defined by
# `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`.

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/Tmp112Manager.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/Tmp112Manager.cpp"
# DEPENDS
# MyPackage_MyOtherModule
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/Tmp112Manager.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Tmp112ManagerTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Tmp112ManagerTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
165 changes: 165 additions & 0 deletions FprimeZephyrReference/Components/Drv/Tmp112Manager/TMP112Manager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// ======================================================================
// \title Tmp112Manager.cpp
// \brief cpp file for Tmp112Manager component implementation class
// ======================================================================

#include "FprimeZephyrReference/Components/Drv/Tmp112Manager/Tmp112Manager.hpp"

#include <Fw/Types/Assert.hpp>
#include <string>

#include <zephyr/sys/printk.h>

namespace Drv {

// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

Tmp112Manager ::Tmp112Manager(const char* const compName) : Tmp112ManagerComponentBase(compName) {}

Tmp112Manager ::~Tmp112Manager() {}

// ----------------------------------------------------------------------
// Helper methods
// ----------------------------------------------------------------------

void Tmp112Manager::configure(const struct device* tca,
const struct device* mux,
const struct device* dev,
bool loadSwitchCheck) {
this->m_tca = tca;
this->m_mux = mux;
this->m_dev = dev;
// TODO(nateinaction): Abstract load switch check, perhaps wrap this component and only use when needed?
this->m_load_switch_check = loadSwitchCheck;
}

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

Fw::Success Tmp112Manager ::loadSwitchStateChanged_handler(FwIndexType portNum, const Fw::On& state) {
// Store the load switch state
this->m_load_switch_state = state;

// If the load switch is off, deinitialize the device
if (this->m_load_switch_state == Fw::On::OFF) {
return this->deinitializeDevice();
}

// If the load switch is on, set the timeout
// We only consider the load switch to be fully on after a timeout period
this->m_load_switch_on_timeout = this->getTime();
this->m_load_switch_on_timeout.add(1, 0);

return Fw::Success::SUCCESS;
}

F64 Tmp112Manager ::temperatureGet_handler(FwIndexType portNum, Fw::Success& condition) {
condition = Fw::Success::FAILURE;

if (!this->initializeDevice()) {
return 0;
}

int rc = sensor_sample_fetch_chan(this->m_dev, SENSOR_CHAN_AMBIENT_TEMP);
if (rc != 0) {
this->log_WARNING_HI_SensorSampleFetchFailed(rc);
return 0;
}
this->log_WARNING_HI_SensorSampleFetchFailed_ThrottleClear();

struct sensor_value val;
rc = sensor_channel_get(this->m_dev, SENSOR_CHAN_AMBIENT_TEMP, &val);
if (rc != 0) {
this->log_WARNING_HI_SensorChannelGetFailed(rc);
return 0;
}
this->log_WARNING_HI_SensorChannelGetFailed_ThrottleClear();

F64 temp = sensor_value_to_double(&val);

this->tlmWrite_Temperature(temp);

condition = Fw::Success::SUCCESS;
return temp;
}

bool Tmp112Manager ::isDeviceInitialized() {
if (!this->m_dev) {
this->log_WARNING_HI_DeviceNil();
return false;
}
this->log_WARNING_HI_DeviceNil_ThrottleClear();

if (!this->m_dev->state) {
this->log_WARNING_HI_DeviceStateNil();
return false;
}
this->log_WARNING_HI_DeviceStateNil_ThrottleClear();

return this->m_dev->state->initialized;
}

Fw::Success Tmp112Manager ::initializeDevice() {
if (this->isDeviceInitialized()) {
if (!device_is_ready(this->m_dev)) {
this->log_WARNING_HI_DeviceNotReady();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_DeviceNotReady_ThrottleClear();
return Fw::Success::SUCCESS;
}

if (!device_is_ready(this->m_tca)) {
this->log_WARNING_HI_TcaUnhealthy();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_TcaUnhealthy_ThrottleClear();

if (!device_is_ready(this->m_mux)) {
this->log_WARNING_HI_MuxUnhealthy();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_MuxUnhealthy_ThrottleClear();

if (!this->loadSwitchReady()) {
this->log_WARNING_HI_LoadSwitchNotReady();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_LoadSwitchNotReady_ThrottleClear();

int rc = device_init(this->m_dev);
if (rc < 0) {
this->log_WARNING_HI_DeviceInitFailed(rc);
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_DeviceInitFailed_ThrottleClear();

return Fw::Success::SUCCESS;
}

Fw::Success Tmp112Manager ::deinitializeDevice() {
if (!this->m_dev) {
this->log_WARNING_HI_DeviceNil();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_DeviceNil_ThrottleClear();

if (!this->m_dev->state) {
this->log_WARNING_HI_DeviceStateNil();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_DeviceStateNil_ThrottleClear();

this->m_dev->state->initialized = false;
return Fw::Success::SUCCESS;
}

bool Tmp112Manager ::loadSwitchReady() {
return (this->m_load_switch_state == Fw::On::ON && this->getTime() >= this->m_load_switch_on_timeout) ||
!this->m_load_switch_check;
}

} // namespace Drv
Loading
Loading