Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ======================================================================
// \title AntennaDeployer.cpp
// \author aldjia
// \brief cpp file for AntennaDeployer component implementation class
// ======================================================================

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

namespace Components {

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

AntennaDeployer ::AntennaDeployer(const char* const compName) : AntennaDeployerComponentBase(compName) {}

AntennaDeployer ::~AntennaDeployer() {}

} // namespace Components
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module Components {
@ Component that deploys the antenna, activates the burnwire, checks the distance sensor
passive component AntennaDeployer {

##############################################################################
#### Uncomment the following examples to start customizing your component ####
##############################################################################

# @ Example async command
# async command COMMAND_NAME(param_name: U32)

# @ Example telemetry counter
# telemetry ExampleCounter: U64

# @ Example event
# event ExampleStateEvent(example_state: Fw.On) severity activity high id 0 format "State set to {}"

# @ Example port: receiving calls from the rate group
# sync input port run: Svc.Sched

# @ Example parameter
# param PARAMETER_NAME: U32

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

@ Port for sending command registrations
command reg port cmdRegOut

@ Port for receiving commands
command recv port cmdIn

@ Port for sending command responses
command resp port cmdResponseOut

@ Port for sending textual representation of events
text event port logTextOut

@ Port for sending events to downlink
event port logOut

@ Port for sending telemetry channels to downlink
telemetry port tlmOut

@ Port to return the value of a parameter
param get port prmGetOut

@Port to set the value of a parameter
param set port prmSetOut

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ======================================================================
// \title AntennaDeployer.hpp
// \author aldjia
// \brief hpp file for AntennaDeployer component implementation class
// ======================================================================

#ifndef Components_AntennaDeployer_HPP
#define Components_AntennaDeployer_HPP

#include "FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployerComponentAc.hpp"

namespace Components {

class AntennaDeployer final : public AntennaDeployerComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

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

//! Destroy AntennaDeployer object
~AntennaDeployer();
};

} // namespace Components

#endif
36 changes: 36 additions & 0 deletions FprimeZephyrReference/Components/AntennaDeployer/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}/AntennaDeployer.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/AntennaDeployer.cpp"
# DEPENDS
# MyPackage_MyOtherModule
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/AntennaDeployer.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/AntennaDeployerTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/AntennaDeployerTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
81 changes: 81 additions & 0 deletions FprimeZephyrReference/Components/AntennaDeployer/docs/sdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Components::AntennaDeployer

Component that deploys the antenna, activates the burnwire, checks the distance sensor


## Requirements
Add requirements in the chart below
| Name | Description | Validation |
|---|---|---|
|AD0001|The Antenna Deployer shall have a wait period attached to the rate group to deloy antenna after quiet time following satellite deployment | Unit Testing|
|AD0002|The Antenna Deployer shall attempt to redeploy the burnwire if the distance sensor senses the antenna is not deployed from a port| Unit Testing|
|AD0003|The Antenna Deployer shall attempt to deploy if the distance sensor provides nonsensical data |Unit Testing|
|AD0004|The Antenna Deployer shall broadcast an event every time it tries to deploy | Unit Testing|
|AD0005|The Antenna Deployer shall broadcast an event when it successfully deploys | Unit Testing|
|AD0006|The Antenna Deployer shall carry a count of the amount of times it has tried to deploy attached to the Telemetry | Unit Testing|


## Usage Examples
Add usage examples here

### Diagrams
Add diagrams here

### Typical Usage
And the typical usage of the component here

## Class Diagram
Add a class diagram here

## Port Descriptions
| Name | Type | Description |
|------|------| ----------- |
|distVal|F32|Port gets the distance from the distance component |
|startDepl|Fw::Signal|Get command to start deployment|

## Component States
Add component states in the chart below
| Name | Description |
|deploy_count|Keeps track of how many deploys happened |
|---|---|

## Sequence Diagrams
Add sequence diagrams here

