From 5723115f5eaee2362b5b8808c717c5b4400fb179 Mon Sep 17 00:00:00 2001 From: Andrei Tumbar Date: Tue, 24 Jun 2025 09:08:44 -0700 Subject: [PATCH] Add FPP Interfaces (#3709) * Interfaces * Point to new fpp alpha release * Fix the fprime-gds version * Update for framer/deframer work * Fix cmake tests * Clean up annotations * Clean up final fpp --- Drv/CMakeLists.txt | 1 + Drv/Interfaces/ByteStreamDriver.fpp | 18 +++ Drv/Interfaces/ByteStreamDriverInterface.fppi | 14 --- Drv/Interfaces/CMakeLists.txt | 17 +++ Drv/Interfaces/Gpio.fpp | 12 ++ Drv/Interfaces/GpioInterface.fppi | 9 -- Drv/Interfaces/I2c.fpp | 12 ++ Drv/Interfaces/I2cInterface.fppi | 9 -- Drv/Interfaces/Spi.fpp | 6 + Drv/Interfaces/SpiInterface.fppi | 2 - Drv/Interfaces/Tick.fpp | 6 + Drv/Interfaces/TickInterface.fppi | 2 - Drv/LinuxGpioDriver/LinuxGpioDriver.fpp | 2 +- Drv/LinuxI2cDriver/LinuxI2cDriver.fpp | 4 +- Drv/LinuxSpiDriver/LinuxSpiDriver.fpp | 2 +- Drv/LinuxUartDriver/LinuxUartDriver.fpp | 2 +- Drv/TcpClient/TcpClient.fpp | 2 +- Drv/TcpServer/TcpServer.fpp | 2 +- Drv/Udp/Udp.fpp | 2 +- FppTest/CMakeLists.txt | 2 + FppTest/component/active/active.fpp | 13 +- FppTest/component/include/output_ports.fppi | 1 - FppTest/component/include/serial_ports.fppi | 8 -- .../component/include/serial_ports_async.fppi | 11 -- FppTest/component/include/special_ports.fppi | 26 ---- FppTest/component/include/typed_ports.fppi | 107 ----------------- .../component/include/typed_ports_async.fppi | 13 -- FppTest/component/passive/passive.fpp | 10 +- FppTest/component/queued/queued.fpp | 14 +-- FppTest/interfaces/CMakeLists.txt | 18 +++ FppTest/interfaces/output_ports.fpp | 5 + FppTest/interfaces/serial_ports.fpp | 12 ++ FppTest/interfaces/serial_ports_async.fpp | 15 +++ FppTest/interfaces/special_ports.fpp | 30 +++++ FppTest/interfaces/typed_ports.fpp | 112 ++++++++++++++++++ FppTest/interfaces/typed_ports_async.fpp | 18 +++ Fw/CMakeLists.txt | 1 + Fw/Interfaces/CMakeLists.txt | 15 +++ Fw/Interfaces/Channel.fpp | 6 + Fw/Interfaces/ChannelInterface.fppi | 2 - Fw/Interfaces/Command.fpp | 12 ++ Fw/Interfaces/CommandInterface.fppi | 8 -- Fw/Interfaces/Event.fpp | 9 ++ Fw/Interfaces/EventInterface.fppi | 5 - Ref/BlockDriver/BlockDriver.fpp | 2 +- Ref/SignalGen/SignalGen.fpp | 6 +- Svc/CMakeLists.txt | 1 + .../SpacePacketDeframer.fpp | 2 +- .../SpacePacketFramer/SpacePacketFramer.fpp | 2 +- Svc/Ccsds/TcDeframer/TcDeframer.fpp | 2 +- Svc/Ccsds/TmFramer/TmFramer.fpp | 2 +- Svc/ChronoTime/ChronoTime.fpp | 2 +- Svc/ComStub/ComStub.fpp | 2 +- Svc/FprimeDeframer/FprimeDeframer.fpp | 2 +- Svc/FprimeFramer/FprimeFramer.fpp | 2 +- Svc/FprimeRouter/FprimeRouter.fpp | 2 +- Svc/FrameAccumulator/FrameAccumulator.fpp | 2 +- Svc/Interfaces/CMakeLists.txt | 18 +++ Svc/Interfaces/Com.fpp | 23 ++++ Svc/Interfaces/ComInterface.fppi | 22 ---- Svc/Interfaces/Deframer.fpp | 15 +++ Svc/Interfaces/DeframerInterface.fppi | 11 -- Svc/Interfaces/FrameAccumulator.fpp | 15 +++ Svc/Interfaces/FrameAccumulatorInterface.fppi | 11 -- Svc/Interfaces/Framer.fpp | 32 +++++ Svc/Interfaces/FramerInterface.fppi | 28 ----- Svc/Interfaces/Router.fpp | 29 +++++ Svc/Interfaces/RouterInterface.fppi | 23 ---- Svc/Interfaces/Time.fpp | 6 + Svc/Interfaces/TimeInterface.fppi | 2 - Svc/LinuxTimer/LinuxTimer.fpp | 2 +- Svc/OsTime/OsTime.fpp | 2 +- Svc/PosixTime/PosixTime.fpp | 2 +- requirements.txt | 26 ++-- 74 files changed, 519 insertions(+), 374 deletions(-) create mode 100644 Drv/Interfaces/ByteStreamDriver.fpp delete mode 100644 Drv/Interfaces/ByteStreamDriverInterface.fppi create mode 100644 Drv/Interfaces/CMakeLists.txt create mode 100644 Drv/Interfaces/Gpio.fpp delete mode 100644 Drv/Interfaces/GpioInterface.fppi create mode 100644 Drv/Interfaces/I2c.fpp delete mode 100644 Drv/Interfaces/I2cInterface.fppi create mode 100644 Drv/Interfaces/Spi.fpp delete mode 100644 Drv/Interfaces/SpiInterface.fppi create mode 100644 Drv/Interfaces/Tick.fpp delete mode 100644 Drv/Interfaces/TickInterface.fppi delete mode 100644 FppTest/component/include/output_ports.fppi delete mode 100644 FppTest/component/include/serial_ports.fppi delete mode 100644 FppTest/component/include/serial_ports_async.fppi delete mode 100644 FppTest/component/include/special_ports.fppi delete mode 100644 FppTest/component/include/typed_ports.fppi delete mode 100644 FppTest/component/include/typed_ports_async.fppi create mode 100644 FppTest/interfaces/CMakeLists.txt create mode 100644 FppTest/interfaces/output_ports.fpp create mode 100644 FppTest/interfaces/serial_ports.fpp create mode 100644 FppTest/interfaces/serial_ports_async.fpp create mode 100644 FppTest/interfaces/special_ports.fpp create mode 100644 FppTest/interfaces/typed_ports.fpp create mode 100644 FppTest/interfaces/typed_ports_async.fpp create mode 100644 Fw/Interfaces/CMakeLists.txt create mode 100644 Fw/Interfaces/Channel.fpp delete mode 100644 Fw/Interfaces/ChannelInterface.fppi create mode 100644 Fw/Interfaces/Command.fpp delete mode 100644 Fw/Interfaces/CommandInterface.fppi create mode 100644 Fw/Interfaces/Event.fpp delete mode 100644 Fw/Interfaces/EventInterface.fppi create mode 100644 Svc/Interfaces/CMakeLists.txt create mode 100644 Svc/Interfaces/Com.fpp delete mode 100644 Svc/Interfaces/ComInterface.fppi create mode 100644 Svc/Interfaces/Deframer.fpp delete mode 100644 Svc/Interfaces/DeframerInterface.fppi create mode 100644 Svc/Interfaces/FrameAccumulator.fpp delete mode 100644 Svc/Interfaces/FrameAccumulatorInterface.fppi create mode 100644 Svc/Interfaces/Framer.fpp delete mode 100644 Svc/Interfaces/FramerInterface.fppi create mode 100644 Svc/Interfaces/Router.fpp delete mode 100644 Svc/Interfaces/RouterInterface.fppi create mode 100644 Svc/Interfaces/Time.fpp delete mode 100644 Svc/Interfaces/TimeInterface.fppi diff --git a/Drv/CMakeLists.txt b/Drv/CMakeLists.txt index 9baba3c7c2..00b20eb848 100644 --- a/Drv/CMakeLists.txt +++ b/Drv/CMakeLists.txt @@ -1,6 +1,7 @@ # Module subdirectories # Ports +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Interfaces/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ports/") # Components diff --git a/Drv/Interfaces/ByteStreamDriver.fpp b/Drv/Interfaces/ByteStreamDriver.fpp new file mode 100644 index 0000000000..cc0fba16c0 --- /dev/null +++ b/Drv/Interfaces/ByteStreamDriver.fpp @@ -0,0 +1,18 @@ +module Drv { + interface ByteStreamDriver { + @ Port invoked when the driver is ready to send/receive data + output port ready: Drv.ByteStreamReady + + @ Port invoked by the driver when it receives data + output port $recv: Drv.ByteStreamData + + @ Invoke this port to send data out the driver + guarded input port $send: Fw.BufferSend + + @ Port returning ownership of data received on $send port + output port sendReturnOut: Drv.ByteStreamData + + @ Port receiving back ownership of data sent out on $recv port + guarded input port recvReturnIn: Fw.BufferSend + } +} diff --git a/Drv/Interfaces/ByteStreamDriverInterface.fppi b/Drv/Interfaces/ByteStreamDriverInterface.fppi deleted file mode 100644 index a1e69d7458..0000000000 --- a/Drv/Interfaces/ByteStreamDriverInterface.fppi +++ /dev/null @@ -1,14 +0,0 @@ - @ Port invoked when the driver is ready to send/receive data - output port ready: Drv.ByteStreamReady - - @ Port invoked by the driver when it receives data - output port $recv: Drv.ByteStreamData - - @ Invoke this port to send data out the driver - guarded input port $send: Fw.BufferSend - - @ Port returning ownership of data received on $send port - output port sendReturnOut: Drv.ByteStreamData - - @ Port receiving back ownership of data sent out on $recv port - guarded input port recvReturnIn: Fw.BufferSend diff --git a/Drv/Interfaces/CMakeLists.txt b/Drv/Interfaces/CMakeLists.txt new file mode 100644 index 0000000000..c22be795b9 --- /dev/null +++ b/Drv/Interfaces/CMakeLists.txt @@ -0,0 +1,17 @@ +#### +# F prime CMakeLists.txt: +# +# SOURCE_FILES: combined list of source and autocoding files +# MOD_DEPS: (optional) module dependencies +# +#### +register_fprime_module( + Drv_Interfaces + AUTOCODER_INPUTS + "${CMAKE_CURRENT_LIST_DIR}/ByteStreamDriver.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Gpio.fpp" + "${CMAKE_CURRENT_LIST_DIR}/I2c.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Spi.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Tick.fpp" + INTERFACE +) diff --git a/Drv/Interfaces/Gpio.fpp b/Drv/Interfaces/Gpio.fpp new file mode 100644 index 0000000000..28804d1aa9 --- /dev/null +++ b/Drv/Interfaces/Gpio.fpp @@ -0,0 +1,12 @@ +module Drv { + interface Gpio { + @ Port used to write to a GPIO pin + sync input port gpioWrite: Drv.GpioWrite + + @ Port used to read from a GPIO pin + sync input port gpioRead: Drv.GpioRead + + @ Port used to indicate transition on the GPIO pin + output port gpioInterrupt: Svc.Cycle + } +} diff --git a/Drv/Interfaces/GpioInterface.fppi b/Drv/Interfaces/GpioInterface.fppi deleted file mode 100644 index a2957e8dcc..0000000000 --- a/Drv/Interfaces/GpioInterface.fppi +++ /dev/null @@ -1,9 +0,0 @@ - -@ Port used to write to a GPIO pin -sync input port gpioWrite: Drv.GpioWrite - -@ Port used to read from a GPIO pin -sync input port gpioRead: Drv.GpioRead - -@ Port used to indicate transition on the GPIO pin -output port gpioInterrupt: Svc.Cycle \ No newline at end of file diff --git a/Drv/Interfaces/I2c.fpp b/Drv/Interfaces/I2c.fpp new file mode 100644 index 0000000000..8c0acfe8c6 --- /dev/null +++ b/Drv/Interfaces/I2c.fpp @@ -0,0 +1,12 @@ +module Drv { + interface I2c { + @ Port for guarded synchronous writing to I2C + guarded input port write: Drv.I2c + + @ Port for guarded synchronous reading from I2C + guarded input port read: Drv.I2c + + @ Port for synchronous writing and reading from I2C + guarded input port writeRead: Drv.I2cWriteRead + } +} diff --git a/Drv/Interfaces/I2cInterface.fppi b/Drv/Interfaces/I2cInterface.fppi deleted file mode 100644 index 6c639b7fc2..0000000000 --- a/Drv/Interfaces/I2cInterface.fppi +++ /dev/null @@ -1,9 +0,0 @@ - -@ Port for guarded synchronous writing to I2C -guarded input port write: Drv.I2c - -@ Port for guarded synchronous reading from I2C -guarded input port read: Drv.I2c - -@ Port for synchronous writing and reading from I2C -guarded input port writeRead: Drv.I2cWriteRead diff --git a/Drv/Interfaces/Spi.fpp b/Drv/Interfaces/Spi.fpp new file mode 100644 index 0000000000..b8b5bf8898 --- /dev/null +++ b/Drv/Interfaces/Spi.fpp @@ -0,0 +1,6 @@ +module Drv { + interface Spi { + @ Port to perform a synchronous read/write operation over the SPI bus + sync input port SpiReadWrite: Drv.SpiReadWrite + } +} diff --git a/Drv/Interfaces/SpiInterface.fppi b/Drv/Interfaces/SpiInterface.fppi deleted file mode 100644 index 9877508fe6..0000000000 --- a/Drv/Interfaces/SpiInterface.fppi +++ /dev/null @@ -1,2 +0,0 @@ -@ Port to perform a synchronous read/write operation over the SPI bus -sync input port SpiReadWrite: Drv.SpiReadWrite \ No newline at end of file diff --git a/Drv/Interfaces/Tick.fpp b/Drv/Interfaces/Tick.fpp new file mode 100644 index 0000000000..921119139a --- /dev/null +++ b/Drv/Interfaces/Tick.fpp @@ -0,0 +1,6 @@ +module Drv { + interface Tick { + @ The cycle outputs. Meant to be connected to rate group driver + output port CycleOut: Svc.Cycle + } +} diff --git a/Drv/Interfaces/TickInterface.fppi b/Drv/Interfaces/TickInterface.fppi deleted file mode 100644 index d6c7b02b1c..0000000000 --- a/Drv/Interfaces/TickInterface.fppi +++ /dev/null @@ -1,2 +0,0 @@ - @ The cycle outputs. Meant to be connected to rate group driver - output port CycleOut: Svc.Cycle diff --git a/Drv/LinuxGpioDriver/LinuxGpioDriver.fpp b/Drv/LinuxGpioDriver/LinuxGpioDriver.fpp index 6d06aabcd5..7d7a6c8412 100644 --- a/Drv/LinuxGpioDriver/LinuxGpioDriver.fpp +++ b/Drv/LinuxGpioDriver/LinuxGpioDriver.fpp @@ -1,7 +1,7 @@ module Drv { passive component LinuxGpioDriver { - include "../Interfaces/GpioInterface.fppi" + import Gpio # ---------------------------------------------------------------------- diff --git a/Drv/LinuxI2cDriver/LinuxI2cDriver.fpp b/Drv/LinuxI2cDriver/LinuxI2cDriver.fpp index 93fbda91f6..e920b7dc21 100644 --- a/Drv/LinuxI2cDriver/LinuxI2cDriver.fpp +++ b/Drv/LinuxI2cDriver/LinuxI2cDriver.fpp @@ -1,9 +1,7 @@ module Drv { passive component LinuxI2cDriver { - include "../Interfaces/I2cInterface.fppi" - - + import I2c } } diff --git a/Drv/LinuxSpiDriver/LinuxSpiDriver.fpp b/Drv/LinuxSpiDriver/LinuxSpiDriver.fpp index c473d49432..9b370439ee 100644 --- a/Drv/LinuxSpiDriver/LinuxSpiDriver.fpp +++ b/Drv/LinuxSpiDriver/LinuxSpiDriver.fpp @@ -6,7 +6,7 @@ module Drv { # Interfaces # ---------------------------------------------------------------------- - include "../../Drv/Interfaces/SpiInterface.fppi" + import Drv.Spi # ---------------------------------------------------------------------- # Special ports diff --git a/Drv/LinuxUartDriver/LinuxUartDriver.fpp b/Drv/LinuxUartDriver/LinuxUartDriver.fpp index 203574bd75..30ad5f914c 100644 --- a/Drv/LinuxUartDriver/LinuxUartDriver.fpp +++ b/Drv/LinuxUartDriver/LinuxUartDriver.fpp @@ -6,7 +6,7 @@ module Drv { # General ports # ---------------------------------------------------------------------- - include "../Interfaces/ByteStreamDriverInterface.fppi" + import ByteStreamDriver @ Allocation port used for allocating memory in the receive task output port allocate: Fw.BufferGet diff --git a/Drv/TcpClient/TcpClient.fpp b/Drv/TcpClient/TcpClient.fpp index 38537ee4c0..62afad3053 100644 --- a/Drv/TcpClient/TcpClient.fpp +++ b/Drv/TcpClient/TcpClient.fpp @@ -1,7 +1,7 @@ module Drv { passive component TcpClient { - include "../Interfaces/ByteStreamDriverInterface.fppi" + import ByteStreamDriver @ Allocation for received data output port allocate: Fw.BufferGet diff --git a/Drv/TcpServer/TcpServer.fpp b/Drv/TcpServer/TcpServer.fpp index ce2df810a7..0808a928d9 100644 --- a/Drv/TcpServer/TcpServer.fpp +++ b/Drv/TcpServer/TcpServer.fpp @@ -1,7 +1,7 @@ module Drv { passive component TcpServer { - include "../Interfaces/ByteStreamDriverInterface.fppi" + import ByteStreamDriver @ Allocation for received data output port allocate: Fw.BufferGet diff --git a/Drv/Udp/Udp.fpp b/Drv/Udp/Udp.fpp index 08f27cf829..07a4b1d726 100644 --- a/Drv/Udp/Udp.fpp +++ b/Drv/Udp/Udp.fpp @@ -1,7 +1,7 @@ module Drv { passive component Udp { - include "../Interfaces/ByteStreamDriverInterface.fppi" + import ByteStreamDriver output port allocate: Fw.BufferGet diff --git a/FppTest/CMakeLists.txt b/FppTest/CMakeLists.txt index 5a12dd66cf..64aaa54479 100644 --- a/FppTest/CMakeLists.txt +++ b/FppTest/CMakeLists.txt @@ -41,6 +41,7 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/component/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/dp/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/state_machine/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/enum/") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/interfaces/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/struct/") set(SOURCE_FILES "source.cpp") @@ -52,6 +53,7 @@ set(MOD_DEPS ${PROJECT_NAME}/component/queued ${PROJECT_NAME}/dp ${PROJECT_NAME}/enum + ${PROJECT_NAME}/interfaces ${PROJECT_NAME}/state_machine/external_instance ${PROJECT_NAME}/state_machine/internal/initial ${PROJECT_NAME}/state_machine/internal/state diff --git a/FppTest/component/active/active.fpp b/FppTest/component/active/active.fpp index 49a79895aa..59aed9aab3 100644 --- a/FppTest/component/active/active.fpp +++ b/FppTest/component/active/active.fpp @@ -2,13 +2,12 @@ active component ActiveTest { include "../include/internal_ports.fppi" - include "../include/serial_ports.fppi" - include "../include/serial_ports_async.fppi" - include "../include/special_ports.fppi" - include "../include/typed_ports.fppi" - include "../include/typed_ports_async.fppi" - - include "../include/output_ports.fppi" + import FppTest.SerialPorts + import FppTest.SerialPortsAsync + import FppTest.SpecialPorts + import FppTest.TypedPorts + import FppTest.TypedPortsAsync + import FppTest.OutputPorts include "../include/commands.fppi" include "../include/commands_async.fppi" diff --git a/FppTest/component/include/output_ports.fppi b/FppTest/component/include/output_ports.fppi deleted file mode 100644 index 74dbbed057..0000000000 --- a/FppTest/component/include/output_ports.fppi +++ /dev/null @@ -1 +0,0 @@ -output port enumArgsHookOverflowed: [2] EnumArgs diff --git a/FppTest/component/include/serial_ports.fppi b/FppTest/component/include/serial_ports.fppi deleted file mode 100644 index 24583178a2..0000000000 --- a/FppTest/component/include/serial_ports.fppi +++ /dev/null @@ -1,8 +0,0 @@ -@ A serial sync input port -sync input port serialSync: [6] serial - -@ A serial guarded input -guarded input port serialGuarded: [6] serial - -@ A serial output port -output port serialOut: [6] serial diff --git a/FppTest/component/include/serial_ports_async.fppi b/FppTest/component/include/serial_ports_async.fppi deleted file mode 100644 index bfd4cc8ed2..0000000000 --- a/FppTest/component/include/serial_ports_async.fppi +++ /dev/null @@ -1,11 +0,0 @@ -@ A serial async input port -async input port serialAsync: [3] serial - -@ A serial async input port with queue full behavior and priority -async input port serialAsyncAssert: serial assert - -@ A serial async input port with queue full behavior and priority -async input port serialAsyncBlockPriority: serial priority 10 block - -@ A serial async input port with queue full behavior and priority -async input port serialAsyncDropPriority: serial priority 5 drop diff --git a/FppTest/component/include/special_ports.fppi b/FppTest/component/include/special_ports.fppi deleted file mode 100644 index 4a340a7f17..0000000000 --- a/FppTest/component/include/special_ports.fppi +++ /dev/null @@ -1,26 +0,0 @@ -@ A port for receiving commands -command recv port cmdIn - -@ A port for sending command registration requests -command reg port cmdRegOut - -@ A port for sending command responses -command resp port cmdResponseOut - -@ A port for emitting events -event port eventOut - -@ A port for emitting text events -text event port textEventOut - -@ A port for emitting telemetry -telemetry port tlmOut - -@ A port for getting parameter values -param get port prmGetOut - -@ A port for setting parameter values -param set port prmSetOut - -@ A port for getting the time -time get port timeGetOut diff --git a/FppTest/component/include/typed_ports.fppi b/FppTest/component/include/typed_ports.fppi deleted file mode 100644 index df7fce1104..0000000000 --- a/FppTest/component/include/typed_ports.fppi +++ /dev/null @@ -1,107 +0,0 @@ -# ---------------------------------------------------------------------- -# Typed input ports with no return type -# ---------------------------------------------------------------------- - -sync input port noArgsSync: [2] NoArgs - -guarded input port noArgsGuarded: [2] NoArgs - -sync input port primitiveArgsSync: [2] PrimitiveArgs - -guarded input port primitiveArgsGuarded: [2] PrimitiveArgs - -sync input port stringArgsSync: [2] StringArgs - -guarded input port stringArgsGuarded: [2] StringArgs - -sync input port enumArgsSync: [2] EnumArgs - -guarded input port enumArgsGuarded: [2] EnumArgs - -sync input port arrayArgsSync: [2] ArrayArgs - -guarded input port arrayArgsGuarded: [2] ArrayArgs - -sync input port structArgsSync: [2] StructArgs - -guarded input port structArgsGuarded: [2] StructArgs - -# ---------------------------------------------------------------------- -# Typed output ports with no return type -# ---------------------------------------------------------------------- - -output port noArgsOut: [2] NoArgs - -output port primitiveArgsOut: [2] PrimitiveArgs - -output port stringArgsOut: [2] StringArgs - -output port enumArgsOut: [2] EnumArgs - -output port arrayArgsOut: [2] ArrayArgs - -output port structArgsOut: [2] StructArgs - -# ---------------------------------------------------------------------- -# Typed input ports with return type -# ---------------------------------------------------------------------- - -sync input port noArgsReturnSync: NoArgsReturn - -guarded input port noArgsReturnGuarded: NoArgsReturn - -sync input port primitiveReturnSync: PrimitiveReturn - -guarded input port primitiveReturnGuarded: PrimitiveReturn - -sync input port stringReturnSync: StringReturn - -guarded input port stringReturnGuarded: StringReturn - -sync input port stringAliasReturnSync: StringAliasReturn - -guarded input port stringAliasReturnGuarded: StringAliasReturn - -sync input port enumReturnSync: EnumReturn - -guarded input port enumReturnGuarded: EnumReturn - -sync input port arrayReturnSync: ArrayReturn - -guarded input port arrayReturnGuarded: ArrayReturn - -sync input port arrayStringAliasReturnSync: ArrayStringAliasReturn - -guarded input port arrayStringAliasReturnGuarded: ArrayStringAliasReturn - -sync input port structReturnSync: StructReturn - -guarded input port structReturnGuarded: StructReturn - -# ---------------------------------------------------------------------- -# Typed output ports with return type -# ---------------------------------------------------------------------- - -output port noArgsReturnOut: NoArgsReturn - -output port primitiveReturnOut: PrimitiveReturn - -output port stringReturnOut: StringReturn - -output port stringAliasReturnOut: StringAliasReturn - -output port enumReturnOut: EnumReturn - -output port arrayReturnOut: ArrayReturn - -output port arrayStringAliasReturnOut: ArrayStringAliasReturn - -output port structReturnOut: StructReturn - -# ---------------------------------------------------------------------- -# Ports for testing special ports -# ---------------------------------------------------------------------- - -output port prmGetIn: Fw.PrmGet - -output port prmSetIn: Fw.PrmSet diff --git a/FppTest/component/include/typed_ports_async.fppi b/FppTest/component/include/typed_ports_async.fppi deleted file mode 100644 index dc41069781..0000000000 --- a/FppTest/component/include/typed_ports_async.fppi +++ /dev/null @@ -1,13 +0,0 @@ -async input port noArgsAsync: [2] NoArgs - -async input port primitiveArgsAsync: [2] PrimitiveArgs - -async input port stringArgsAsync: [2] StringArgs - -async input port enumArgsAsync: [2] EnumArgs assert - -async input port arrayArgsAsync: [2] ArrayArgs priority 10 block - -async input port structArgsAsync: [2] StructArgs priority 5 drop - -async input port enumArgsHook: [2] EnumArgs hook diff --git a/FppTest/component/passive/passive.fpp b/FppTest/component/passive/passive.fpp index 32a35d2b4c..44e2df568a 100644 --- a/FppTest/component/passive/passive.fpp +++ b/FppTest/component/passive/passive.fpp @@ -1,13 +1,9 @@ -#include "../include/fpp_types.fppi" -#include "../include/port_types.fppi" -#include "../include/port_index_enums.fppi" - @ A passive component passive component PassiveTest { - include "../include/typed_ports.fppi" - include "../include/serial_ports.fppi" - include "../include/special_ports.fppi" + import FppTest.SerialPorts + import FppTest.SpecialPorts + import FppTest.TypedPorts include "../include/commands.fppi" include "../include/events.fppi" diff --git a/FppTest/component/queued/queued.fpp b/FppTest/component/queued/queued.fpp index d9714fb01f..32f7d7d4c2 100644 --- a/FppTest/component/queued/queued.fpp +++ b/FppTest/component/queued/queued.fpp @@ -1,14 +1,14 @@ @ A queued component queued component QueuedTest { - include "../include/typed_ports.fppi" - include "../include/typed_ports_async.fppi" - include "../include/serial_ports.fppi" - include "../include/serial_ports_async.fppi" - include "../include/special_ports.fppi" - include "../include/internal_ports.fppi" + import FppTest.SerialPorts + import FppTest.SerialPortsAsync + import FppTest.SpecialPorts + import FppTest.TypedPorts + import FppTest.TypedPortsAsync + import FppTest.OutputPorts - include "../include/output_ports.fppi" + include "../include/internal_ports.fppi" include "../include/commands.fppi" include "../include/commands_async.fppi" diff --git a/FppTest/interfaces/CMakeLists.txt b/FppTest/interfaces/CMakeLists.txt new file mode 100644 index 0000000000..6fc4562828 --- /dev/null +++ b/FppTest/interfaces/CMakeLists.txt @@ -0,0 +1,18 @@ +#### +# F prime CMakeLists.txt: +# +# SOURCE_FILES: combined list of source and autocoding files +# MOD_DEPS: (optional) module dependencies +# +#### +register_fprime_module( + FppTest_interfaces + AUTOCODER_INPUTS + "${CMAKE_CURRENT_LIST_DIR}/output_ports.fpp" + "${CMAKE_CURRENT_LIST_DIR}/serial_ports_async.fpp" + "${CMAKE_CURRENT_LIST_DIR}/serial_ports.fpp" + "${CMAKE_CURRENT_LIST_DIR}/special_ports.fpp" + "${CMAKE_CURRENT_LIST_DIR}/typed_ports_async.fpp" + "${CMAKE_CURRENT_LIST_DIR}/typed_ports.fpp" + INTERFACE +) diff --git a/FppTest/interfaces/output_ports.fpp b/FppTest/interfaces/output_ports.fpp new file mode 100644 index 0000000000..dbf3a6ee6d --- /dev/null +++ b/FppTest/interfaces/output_ports.fpp @@ -0,0 +1,5 @@ +module FppTest { + interface OutputPorts { + output port enumArgsHookOverflowed: [2] EnumArgs + } +} diff --git a/FppTest/interfaces/serial_ports.fpp b/FppTest/interfaces/serial_ports.fpp new file mode 100644 index 0000000000..af59de7c9b --- /dev/null +++ b/FppTest/interfaces/serial_ports.fpp @@ -0,0 +1,12 @@ +module FppTest { + interface SerialPorts { + @ A serial sync input port + sync input port serialSync: [6] serial + + @ A serial guarded input + guarded input port serialGuarded: [6] serial + + @ A serial output port + output port serialOut: [6] serial + } +} diff --git a/FppTest/interfaces/serial_ports_async.fpp b/FppTest/interfaces/serial_ports_async.fpp new file mode 100644 index 0000000000..77cbe5319e --- /dev/null +++ b/FppTest/interfaces/serial_ports_async.fpp @@ -0,0 +1,15 @@ +module FppTest { + interface SerialPortsAsync { + @ A serial async input port + async input port serialAsync: [3] serial + + @ A serial async input port with queue full behavior and priority + async input port serialAsyncAssert: serial assert + + @ A serial async input port with queue full behavior and priority + async input port serialAsyncBlockPriority: serial priority 10 block + + @ A serial async input port with queue full behavior and priority + async input port serialAsyncDropPriority: serial priority 5 drop + } +} diff --git a/FppTest/interfaces/special_ports.fpp b/FppTest/interfaces/special_ports.fpp new file mode 100644 index 0000000000..7577b34213 --- /dev/null +++ b/FppTest/interfaces/special_ports.fpp @@ -0,0 +1,30 @@ +module FppTest { + interface SpecialPorts { + @ A port for receiving commands + command recv port cmdIn + + @ A port for sending command registration requests + command reg port cmdRegOut + + @ A port for sending command responses + command resp port cmdResponseOut + + @ A port for emitting events + event port eventOut + + @ A port for emitting text events + text event port textEventOut + + @ A port for emitting telemetry + telemetry port tlmOut + + @ A port for getting parameter values + param get port prmGetOut + + @ A port for setting parameter values + param set port prmSetOut + + @ A port for getting the time + time get port timeGetOut + } +} diff --git a/FppTest/interfaces/typed_ports.fpp b/FppTest/interfaces/typed_ports.fpp new file mode 100644 index 0000000000..20f60c5a2f --- /dev/null +++ b/FppTest/interfaces/typed_ports.fpp @@ -0,0 +1,112 @@ +module FppTest { + interface TypedPorts { + # ---------------------------------------------------------------------- + # Typed input ports with no return type + # ---------------------------------------------------------------------- + + sync input port noArgsSync: [2] NoArgs + + guarded input port noArgsGuarded: [2] NoArgs + + sync input port primitiveArgsSync: [2] PrimitiveArgs + + guarded input port primitiveArgsGuarded: [2] PrimitiveArgs + + sync input port stringArgsSync: [2] StringArgs + + guarded input port stringArgsGuarded: [2] StringArgs + + sync input port enumArgsSync: [2] EnumArgs + + guarded input port enumArgsGuarded: [2] EnumArgs + + sync input port arrayArgsSync: [2] ArrayArgs + + guarded input port arrayArgsGuarded: [2] ArrayArgs + + sync input port structArgsSync: [2] StructArgs + + guarded input port structArgsGuarded: [2] StructArgs + + # ---------------------------------------------------------------------- + # Typed output ports with no return type + # ---------------------------------------------------------------------- + + output port noArgsOut: [2] NoArgs + + output port primitiveArgsOut: [2] PrimitiveArgs + + output port stringArgsOut: [2] StringArgs + + output port enumArgsOut: [2] EnumArgs + + output port arrayArgsOut: [2] ArrayArgs + + output port structArgsOut: [2] StructArgs + + # ---------------------------------------------------------------------- + # Typed input ports with return type + # ---------------------------------------------------------------------- + + sync input port noArgsReturnSync: NoArgsReturn + + guarded input port noArgsReturnGuarded: NoArgsReturn + + sync input port primitiveReturnSync: PrimitiveReturn + + guarded input port primitiveReturnGuarded: PrimitiveReturn + + sync input port stringReturnSync: StringReturn + + guarded input port stringReturnGuarded: StringReturn + + sync input port stringAliasReturnSync: StringAliasReturn + + guarded input port stringAliasReturnGuarded: StringAliasReturn + + sync input port enumReturnSync: EnumReturn + + guarded input port enumReturnGuarded: EnumReturn + + sync input port arrayReturnSync: ArrayReturn + + guarded input port arrayReturnGuarded: ArrayReturn + + sync input port arrayStringAliasReturnSync: ArrayStringAliasReturn + + guarded input port arrayStringAliasReturnGuarded: ArrayStringAliasReturn + + sync input port structReturnSync: StructReturn + + guarded input port structReturnGuarded: StructReturn + + # ---------------------------------------------------------------------- + # Typed output ports with return type + # ---------------------------------------------------------------------- + + output port noArgsReturnOut: NoArgsReturn + + output port primitiveReturnOut: PrimitiveReturn + + output port stringReturnOut: StringReturn + + output port stringAliasReturnOut: StringAliasReturn + + output port enumReturnOut: EnumReturn + + output port arrayReturnOut: ArrayReturn + + output port arrayStringAliasReturnOut: ArrayStringAliasReturn + + output port structReturnOut: StructReturn + + # ---------------------------------------------------------------------- + # Ports for testing special ports + # ---------------------------------------------------------------------- + + output port prmGetIn: Fw.PrmGet + + output port prmSetIn: Fw.PrmSet + + } +} \ No newline at end of file diff --git a/FppTest/interfaces/typed_ports_async.fpp b/FppTest/interfaces/typed_ports_async.fpp new file mode 100644 index 0000000000..26725221ff --- /dev/null +++ b/FppTest/interfaces/typed_ports_async.fpp @@ -0,0 +1,18 @@ +module FppTest { + interface TypedPortsAsync { + async input port noArgsAsync: [2] NoArgs + + async input port primitiveArgsAsync: [2] PrimitiveArgs + + async input port stringArgsAsync: [2] StringArgs + + async input port enumArgsAsync: [2] EnumArgs assert + + async input port arrayArgsAsync: [2] ArrayArgs priority 10 block + + async input port structArgsAsync: [2] StructArgs priority 5 drop + + async input port enumArgsHook: [2] EnumArgs hook + + } +} diff --git a/Fw/CMakeLists.txt b/Fw/CMakeLists.txt index 5ce74bc57b..cd065719bc 100644 --- a/Fw/CMakeLists.txt +++ b/Fw/CMakeLists.txt @@ -6,6 +6,7 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Cmd/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Com/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Dp/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Fpy/") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Interfaces/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Log/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Logger/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Prm/") diff --git a/Fw/Interfaces/CMakeLists.txt b/Fw/Interfaces/CMakeLists.txt new file mode 100644 index 0000000000..415b188965 --- /dev/null +++ b/Fw/Interfaces/CMakeLists.txt @@ -0,0 +1,15 @@ +#### +# F prime CMakeLists.txt: +# +# SOURCE_FILES: combined list of source and autocoding files +# MOD_DEPS: (optional) module dependencies +# +#### +register_fprime_module( + Fw_Interfaces + AUTOCODER_INPUTS + "${CMAKE_CURRENT_LIST_DIR}/Channel.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Command.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Event.fpp" + INTERFACE +) diff --git a/Fw/Interfaces/Channel.fpp b/Fw/Interfaces/Channel.fpp new file mode 100644 index 0000000000..96678618ac --- /dev/null +++ b/Fw/Interfaces/Channel.fpp @@ -0,0 +1,6 @@ +module Fw { + interface Channel { + @ Telemetry port + telemetry port tlmOut + } +} diff --git a/Fw/Interfaces/ChannelInterface.fppi b/Fw/Interfaces/ChannelInterface.fppi deleted file mode 100644 index 7e62cf4cc3..0000000000 --- a/Fw/Interfaces/ChannelInterface.fppi +++ /dev/null @@ -1,2 +0,0 @@ - @ Telemetry port - telemetry port tlmOut \ No newline at end of file diff --git a/Fw/Interfaces/Command.fpp b/Fw/Interfaces/Command.fpp new file mode 100644 index 0000000000..b448aa0887 --- /dev/null +++ b/Fw/Interfaces/Command.fpp @@ -0,0 +1,12 @@ +module Fw { + interface Command { + @ Command registration port + command reg port cmdRegOut + + @ Command received port + command recv port cmdIn + + @ Command response port + command resp port cmdResponseOut + } +} diff --git a/Fw/Interfaces/CommandInterface.fppi b/Fw/Interfaces/CommandInterface.fppi deleted file mode 100644 index 365431b0e1..0000000000 --- a/Fw/Interfaces/CommandInterface.fppi +++ /dev/null @@ -1,8 +0,0 @@ - @ Command registration port - command reg port cmdRegOut - - @ Command received port - command recv port cmdIn - - @ Command response port - command resp port cmdResponseOut \ No newline at end of file diff --git a/Fw/Interfaces/Event.fpp b/Fw/Interfaces/Event.fpp new file mode 100644 index 0000000000..877b25cc26 --- /dev/null +++ b/Fw/Interfaces/Event.fpp @@ -0,0 +1,9 @@ +module Fw { + interface Event { + @ Text event port + text event port logTextOut + + @ Event port + event port logOut + } +} diff --git a/Fw/Interfaces/EventInterface.fppi b/Fw/Interfaces/EventInterface.fppi deleted file mode 100644 index 06cb6367a8..0000000000 --- a/Fw/Interfaces/EventInterface.fppi +++ /dev/null @@ -1,5 +0,0 @@ - @ Text event port - text event port logTextOut - - @ Event port - event port logOut \ No newline at end of file diff --git a/Ref/BlockDriver/BlockDriver.fpp b/Ref/BlockDriver/BlockDriver.fpp index 4101f48a69..0859365b60 100644 --- a/Ref/BlockDriver/BlockDriver.fpp +++ b/Ref/BlockDriver/BlockDriver.fpp @@ -7,7 +7,7 @@ module Ref { # General ports # ---------------------------------------------------------------------- - include "../../Drv/Interfaces/TickInterface.fppi" + import Drv.Tick @ The rate group scheduler input async input port Sched: Svc.Sched diff --git a/Ref/SignalGen/SignalGen.fpp b/Ref/SignalGen/SignalGen.fpp index 74c472f24a..1b56069dea 100644 --- a/Ref/SignalGen/SignalGen.fpp +++ b/Ref/SignalGen/SignalGen.fpp @@ -78,9 +78,9 @@ module Ref { # ---------------------------------------------------------------------- # Interfaces # ---------------------------------------------------------------------- - include "../../Fw/Interfaces/EventInterface.fppi" - include "../../Fw/Interfaces/CommandInterface.fppi" - include "../../Fw/Interfaces/ChannelInterface.fppi" + import Fw.Event + import Fw.Command + import Fw.Channel } diff --git a/Svc/CMakeLists.txt b/Svc/CMakeLists.txt index 2f126d8b8b..7841eb1ff1 100644 --- a/Svc/CMakeLists.txt +++ b/Svc/CMakeLists.txt @@ -3,6 +3,7 @@ # Ports add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Cycle/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Fatal/") +add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Interfaces/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ping/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PolyIf/") add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Sched/") diff --git a/Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.fpp b/Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.fpp index 90c6c8011b..0152612e46 100644 --- a/Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.fpp +++ b/Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.fpp @@ -3,7 +3,7 @@ module Ccsds { @ Deframer for the CCSDS Space Packet protocol passive component SpacePacketDeframer { - include "../../Interfaces/DeframerInterface.fppi" + import Deframer @ Port to validate a received sequence count for a given APID output port validateApidSeqCount: Ccsds.ApidSequenceCount diff --git a/Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp b/Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp index 0523bfaa91..39ca9a2caf 100644 --- a/Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp +++ b/Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp @@ -3,7 +3,7 @@ module Ccsds { @ Deframer for the CCSDS Space Packet protocol passive component SpacePacketFramer { - include "../../Interfaces/FramerInterface.fppi" + import Framer @ Port to allocate a buffer for a space packet output port bufferAllocate: Fw.BufferGet diff --git a/Svc/Ccsds/TcDeframer/TcDeframer.fpp b/Svc/Ccsds/TcDeframer/TcDeframer.fpp index 757b683b84..b534e6e1a6 100644 --- a/Svc/Ccsds/TcDeframer/TcDeframer.fpp +++ b/Svc/Ccsds/TcDeframer/TcDeframer.fpp @@ -3,7 +3,7 @@ module Ccsds { @ Deframer for the TC Space Data Link Protocol (CCSDS Standard) passive component TcDeframer { - include "../../Interfaces/DeframerInterface.fppi" + import Deframer @ Deframing received an invalid SCID event InvalidSpacecraftId(transmitted: U16, configured: U16) \ diff --git a/Svc/Ccsds/TmFramer/TmFramer.fpp b/Svc/Ccsds/TmFramer/TmFramer.fpp index 6cdfa3e333..e9d466422f 100644 --- a/Svc/Ccsds/TmFramer/TmFramer.fpp +++ b/Svc/Ccsds/TmFramer/TmFramer.fpp @@ -3,7 +3,7 @@ module Ccsds { @ Deframer for the TM Space Data Link Protocol (CCSDS Standard) passive component TmFramer { - include "../../Interfaces/FramerInterface.fppi" + import Framer ############################################################################### # Standard AC Ports: Required for Channels, Events, Commands, and Parameters # diff --git a/Svc/ChronoTime/ChronoTime.fpp b/Svc/ChronoTime/ChronoTime.fpp index fccb91b780..aaad631f56 100644 --- a/Svc/ChronoTime/ChronoTime.fpp +++ b/Svc/ChronoTime/ChronoTime.fpp @@ -1,6 +1,6 @@ module Svc { @ A time component using C++11 chrono library passive component ChronoTime { - include "../Interfaces/TimeInterface.fppi" + import Time } } \ No newline at end of file diff --git a/Svc/ComStub/ComStub.fpp b/Svc/ComStub/ComStub.fpp index a317f62b86..5e0212d6cc 100644 --- a/Svc/ComStub/ComStub.fpp +++ b/Svc/ComStub/ComStub.fpp @@ -1,7 +1,7 @@ module Svc { @ Communication adapter interface implementing communication adapter interface via a Drv.ByteStreamDriverModel. passive component ComStub { - include "../Interfaces/ComInterface.fppi" + import Com # ---------------------------------------------------------------------- # Byte stream model diff --git a/Svc/FprimeDeframer/FprimeDeframer.fpp b/Svc/FprimeDeframer/FprimeDeframer.fpp index 55232fbec8..b37b34beff 100644 --- a/Svc/FprimeDeframer/FprimeDeframer.fpp +++ b/Svc/FprimeDeframer/FprimeDeframer.fpp @@ -8,7 +8,7 @@ module Svc { # Deframer interface # ---------------------------------------------------------------------- - include "../Interfaces/DeframerInterface.fppi" + import Deframer @ An invalid frame was received (too short to be a frame) event InvalidBufferReceived \ diff --git a/Svc/FprimeFramer/FprimeFramer.fpp b/Svc/FprimeFramer/FprimeFramer.fpp index d8b991c555..f4ea7c7e9a 100644 --- a/Svc/FprimeFramer/FprimeFramer.fpp +++ b/Svc/FprimeFramer/FprimeFramer.fpp @@ -2,7 +2,7 @@ module Svc { @ Framer implementation for the F Prime protocol passive component FprimeFramer { - include "../Interfaces/FramerInterface.fppi" + import Framer # ---------------------------------------------------------------------- # Allocation of buffers diff --git a/Svc/FprimeRouter/FprimeRouter.fpp b/Svc/FprimeRouter/FprimeRouter.fpp index ca8055ffbc..39920bb6e4 100644 --- a/Svc/FprimeRouter/FprimeRouter.fpp +++ b/Svc/FprimeRouter/FprimeRouter.fpp @@ -5,7 +5,7 @@ module Svc { # ---------------------------------------------------------------------- # Router interface # ---------------------------------------------------------------------- - include "../Interfaces/RouterInterface.fppi" + import Router @ Port for forwarding non-recognized packet types @ Ownership of the buffer is retained by the FprimeRouter, meaning receiving diff --git a/Svc/FrameAccumulator/FrameAccumulator.fpp b/Svc/FrameAccumulator/FrameAccumulator.fpp index 10fe2251e1..cbf2f30b07 100644 --- a/Svc/FrameAccumulator/FrameAccumulator.fpp +++ b/Svc/FrameAccumulator/FrameAccumulator.fpp @@ -5,7 +5,7 @@ module Svc { # ---------------------------------------------------------------------- # FrameAccumulator interface # ---------------------------------------------------------------------- - include "../Interfaces/FrameAccumulatorInterface.fppi" + import FrameAccumulator @ Port for deallocating buffers holding extracted frames output port bufferDeallocate: Fw.BufferSend diff --git a/Svc/Interfaces/CMakeLists.txt b/Svc/Interfaces/CMakeLists.txt new file mode 100644 index 0000000000..e1c2209434 --- /dev/null +++ b/Svc/Interfaces/CMakeLists.txt @@ -0,0 +1,18 @@ +#### +# F prime CMakeLists.txt: +# +# SOURCE_FILES: combined list of source and autocoding files +# MOD_DEPS: (optional) module dependencies +# +#### +register_fprime_module( + Svc_Interfaces + AUTOCODER_INPUTS + "${CMAKE_CURRENT_LIST_DIR}/Com.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Deframer.fpp" + "${CMAKE_CURRENT_LIST_DIR}/FrameAccumulator.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Framer.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Router.fpp" + "${CMAKE_CURRENT_LIST_DIR}/Time.fpp" + INTERFACE +) diff --git a/Svc/Interfaces/Com.fpp b/Svc/Interfaces/Com.fpp new file mode 100644 index 0000000000..e17faa4ca7 --- /dev/null +++ b/Svc/Interfaces/Com.fpp @@ -0,0 +1,23 @@ +module Svc { + @ Communications Adapter Interface + interface Com { + @ Data to be sent on the wire (coming in to the component) + sync input port dataIn: Svc.ComDataWithContext + + @ Data received from the wire (going out of the component) + output port dataOut: Svc.ComDataWithContext + + @ Status of the last transmission + output port comStatusOut: Fw.SuccessCondition + + # ---------------------------------------------------------------------- + # Memory management + # ---------------------------------------------------------------------- + + @ Port returning ownership of data that came in on dataIn + output port dataReturnOut: Svc.ComDataWithContext + + @ Port receiving back ownership of buffer sent out on dataOut + sync input port dataReturnIn: Svc.ComDataWithContext + } +} diff --git a/Svc/Interfaces/ComInterface.fppi b/Svc/Interfaces/ComInterface.fppi deleted file mode 100644 index 629096011e..0000000000 --- a/Svc/Interfaces/ComInterface.fppi +++ /dev/null @@ -1,22 +0,0 @@ -# ---------------------------------------------------------------------- -# Com Data and Status -# ---------------------------------------------------------------------- - -@ Data to be sent on the wire (coming in to the component) -sync input port dataIn: Svc.ComDataWithContext - -@ Data received from the wire (going out of the component) -output port dataOut: Svc.ComDataWithContext - -@ Status of the last transmission -output port comStatusOut: Fw.SuccessCondition - -# ---------------------------------------------------------------------- -# Memory management -# ---------------------------------------------------------------------- - -@ Port returning ownership of data that came in on dataIn -output port dataReturnOut: Svc.ComDataWithContext - -@ Port receiving back ownership of buffer sent out on dataOut -sync input port dataReturnIn: Svc.ComDataWithContext diff --git a/Svc/Interfaces/Deframer.fpp b/Svc/Interfaces/Deframer.fpp new file mode 100644 index 0000000000..8400e6c2ad --- /dev/null +++ b/Svc/Interfaces/Deframer.fpp @@ -0,0 +1,15 @@ +module Svc { + interface Deframer { + @ Port to receive framed data, with optional context + guarded input port dataIn: Svc.ComDataWithContext + + @ Port to output deframed data, with optional context + output port dataOut: Svc.ComDataWithContext + + @ Port for returning ownership of received buffers to deframe + output port dataReturnOut: Svc.ComDataWithContext + + @ Port receiving back ownership of sent buffers + sync input port dataReturnIn: Svc.ComDataWithContext + } +} diff --git a/Svc/Interfaces/DeframerInterface.fppi b/Svc/Interfaces/DeframerInterface.fppi deleted file mode 100644 index be554f0904..0000000000 --- a/Svc/Interfaces/DeframerInterface.fppi +++ /dev/null @@ -1,11 +0,0 @@ -@ Port to receive framed data, with optional context -guarded input port dataIn: Svc.ComDataWithContext - -@ Port to output deframed data, with optional context -output port dataOut: Svc.ComDataWithContext - -@ Port for returning ownership of received buffers to deframe -output port dataReturnOut: Svc.ComDataWithContext - -@ Port receiving back ownership of sent buffers -sync input port dataReturnIn: Svc.ComDataWithContext diff --git a/Svc/Interfaces/FrameAccumulator.fpp b/Svc/Interfaces/FrameAccumulator.fpp new file mode 100644 index 0000000000..fe79123654 --- /dev/null +++ b/Svc/Interfaces/FrameAccumulator.fpp @@ -0,0 +1,15 @@ +module Svc { + interface FrameAccumulator { + @ Receive raw bytes from a ComInterface (e.g. ComStub) + guarded input port dataIn: Svc.ComDataWithContext + + @ Port for sending an extracted frame out + output port dataOut: Svc.ComDataWithContext + + @ Port for returning ownership of buffers received on dataIn + output port dataReturnOut: Svc.ComDataWithContext + + @ Port receiving back ownership of buffers sent on frameOut + sync input port dataReturnIn: Svc.ComDataWithContext + } +} diff --git a/Svc/Interfaces/FrameAccumulatorInterface.fppi b/Svc/Interfaces/FrameAccumulatorInterface.fppi deleted file mode 100644 index 76dabda8c1..0000000000 --- a/Svc/Interfaces/FrameAccumulatorInterface.fppi +++ /dev/null @@ -1,11 +0,0 @@ -@ Receive raw bytes from a ComInterface (e.g. ComStub) -guarded input port dataIn: Svc.ComDataWithContext - -@ Port for sending an extracted frame out -output port dataOut: Svc.ComDataWithContext - -@ Port for returning ownership of buffers received on dataIn -output port dataReturnOut: Svc.ComDataWithContext - -@ Port receiving back ownership of buffers sent on frameOut -sync input port dataReturnIn: Svc.ComDataWithContext diff --git a/Svc/Interfaces/Framer.fpp b/Svc/Interfaces/Framer.fpp new file mode 100644 index 0000000000..780414c7fa --- /dev/null +++ b/Svc/Interfaces/Framer.fpp @@ -0,0 +1,32 @@ +module Svc { + @ ---------------------------------------------------------------------- + @ Framing + @ ---------------------------------------------------------------------- + interface Framer { + @ Port to receive data to frame, in a Fw::Buffer with optional context + sync input port dataIn: Svc.ComDataWithContext + + @ Port to output framed data with optional context + output port dataOut: Svc.ComDataWithContext + + # ---------------------------------------------------------------------- + # Data ownership + # ---------------------------------------------------------------------- + @ Port for returning ownership of the incoming Fw::Buffer to its sender + @ once framing is handled + output port dataReturnOut: Svc.ComDataWithContext + + @ Buffer coming from a deallocate call in a ComDriver component + sync input port dataReturnIn: Svc.ComDataWithContext + + # ---------------------------------------------------------------------- + # Handling of ready signals (ComQueue <-> ComInterface) + # ---------------------------------------------------------------------- + @ Port receiving the general status from the downstream component + @ indicating it is ready or not-ready for more input + sync input port comStatusIn: Fw.SuccessCondition + + @ Port receiving indicating the status of framer for receiving more data + output port comStatusOut: Fw.SuccessCondition + } +} diff --git a/Svc/Interfaces/FramerInterface.fppi b/Svc/Interfaces/FramerInterface.fppi deleted file mode 100644 index 83826e5057..0000000000 --- a/Svc/Interfaces/FramerInterface.fppi +++ /dev/null @@ -1,28 +0,0 @@ -# ---------------------------------------------------------------------- -# Framing -# ---------------------------------------------------------------------- -@ Port to receive data to frame, in a Fw::Buffer with optional context -sync input port dataIn: Svc.ComDataWithContext - -@ Port to output framed data with optional context -output port dataOut: Svc.ComDataWithContext - -# ---------------------------------------------------------------------- -# Data ownership -# ---------------------------------------------------------------------- -@ Port for returning ownership of the incoming Fw::Buffer to its sender -@ once framing is handled -output port dataReturnOut: Svc.ComDataWithContext - -@ Buffer coming from a deallocate call in a ComDriver component -sync input port dataReturnIn: Svc.ComDataWithContext - -# ---------------------------------------------------------------------- -# Handling of ready signals (ComQueue <-> ComInterface) -# ---------------------------------------------------------------------- -@ Port receiving the general status from the downstream component -@ indicating it is ready or not-ready for more input -sync input port comStatusIn: Fw.SuccessCondition - -@ Port receiving indicating the status of framer for receiving more data -output port comStatusOut: Fw.SuccessCondition diff --git a/Svc/Interfaces/Router.fpp b/Svc/Interfaces/Router.fpp new file mode 100644 index 0000000000..9d130ce530 --- /dev/null +++ b/Svc/Interfaces/Router.fpp @@ -0,0 +1,29 @@ +module Svc { + interface Router { + # --------------------------------------------- + # Router <-> Deframers + # --------------------------------------------- + + @ Receiving data (Fw::Buffer) to be routed with optional context to help with routing + sync input port dataIn: Svc.ComDataWithContext + + @ Port for returning ownership of data (includes Fw.Buffer) received on dataIn + output port dataReturnOut: Svc.ComDataWithContext + + # --------------------------------------------- + # Router <-> CmdDispatch/FileUplink + # --------------------------------------------- + + @ Port for sending file packets as Fw::Buffer (ownership passed to receiver) + output port fileOut: Fw.BufferSend + + @ Port for receiving ownership back of buffers sent on fileOut + sync input port fileBufferReturnIn: Fw.BufferSend + + @ Port for sending command packets as Fw::ComBuffers + output port commandOut: Fw.Com + + @ Port for receiving command responses from a command dispatcher (can be a no-op) + sync input port cmdResponseIn: Fw.CmdResponse + } +} diff --git a/Svc/Interfaces/RouterInterface.fppi b/Svc/Interfaces/RouterInterface.fppi deleted file mode 100644 index 19b0aec680..0000000000 --- a/Svc/Interfaces/RouterInterface.fppi +++ /dev/null @@ -1,23 +0,0 @@ -# --------------------------------------------- -# Router <-> Deframers -# --------------------------------------------- -@ Receiving data (Fw::Buffer) to be routed with optional context to help with routing -sync input port dataIn: Svc.ComDataWithContext - -@ Port for returning ownership of data (includes Fw.Buffer) received on dataIn -output port dataReturnOut: Svc.ComDataWithContext - -# --------------------------------------------- -# Router <-> CmdDispatch/FileUplink -# --------------------------------------------- -@ Port for sending file packets as Fw::Buffer (ownership passed to receiver) -output port fileOut: Fw.BufferSend - -@ Port for receiving ownership back of buffers sent on fileOut -sync input port fileBufferReturnIn: Fw.BufferSend - -@ Port for sending command packets as Fw::ComBuffers -output port commandOut: Fw.Com - -@ Port for receiving command responses from a command dispatcher (can be a no-op) -sync input port cmdResponseIn: Fw.CmdResponse diff --git a/Svc/Interfaces/Time.fpp b/Svc/Interfaces/Time.fpp new file mode 100644 index 0000000000..fe746b1e42 --- /dev/null +++ b/Svc/Interfaces/Time.fpp @@ -0,0 +1,6 @@ +module Svc { + interface Time { + @ Port to retrieve time + sync input port timeGetPort: Fw.Time + } +} diff --git a/Svc/Interfaces/TimeInterface.fppi b/Svc/Interfaces/TimeInterface.fppi deleted file mode 100644 index a6d21cad03..0000000000 --- a/Svc/Interfaces/TimeInterface.fppi +++ /dev/null @@ -1,2 +0,0 @@ -@ Port to retrieve time -sync input port timeGetPort: Fw.Time diff --git a/Svc/LinuxTimer/LinuxTimer.fpp b/Svc/LinuxTimer/LinuxTimer.fpp index ae5754313b..f78c9c1698 100644 --- a/Svc/LinuxTimer/LinuxTimer.fpp +++ b/Svc/LinuxTimer/LinuxTimer.fpp @@ -4,7 +4,7 @@ module Svc { passive component LinuxTimer { @ implement tick interface - include "../../Drv/Interfaces/TickInterface.fppi" + import Drv.Tick } diff --git a/Svc/OsTime/OsTime.fpp b/Svc/OsTime/OsTime.fpp index 7570791219..667a2d1b45 100644 --- a/Svc/OsTime/OsTime.fpp +++ b/Svc/OsTime/OsTime.fpp @@ -2,7 +2,7 @@ module Svc { @ A time component using OSAL RawTime abstractions passive component OsTime { - include "../Interfaces/TimeInterface.fppi" + import Time sync input port setEpoch: OsTimeEpoch diff --git a/Svc/PosixTime/PosixTime.fpp b/Svc/PosixTime/PosixTime.fpp index 5aa5ad2325..b4cbe96512 100644 --- a/Svc/PosixTime/PosixTime.fpp +++ b/Svc/PosixTime/PosixTime.fpp @@ -1,6 +1,6 @@ module Svc { @ A component for getting time passive component PosixTime { - include "../Interfaces/TimeInterface.fppi" + import Time } } diff --git a/requirements.txt b/requirements.txt index 03e37ec478..b81ff2932f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,19 +22,19 @@ fprime-fpl-convert-xml==1.0.3 fprime-fpl-extract-xml==1.0.3 fprime-fpl-layout==1.0.3 fprime-fpl-write-pic==1.0.3 -fprime-fpp-check==3.0.0a11 -fprime-fpp-depend==3.0.0a11 -fprime-fpp-filenames==3.0.0a11 -fprime-fpp-format==3.0.0a11 -fprime-fpp-from-xml==3.0.0a11 -fprime-fpp-locate-defs==3.0.0a11 -fprime-fpp-locate-uses==3.0.0a11 -fprime-fpp-syntax==3.0.0a11 -fprime-fpp-to-cpp==3.0.0a11 -fprime-fpp-to-dict==3.0.0a11 -fprime-fpp-to-json==3.0.0a11 -fprime-fpp-to-xml==3.0.0a11 -fprime-fpp-to-layout==3.0.0a11 +fprime-fpp-check==3.0.0a12 +fprime-fpp-depend==3.0.0a12 +fprime-fpp-filenames==3.0.0a12 +fprime-fpp-format==3.0.0a12 +fprime-fpp-from-xml==3.0.0a12 +fprime-fpp-locate-defs==3.0.0a12 +fprime-fpp-locate-uses==3.0.0a12 +fprime-fpp-syntax==3.0.0a12 +fprime-fpp-to-cpp==3.0.0a12 +fprime-fpp-to-dict==3.0.0a12 +fprime-fpp-to-json==3.0.0a12 +fprime-fpp-to-xml==3.0.0a12 +fprime-fpp-to-layout==3.0.0a12 fprime-gds==4.0.0a3 fprime-tools==4.0.0a1 fprime-visual==1.0.2