Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
eca3536
works with radio in the v5d board
ineskhou Sep 19, 2025
1d5abdf
returned GPIOS to what the C was
ineskhou Sep 19, 2025
8932522
Create pull_request_template.md
ineskhou Sep 19, 2025
08bbbbf
works for v5c
ineskhou Sep 20, 2025
10aeb0a
appease the linter
ineskhou Sep 20, 2025
8a8e2b3
Update pull_request_template.md
ineskhou Sep 20, 2025
d62c42b
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou Sep 20, 2025
7639eda
pulled in main
ineskhou Sep 20, 2025
203fa79
added pr template
ineskhou Sep 20, 2025
4ad69fc
remove fpp helper file
asiemsen Sep 22, 2025
36d5278
finished renaming to build
asiemsen Sep 22, 2025
d8fce1f
add parentheses for clearer intentions
asiemsen Sep 22, 2025
516d730
remove FW_ASSERTs
asiemsen Sep 22, 2025
8e4e8d2
clear throttle after successful device ready check
asiemsen Sep 23, 2025
991b010
adding telemetry to lis2mdlManager
asiemsen Sep 23, 2025
94ba20f
Move closer to D as default
nateinaction Sep 23, 2025
8cb46ae
Merge pull request #26 from Open-Source-Space-Foundation/board_radio_…
ineskhou Sep 23, 2025
44c5d99
Merge pull request #21 from Open-Source-Space-Foundation/board_radio_…
ineskhou Sep 23, 2025
9cfc815
added settings ini to gitignore
ineskhou Sep 23, 2025
b73dec0
Merge branch 'main' into imu2_PR_changes_saidi
hrfarmer Sep 26, 2025
cac1bfc
fix fprime files to match new names & telemetry structure
hrfarmer Sep 26, 2025
8a395c2
edit cpp implementation files to output telemetry
hrfarmer Sep 26, 2025
ac7fd7b
formatting
hrfarmer Sep 26, 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
31 changes: 31 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Pull Request Title (e.g., Feature: Add user authentication)

## Description

<!-- Provide a clear and concise description of the changes being introduced in this pull request. Explain the "why" behind the changes, not just the "what." -->

## Related Issues/Tickets