## Parameters
| Name | Description |
|deployed_threshold|---|
|invalid_theshold_top|---|
|invalid_theshold_bottom|---|


## Commands
| Name | Description |
| ---- | ----------- |
|DEPLOY|Starts deployment procedure|
|DEPLOY_STOP|Stops deployment procedure|


## Events
| Name | Description |
|Deploy_Attempt|Emitted when deploy attempt starts|
|Deploy_Sucess|Emitted once the antenna has been detected as successfully deployed|
|Deploy_Finish|Emitted once deploy attempts are finished|


## Telemetry
| Name | Description |
|DeployCount|Reports the amount of time the antenna has tried to deploy|
|---|---|

## Unit Tests
Add unit test descriptions in the chart below
| Name | Description | Output | Coverage |
|---|---|---|---|
|---|---|---|---|


## Change Log
| Date | Description |
|---|---|
|---| Initial Draft |
73 changes: 73 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// ======================================================================
// \title Burnwire.cpp
// \author aldjia
// \brief cpp file for Burnwire component implementation class
// ======================================================================

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

namespace Components {

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

Burnwire ::Burnwire(const char* const compName) : BurnwireComponentBase(compName) {}

Burnwire ::~Burnwire() {}

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

// void Burnwire ::stop_handler(FwIndexType portNum) {
// //TODO
// }

void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
if (this->m_state == Fw::On::ON) {
this->m_safetyCounter++;
if (this->m_safetyCounter == 1) {
this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::ON);
}

if (this->m_safetyCounter >= m_safetyMaxCount) {
// 30 seconds reached → turn OFF
this->gpioSet_out(0, Fw::Logic::LOW);
this->gpioSet_out(1, Fw::Logic::LOW);

this->m_state = Fw::On::OFF;
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::OFF);
this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::OFF);
}
}
}

// ----------------------------------------------------------------------
// Handler implementations for commands
// ----------------------------------------------------------------------

void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
// update private member variable
this->m_state = Fw::On::ON;
// send event
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::ON);
// confirm response
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);

// reset count to 0
this->m_safetyCounter = 0;

this->gpioSet_out(0, Fw::Logic::HIGH);
this->gpioSet_out(1, Fw::Logic::HIGH);
}

void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->m_state = Fw::On::OFF;
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::OFF);
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
this->gpioSet_out(0, Fw::Logic::LOW);
this->gpioSet_out(1, Fw::Logic::LOW);
}

} // namespace Components
72 changes: 72 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module Components {
@ Turns Burnwire on and off
passive component Burnwire {

##############################################################################
#### Uncomment the following examples to start customizing your component ####
##############################################################################

# @ Examplesync command
sync command START_BURNWIRE(
)

sync command STOP_BURNWIRE(
)

# @ Example telemetry counter
# telemetry ExampleCounter: U64

# @ Example event
# event ExampleStateEvent(example_state: Fw.On) severity activity high id 0 format "State set to {}"
event SetBurnwireState(burnwire_state: Fw.On) \
severity activity high \
format "Burnwire State: {}"

event SafetyTimerStatus(burnwire_state: Fw.On) \
severity activity high\
format "Safety Timer State: {} "

# @ Example port: receiving calls from the rate group
# sync input port run: Svc.Sched

@ Input Port to get the rate group
sync input port schedIn: Svc.Sched

@ Port sending calls to the GPIO driver to stop and start the burnwire
output port gpioSet: [2] Drv.GpioWrite

# @ Example parameter
# param PARAMETER_NAME: U32

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

@ Port for sending command registrations
command reg port cmdRegOut

@ Port for receiving commands
command recv port cmdIn

@ Port for sending command responses
command resp port cmdResponseOut

@ Port for sending textual representation of events
text event port logTextOut

@ Port for sending events to downlink
event port logOut

@ Port for sending telemetry channels to downlink
telemetry port tlmOut

@ Port to return the value of a parameter
param get port prmGetOut

@Port to set the value of a parameter
param set port prmSetOut

}
}
Loading