diff --git a/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.cpp b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.cpp new file mode 100644 index 0000000..59a80fe --- /dev/null +++ b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.cpp @@ -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 diff --git a/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.fpp b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.fpp new file mode 100644 index 0000000..107fd31 --- /dev/null +++ b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.fpp @@ -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 + + } +} diff --git a/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.hpp b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.hpp new file mode 100644 index 0000000..c8be596 --- /dev/null +++ b/FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.hpp @@ -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 diff --git a/FprimeZephyrReference/Components/AntennaDeployer/CMakeLists.txt b/FprimeZephyrReference/Components/AntennaDeployer/CMakeLists.txt new file mode 100644 index 0000000..bccd37d --- /dev/null +++ b/FprimeZephyrReference/Components/AntennaDeployer/CMakeLists.txt @@ -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 +# ) diff --git a/FprimeZephyrReference/Components/AntennaDeployer/docs/sdd.md b/FprimeZephyrReference/Components/AntennaDeployer/docs/sdd.md new file mode 100644 index 0000000..10eabbf --- /dev/null +++ b/FprimeZephyrReference/Components/AntennaDeployer/docs/sdd.md @@ -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 | diff --git a/FprimeZephyrReference/Components/Burnwire/Burnwire.cpp b/FprimeZephyrReference/Components/Burnwire/Burnwire.cpp new file mode 100644 index 0000000..1c90453 --- /dev/null +++ b/FprimeZephyrReference/Components/Burnwire/Burnwire.cpp @@ -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 diff --git a/FprimeZephyrReference/Components/Burnwire/Burnwire.fpp b/FprimeZephyrReference/Components/Burnwire/Burnwire.fpp new file mode 100644 index 0000000..1b7e786 --- /dev/null +++ b/FprimeZephyrReference/Components/Burnwire/Burnwire.fpp @@ -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 + + } +} diff --git a/FprimeZephyrReference/Components/Burnwire/Burnwire.hpp b/FprimeZephyrReference/Components/Burnwire/Burnwire.hpp new file mode 100644 index 0000000..0cbc0c9 --- /dev/null +++ b/FprimeZephyrReference/Components/Burnwire/Burnwire.hpp @@ -0,0 +1,58 @@ +// ====================================================================== +// \title Burnwire.hpp +// \author aldjia +// \brief hpp file for Burnwire component implementation class +// ====================================================================== + +#ifndef Components_Burnwire_HPP +#define Components_Burnwire_HPP + +#include "FprimeZephyrReference/Components/Burnwire/BurnwireComponentAc.hpp" + +namespace Components { + +class Burnwire final : public BurnwireComponentBase { + public: + // ---------------------------------------------------------------------- + // Component construction and destruction + // ---------------------------------------------------------------------- + + //! Construct Burnwire object + Burnwire(const char* const compName //!< The component name + ); + + //! Destroy Burnwire object + ~Burnwire(); + + private: + // ---------------------------------------------------------------------- + // Handler implementations for typed input ports + // ---------------------------------------------------------------------- + + //! Handler implementation for stop + //! + //! Port to start and stop the burnwire + + void schedIn_handler(FwIndexType portNum, //!< The port number + U32 context //!< The call order + ) override; + + private: + // ---------------------------------------------------------------------- + // Handler implementations for commands + // ---------------------------------------------------------------------- + + //! Handler implementation for command START_BURNWIRE + void START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override; + + //! Handler implementation for command STOP_BURNWIRE + void STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override; + + Fw::On m_state = Fw::On::OFF; // keeps track if burnwire is on or off + U32 m_safetyCounter = 0; // keeps track of the safety number of seconds + U32 m_safetyMaxCount = 5; +}; + +} // namespace Components + +#endif diff --git a/FprimeZephyrReference/Components/Burnwire/CMakeLists.txt b/FprimeZephyrReference/Components/Burnwire/CMakeLists.txt new file mode 100644 index 0000000..5e68dc9 --- /dev/null +++ b/FprimeZephyrReference/Components/Burnwire/CMakeLists.txt @@ -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}/Burnwire.fpp" + SOURCES + "${CMAKE_CURRENT_LIST_DIR}/Burnwire.cpp" +# DEPENDS +# MyPackage_MyOtherModule +) + +### Unit Tests ### +# register_fprime_ut( +# AUTOCODER_INPUTS +# "${CMAKE_CURRENT_LIST_DIR}/Burnwire.fpp" +# SOURCES +# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTestMain.cpp" +# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTester.cpp" +# DEPENDS +# STest # For rules-based testing +# UT_AUTO_HELPERS +# ) diff --git a/FprimeZephyrReference/Components/Burnwire/docs/sdd.md b/FprimeZephyrReference/Components/Burnwire/docs/sdd.md new file mode 100644 index 0000000..a973b9d --- /dev/null +++ b/FprimeZephyrReference/Components/Burnwire/docs/sdd.md @@ -0,0 +1,67 @@ +# Components::Burnwire + +Turns Burnwire on and off + +## Requirements +Add requirements in the chart below +| Name | Description | Validation | +|BW-001|The burnwire component shall turn on when commanded to |Hardware Test| +|BW-002|The burnwire component shall turn off when commanded to |Hardware Test| +|BW-003|The burnwire component shall provide an Event when it is turned on and off |Integration Test| +|BW-004|The burnwire component shall activate by turning the GPIO pins on one at a time |Integration Test| +|BW-005|The burnwire component shall be controlled by a safety timeout that can be changed within the code |Integration Test| + + +## Port Descriptions +| Name | Description | +|---|---| +|Fw::Signal|Receive stop signal to stop and start burnwire| +|Drv::GpioWrite|Control GPIO state to driver| + +## Commands +| Name | Description | +| ---- | ----------- | +|START_BURNWIRE|Starts the Burn| +|STOP_BURNWIRE|Stops the Burn| + +## Events +| Name | Description | +|---|---| +|Burnwire_Start|Emitted once the burnwire has started| +|Burnwire_Stop|Emitted once the burnwire has ended| + + +## Component States +Add component states in the chart below +| Name | Description | +|----|---| +|m_state|Keeps track if the burnwire is on or off| + +## Sequence Diagrams +Add sequence diagrams here + +## Parameters +| Name | Description | +|---|---| +|---|---| + + + + + +## Telemetry +| Name | Description | +|---|---| +|---|---| + +## Unit Tests +Add unit test descriptions in the chart below +| Name | Description | Output | Coverage | +|TestSafety|Tests Burnwire turns off after X seconds|---|---| +|TestOn|Tests right GPIO pins turn on |---|---| +|TestOn|Tests right GPIO pins turn off, same as on |---|---| + +## Change Log +| Date | Description | +|---|---| +|---| Initial Draft | diff --git a/FprimeZephyrReference/Components/CMakeLists.txt b/FprimeZephyrReference/Components/CMakeLists.txt index 10c9dad..d0f8926 100644 --- a/FprimeZephyrReference/Components/CMakeLists.txt +++ b/FprimeZephyrReference/Components/CMakeLists.txt @@ -2,3 +2,5 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FatalHandler") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Burnwire/") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/AntennaDeployer/") diff --git a/FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp b/FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp index e9bfd73..18fcc2d 100644 --- a/FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp +++ b/FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp @@ -14,6 +14,16 @@ #include static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); +static const struct gpio_dt_spec burnwire0Gpio = { + .port = DEVICE_DT_GET(DT_NODELABEL(gpio0)), + .pin = 28, // 28 + .dt_flags = GPIO_ACTIVE_HIGH, +}; +static const struct gpio_dt_spec burnwire1Gpio = { + .port = DEVICE_DT_GET(DT_NODELABEL(gpio0)), + .pin = 29, // 29 + .dt_flags = GPIO_ACTIVE_HIGH, +}; // Allows easy reference to objects in FPP/autocoder required namespaces using namespace ReferenceDeployment; @@ -55,6 +65,8 @@ void configureTopology() { rateGroup1Hz.configure(rateGroup1HzContext, FW_NUM_ARRAY_ELEMENTS(rateGroup1HzContext)); gpioDriver.open(ledGpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); + gpioBurnwire0.open(burnwire0Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); + gpioBurnwire1.open(burnwire1Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); } // Public functions for use in main program are namespaced with deployment name ReferenceDeployment diff --git a/FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp b/FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp index d3bce3e..468f2df 100644 --- a/FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp +++ b/FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp @@ -1,5 +1,6 @@ module ReferenceDeployment { + # ---------------------------------------------------------------------- # Base ID Convention # ---------------------------------------------------------------------- @@ -62,5 +63,12 @@ module ReferenceDeployment { instance gpioDriver: Zephyr.ZephyrGpioDriver base id 0x10015000 + instance gpioBurnwire0: Zephyr.ZephyrGpioDriver base id 0x10015100 + + instance gpioBurnwire1: Zephyr.ZephyrGpioDriver base id 0x10015200 + instance watchdog: Components.Watchdog base id 0x10016000 + + instance burnwire: Components.Burnwire base id 0x10017000 + } diff --git a/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp b/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp index f1946b8..3b76aac 100644 --- a/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp +++ b/FprimeZephyrReference/ReferenceDeployment/Top/topology.fpp @@ -27,8 +27,11 @@ module ReferenceDeployment { instance timer instance comDriver instance gpioDriver + instance gpioBurnwire0 + instance gpioBurnwire1 instance watchdog instance prmDb + instance burnwire # ---------------------------------------------------------------------- # Pattern graph specifiers @@ -92,12 +95,20 @@ module ReferenceDeployment { rateGroup1Hz.RateGroupMemberOut[2] -> ComCcsds.commsBufferManager.schedIn rateGroup1Hz.RateGroupMemberOut[3] -> CdhCore.tlmSend.Run rateGroup1Hz.RateGroupMemberOut[4] -> watchdog.run + rateGroup1Hz.RateGroupMemberOut[5] -> burnwire.schedIn } + connections Watchdog { watchdog.gpioSet -> gpioDriver.gpioWrite } + connections BurnwireGpio { + burnwire.gpioSet[0] -> gpioBurnwire0.gpioWrite + burnwire.gpioSet[1] -> gpioBurnwire1.gpioWrite + } + + connections ReferenceDeployment { } diff --git a/README.md b/README.md index 74d41fb..9a8f629 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,54 @@ Finally, run the fprime-gds. ```shell make gds ``` + +# How to add a component + +1. Overlay + + +you also want to add aliases + + aliases { + burnwire0 = &burnwire0; + burnwire1 = &burnwire1; + }; + + +2. + +In RefereneceDeploymentTopology.cpp +static const struct gpio_dt_spec burnwireGpio = GPIO_DT_SPEC_GET(DT_ALIAS(burnwire0), gpios); + + gpioBurnwire0.open(burnwire0Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); + gpioBurnwire1.open(burnwire1Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); + + +and + +gpioDriver.open(burnwire0Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT); + +in topology.fpp + +connections burnwire1 { + burnwire1.gpioSet -> gpioDriver.gpioWrite + } + + + + +in instances.fpp +instance gpioBurnwire0: Zephyr.ZephyrGpioDriver base id 0x10015100 + + instance gpioBurnwire1: Zephyr.ZephyrGpioDriver base id 0x10015200 + + +in topology.fpp + + instance gpioBurnwire0 + instance gpioBurnwire1 + +3. Make a new component in the components folder +4. Add the component to the instances and topology folder + +in topology.fpp also instance burnwire diff --git a/boards/rpi_pico2_rp2350a_m33.overlay b/boards/rpi_pico2_rp2350a_m33.overlay index ea7ecb5..1128e6e 100644 --- a/boards/rpi_pico2_rp2350a_m33.overlay +++ b/boards/rpi_pico2_rp2350a_m33.overlay @@ -8,6 +8,21 @@ chosen { zephyr,console = &cdc_acm_uart0; }; + + burnwire0: burnwire0 { + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + label = "Burnwire 0, 28"; + }; + + burnwire1: burnwire1 { + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "Burnwire 1, 29"; + }; + + aliases { + burnwire0 = &burnwire0; + burnwire1 = &burnwire1; + }; }; /* Override the default LED definition to use GPIO 24 instead of GPIO 25 for PROVES FC board*/