<!-- Link any relevant issues, tasks, or user stories (e.g., Closes #123, Fixes #456). -->

## How Has This Been Tested?

<!-- Describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. -->

- [ ] Unit tests
- [ ] Integration tests
- [ ] Z Tests
- [ ] Manual testing (describe steps)

## Screenshots / Recordings (if applicable)

<!-- Provide screenshots or screen recordings that demonstrate the changes, especially for UI-related updates. -->

## Checklist

- [ ] Written detailed sdd with requirements, channels, ports, commands, telemetry defined and correctly formatted and spelled
- [ ] Have written relevant integration tests and have documented them in the sdd
- [ ] Have done a code review with
- [ ] Have tested this PR on every supported board with correct board definitions

## Further Notes / Considerations
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ lib/zephyr-workspace/*
.DS_Store
*.gcov
build
settings.ini

**/__pycache__/
**/*.egg-info/
Expand Down
5 changes: 2 additions & 3 deletions FprimeZephyrReference/Components/Drv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Include project-wide components here

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Helpers/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lis2mdlDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoDriver/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lis2mdlManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Types/")
6 changes: 2 additions & 4 deletions FprimeZephyrReference/Components/Drv/Helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
# `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`.

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

### Unit Tests ###
Expand Down
2 changes: 1 addition & 1 deletion FprimeZephyrReference/Components/Drv/Helpers/Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Drv {

F64 sensor_value_to_f64(const struct sensor_value& val) {
return val.val1 + val.val2 / 1000000.0f;
return val.val1 + (val.val2 / 1000000.0f);
}

} // namespace Drv
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Lis2mdlManager.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoDriver.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Lis2mdlManager.cpp"
DEPENDS
FprimeZephyrReference_Components_Drv_Helpers
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoDriver.fpp"
# "${CMAKE_CURRENT_LIST_DIR}/Lis2mdlManager.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lsm6dsoDriverTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lsm6dsoDriverTester.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lis2mdlManagerTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lis2mdlManagerTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ======================================================================
// \title Lis2mdlDriver.cpp
// \brief cpp file for Lis2mdlDriver component implementation class
// \title Lis2mdlManager.cpp
// \brief cpp file for Lis2mdlManager component implementation class
// ======================================================================

#include "FprimeZephyrReference/Components/Drv/Lis2mdlDriver/Lis2mdlDriver.hpp"
#include "FprimeZephyrReference/Components/Drv/Lis2mdlManager/Lis2mdlManager.hpp"

#include <Fw/Types/Assert.hpp>

Expand All @@ -13,23 +13,23 @@ namespace Drv {
// Component construction and destruction
// ----------------------------------------------------------------------

Lis2mdlDriver ::Lis2mdlDriver(const char* const compName) : Lis2mdlDriverComponentBase(compName) {
Lis2mdlManager ::Lis2mdlManager(const char* const compName) : Lis2mdlManagerComponentBase(compName) {
// Initialize the lis2mdl sensor
lis2mdl = device_get_binding("LIS2MDL");
FW_ASSERT(device_is_ready(lis2mdl));
}

Lis2mdlDriver ::~Lis2mdlDriver() {}
Lis2mdlManager ::~Lis2mdlManager() {}

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

Drv::MagneticField Lis2mdlDriver ::magneticFieldRead_handler(FwIndexType portNum) {
Drv::MagneticField Lis2mdlManager ::magneticFieldRead_handler(FwIndexType portNum) {
if (!device_is_ready(lis2mdl)) {
this->log_WARNING_HI_DeviceNotReady();
return Drv::MagneticField(0.0, 0.0, 0.0);
}
this->log_WARNING_HI_DeviceNotReady_ThrottleClear();

struct sensor_value x;
struct sensor_value y;
Expand All @@ -41,7 +41,12 @@ Drv::MagneticField Lis2mdlDriver ::magneticFieldRead_handler(FwIndexType portNum
sensor_channel_get(lis2mdl, SENSOR_CHAN_MAGN_Y, &y);
sensor_channel_get(lis2mdl, SENSOR_CHAN_MAGN_Z, &z);

return Drv::MagneticField(Drv::sensor_value_to_f64(x), Drv::sensor_value_to_f64(y), Drv::sensor_value_to_f64(z));
Drv::MagneticField magnetic_readings =
Drv::MagneticField(Drv::sensor_value_to_f64(x), Drv::sensor_value_to_f64(y), Drv::sensor_value_to_f64(z));

this->tlmWrite_MagneticField(magnetic_readings);

return magnetic_readings;
}

} // namespace Drv
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ module Drv {

# Component definition
module Drv {
@ LIS2MDL Driver Component for F Prime FSW framework.
passive component Lis2mdlDriver {
@ LIS2MDL Manager Component for F Prime FSW framework.
passive component Lis2mdlManager {
@ Port to read the current magnetic field in gauss.
sync input port magneticFieldRead: MagneticFieldRead

@ Event for reporting LSM6DSO not ready error
event DeviceNotReady() severity warning high format "LIS2MDL device not ready" throttle 5

@ Telemetry channel for magnetic field in gauss
telemetry MagneticField: MagneticField


###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
Expand All @@ -24,5 +28,8 @@ module Drv {

@ Port for sending events to downlink
event port logOut

@ Port for sending telemetry channels to downlink
telemetry port tlmOut
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// ======================================================================
// \title Lis2mdlDriver.hpp
// \brief hpp file for Lis2mdlDriver component implementation class
// \title Lis2mdlManager.hpp
// \brief hpp file for Lis2mdlManager component implementation class
// ======================================================================

#ifndef Components_Lis2mdlDriver_HPP
#define Components_Lis2mdlDriver_HPP
#ifndef Components_Lis2mdlManager_HPP
#define Components_Lis2mdlManager_HPP

// clang-format off
// Keep the includes in this order
#include "FprimeZephyrReference/Components/Drv/Lis2mdlDriver/Lis2mdlDriverComponentAc.hpp"
#include "FprimeZephyrReference/Components/Drv/Lis2mdlManager/Lis2mdlManagerComponentAc.hpp"
#include "FprimeZephyrReference/Components/Drv/Helpers/Helpers.hpp"
// clang-format on

Expand All @@ -18,17 +18,17 @@

namespace Drv {

class Lis2mdlDriver final : public Lis2mdlDriverComponentBase {
class Lis2mdlManager final : public Lis2mdlManagerComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

//! Construct Lis2mdlDriver object
Lis2mdlDriver(const char* const compName);
//! Construct Lis2mdlManager object
Lis2mdlManager(const char* const compName);

//! Destroy Lis2mdlDriver object
~Lis2mdlDriver();
//! Destroy Lis2mdlManager object
~Lis2mdlManager();

private:
// ----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Components::Lis2mdlDriver
# Components::Lis2mdlManager

The LIS2MDL Driver component interfaces with the LIS2MDL magnetometer to provide magnetic field measurements.
The LIS2MDL Manager component interfaces with the LIS2MDL magnetometer to provide magnetic field measurements.

## Usage Examples

The LIS2MDL Driver component is designed to be called periodically to collect and return sensor data. It operates as a passive component that responds to manager calls.
The LIS2MDL Manager component is designed to be called periodically to collect and return sensor data. It operates as a passive component that responds to manager calls.

### Typical Usage

Expand All @@ -20,17 +20,17 @@ The LIS2MDL Driver component is designed to be called periodically to collect an
```mermaid
classDiagram
namespace Components {
class Lis2mdlDriverComponentBase {
class Lis2mdlManagerComponentBase {
<<Auto-generated>>
}
class Lis2mdlDriver {
class Lis2mdlManager {
- lis2mdl: device*
+ Lis2mdlDriver(char* compName)
+ ~Lis2mdlDriver()
+ Lis2mdlManager(char* compName)
+ ~Lis2mdlManager()
- magneticFieldRead_handler(FwIndexType portNum): Drv::MagneticField
}
}
Lis2mdlDriverComponentBase <|-- Lis2mdlDriver : inherits
Lis2mdlManagerComponentBase <|-- Lis2mdlManager : inherits
```

## Port Descriptions
Expand All @@ -43,16 +43,16 @@ classDiagram
```mermaid
sequenceDiagram
participant Manager
participant LIS2MDL Driver
participant LIS2MDL Manager
participant Zephyr Sensor API
participant LIS2MDL Sensor

Manager-->>LIS2MDL Driver: Call MagneticFieldRead synchronous input port
LIS2MDL Driver->>Zephyr Sensor API: Fetch sensor data
Manager-->>LIS2MDL Manager: Call MagneticFieldRead synchronous input port
LIS2MDL Manager->>Zephyr Sensor API: Fetch sensor data
Zephyr Sensor API->>LIS2MDL Sensor: Read sensor
LIS2MDL Sensor->>Zephyr Sensor API: Return sensor data
Zephyr Sensor API->>LIS2MDL Driver: Return x, y, z sensor_value structs
LIS2MDL Driver-->>Manager: Return MagneticField struct
Zephyr Sensor API->>LIS2MDL Manager: Return x, y, z sensor_value structs
LIS2MDL Manager-->>Manager: Return MagneticField struct
```

## Requirements
Expand All @@ -64,4 +64,4 @@ Add requirements in the chart below
## Change Log
| Date | Description |
|---|---|
| 2025-9-15 | Initial LIS2MDL Driver component |
| 2025-9-15 | Initial LIS2MDL Manager component |
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/Lis2mdlDriver.fpp"
"${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoManager.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/Lis2mdlDriver.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoManager.cpp"
DEPENDS
FprimeZephyrReference_Components_Drv_Helpers
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/Lis2mdlDriver.fpp"
# "${CMAKE_CURRENT_LIST_DIR}/Lsm6dsoManager.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lis2mdlDriverTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lis2mdlDriverTester.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lsm6dsoManagerTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/Lsm6dsoManagerTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
Expand Down
Loading
Loading