Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
50dd22e
still compiles
jrpear Oct 29, 2025
d58b38a
add FOO command
jrpear Nov 6, 2025
5acc25e
add MyComponent instance to Reference topology
jrpear Nov 6, 2025
ae42f73
add spiSend output port to MyComponent
jrpear Nov 6, 2025
e1f0bbd
add mycomp to topology and connect to spiDriver
jrpear Nov 6, 2025
c2b287f
not compiling---ZephyrSpiDriver has `configure` as private method
jrpear Nov 8, 2025
8734b6b
fix MyComponent out index
jrpear Nov 8, 2025
11fcbc7
add missing semicolon
jrpear Nov 8, 2025
94dfc36
add complete SPI config
jrpear Nov 11, 2025
a6e9197
add chipselect functionality
jrpear Nov 13, 2025
1878887
change command to GetStatus and log recvd bytes
jrpear Nov 13, 2025
7d79f2a
Merge branch 'main' into s-band-radio
Mikefly123 Nov 13, 2025
bff957a
Update MyComponent.cpp
Mikefly123 Nov 13, 2025
a6ba2c9
Update instances.fpp
Mikefly123 Nov 13, 2025
4351613
add reset command
jrpear Nov 13, 2025
a49554b
add SetTx and GetStatus commands
jrpear Nov 13, 2025
9fdceae
add setRfFrequency
jrpear Nov 14, 2025
8be9cd0
add TxEn and RxEn pins
jrpear Nov 14, 2025
5967653
add SetTxContinuousWave
jrpear Nov 14, 2025
7b24172
set only tx_en
jrpear Nov 14, 2025
f2ac677
add SetTxParams
jrpear Nov 14, 2025
79b423c
add spiSetTxContinuousPreamble
jrpear Nov 14, 2025
389623e
add SetModulationParams
jrpear Nov 14, 2025
a14029f
add SetStandby
jrpear Nov 14, 2025
6862c92
initial import of external radio driver code
jrpear Nov 15, 2025
6770d7c
instantiate HAL
jrpear Nov 15, 2025
05f52b4
remove rate group thing from MyComponent
jrpear Nov 15, 2025
67e721a
Revert "remove rate group thing from MyComponent"
jrpear Nov 15, 2025
dfba4df
Revert "instantiate HAL"
jrpear Nov 15, 2025
62d8819
Revert "initial import of external radio driver code"
jrpear Nov 15, 2025
0074422
import some Radiolib files
jrpear Nov 15, 2025
8bf5308
update submodule lib/fprime-zephyr
jrpear Nov 15, 2025
d060d47
add RadioLib submodule
jrpear Nov 15, 2025
2c8c069
Revert "import some Radiolib files"
jrpear Nov 15, 2025
8f06d13
make MyComponent depend on RadioLib
jrpear Nov 15, 2025
3dd31d2
add skeleton FprimeHal
jrpear Nov 15, 2025
366f18d
split Fprime Hal into hpp and cpp
jrpear Nov 15, 2025
ef651cd
implement spiTransfer
jrpear Nov 15, 2025
0f371b2
implement timing HAL functions
jrpear Nov 20, 2025
4f3e046
use proper radio API
jrpear Nov 20, 2025
7a0074c
add `setOutputPower` and `transmit` calls
jrpear Nov 22, 2025
23e01c8
remove spurious log
jrpear Nov 22, 2025
c372675
increase message length
jrpear Nov 22, 2025
6975710
Match modulation parameters to CircuitPython defaults
jrpear Nov 25, 2025
cab0843
match packet params to CircuitPython implementation
jrpear Nov 25, 2025
99ebeb9
make hal, module, radio component members
jrpear Nov 25, 2025
12493c8
Move radio config into `configure_radio`
jrpear Nov 25, 2025
0ad7a60
Rename command FOO -> TRANSMIT
jrpear Nov 25, 2025
140fa63
Connect tx_en to MyComponent
jrpear Nov 25, 2025
55347dd
Toggle tx_en on transmit
jrpear Nov 25, 2025
d76b88c
connect MyComponent to rx_enable GPIO
jrpear Nov 25, 2025
7a93743
Add RECEIVE + READ_DATA commands
jrpear Nov 25, 2025
6e3bff3
cleanup in READ_DATA
jrpear Nov 26, 2025
d842839
Add untested RF2 IRQLine read capability
jrpear Nov 26, 2025
2b6b3af
work around RtcManager bug
jrpear Nov 26, 2025
fdb0faf
add missing header
jrpear Nov 26, 2025
9a99eb3
fix irqLine connection
jrpear Nov 28, 2025
5e77358
Change RECEIVE command to do whole receive
jrpear Nov 28, 2025
2dcbc12
remove manual driver commands
jrpear Nov 28, 2025
6ef3ff6
remove unnecessary delay
jrpear Nov 28, 2025
9f3d8f0
change configure_radio return type
jrpear Nov 29, 2025
deb8e46
Move to polled receive via rate group
jrpear Nov 29, 2025
28e9062
remove READ_DATA and RESET commands
jrpear Nov 29, 2025
4f0769c
rename `MyComponent` -> `LoRa2`
jrpear Nov 29, 2025
4f683f3
Merge commit '3502633' into s-band-working
jrpear Nov 29, 2025
53e8e24
Updated Names
ineskhou Nov 29, 2025
688c16a
topology naming
ineskhou Nov 29, 2025
11b360e
adding the CommCcds for the Sband
ineskhou Nov 29, 2025
43c906f
name change
ineskhou Nov 29, 2025
910c46c
updated the configuration
ineskhou Nov 29, 2025
ce62336
added topology connections and ports to SBand
ineskhou Nov 29, 2025
e8ce67b
increase TLMPACKETIZER_HASH_BUCKETS
jrpear Nov 29, 2025
4df6830
Merge commit 'babf036' into s-band-working
jrpear Nov 29, 2025
cc7e964
Disable compile warnings for RadioLib
jrpear Nov 29, 2025
35d109c
change spi config to use Zephyr 4.3 interface
jrpear Nov 29, 2025
f864e1f
Merge branch 'main' into s-band-working
jrpear Nov 29, 2025
59c36bf
fix adafruit rfm module import
jrpear Nov 29, 2025
6eb14e1
add `circuit-python-passthrough`
jrpear Nov 29, 2025
02414a8
Move rx enable into enableRx
jrpear Nov 30, 2025
c705e83
rename `wait_for_rx_fin` -> `rx_mode`
jrpear Nov 30, 2025
7d923fe
add continuous receive
jrpear Nov 30, 2025
befa323
move radio configure into on-start operation
jrpear Nov 30, 2025
5bb5808
Enable rx on start
jrpear Nov 30, 2025
23af550
automatically re-enable Rx after Tx
jrpear Nov 30, 2025
7ea7dc4
remove RECEIVE command
jrpear Nov 30, 2025
7faa232
`Implement dataIn_handler`
jrpear Nov 30, 2025
a25d11c
added comdelay instance to sband topology
ineskhou Nov 30, 2025
1dc6b63
Merge branch 's-band-working' of github.com:Open-Source-Space-Foundat…
ineskhou Nov 30, 2025
5d685a4
add initial comStatusOut_out emission so s band radio is routed packets.
jrpear Dec 1, 2025
b913c82
Mutex on SPI commands and component mode access
jrpear Dec 2, 2025
c471564
Revert "added comdelay instance to sband topology"
jrpear Dec 2, 2025
eda8e60
Revert "Mutex on SPI commands and component mode access"
jrpear Dec 3, 2025
c5c6795
fix packet duplicate check on passthrough
jrpear Dec 3, 2025
3259db2
Reapply "added comdelay instance to sband topology"
jrpear Dec 3, 2025
7680a84
Reapply "Mutex on SPI commands and component mode access"
jrpear Dec 3, 2025
d68fcb4
remove TRANSMIT command
jrpear Dec 3, 2025
995aba1
remove logging in `run_handler`
jrpear Dec 3, 2025
401b4a9
defer receive handling to prevent rate group slips
jrpear Dec 4, 2025
db2f120
Defer transmit as well to prevent mutual access issues; wait until co…
jrpear Dec 4, 2025
6715e37
really defer tx
jrpear Dec 4, 2025
901a840
add proper error logging
jrpear Dec 4, 2025
4e98536
Remove unimplemented telemetry
jrpear Dec 4, 2025
81af105
implement RSSI and SNR telemetry
jrpear Dec 4, 2025
5a7b7dd
Merge branch 'main' into s-band-working
jrpear Dec 4, 2025
58244d5
update fprime-zephyr with log statement removal
jrpear Dec 4, 2025
dc28de2
move lib/fprime-reference to branch with starch's changes and the log…
jrpear Dec 4, 2025
74338e0
write SDD for S band radio
jrpear Dec 4, 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/fprime-zephyr"]
path = lib/fprime-zephyr
url = https://github.com/fprime-community/fprime-zephyr.git
[submodule "lib/RadioLib"]
path = lib/RadioLib
url = https://github.com/jgromes/RadioLib
1 change: 1 addition & 0 deletions FprimeZephyrReference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/project/config")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Components")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComCcsdsUart/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComCcsdsSband/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ReferenceDeployment/")
12 changes: 12 additions & 0 deletions FprimeZephyrReference/ComCcsdsSband/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

register_fprime_module(
EXCLUDE_FROM_ALL
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/ComCcsdsSband.fpp"
HEADERS
"${CMAKE_CURRENT_LIST_DIR}/SubtopologyTopologyDefs.hpp"
"${CMAKE_CURRENT_LIST_DIR}/PingEntries.hpp"
DEPENDS
Svc_Subtopologies_ComCcsds_ComCcsdsConfig
INTERFACE
)
203 changes: 203 additions & 0 deletions FprimeZephyrReference/ComCcsdsSband/ComCcsdsSband.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
module ComCcsdsSband {

# ComPacket Queue enum for queue types
enum Ports_ComPacketQueue {
EVENTS,
TELEMETRY
}

enum Ports_ComBufferQueue {
FILE
}

# ----------------------------------------------------------------------
# Active Components
# ----------------------------------------------------------------------
instance comQueue: Svc.ComQueue base id ComCcsdsConfig.BASE_ID_SBAND + 0x00000 \
queue size ComCcsdsConfig.QueueSizes.comQueue \
stack size ComCcsdsConfig.StackSizes.comQueue \
priority ComCcsdsConfig.Priorities.comQueue \
{
phase Fpp.ToCpp.Phases.configComponents """
using namespace ComCcsdsSband;
Svc::ComQueue::QueueConfigurationTable configurationTableSband;

// Events (highest-priority)
configurationTableSband.entries[Ports_ComPacketQueue::EVENTS].depth = ComCcsdsConfig::QueueDepths::events;
configurationTableSband.entries[Ports_ComPacketQueue::EVENTS].priority = ComCcsdsConfig::QueuePriorities::events;

// Telemetry
configurationTableSband.entries[Ports_ComPacketQueue::TELEMETRY].depth = ComCcsdsConfig::QueueDepths::tlm;
configurationTableSband.entries[Ports_ComPacketQueue::TELEMETRY].priority = ComCcsdsConfig::QueuePriorities::tlm;

// File Downlink Queue (buffer queue using NUM_CONSTANTS offset)
configurationTableSband.entries[Ports_ComPacketQueue::NUM_CONSTANTS + Ports_ComBufferQueue::FILE].depth = ComCcsdsConfig::QueueDepths::file;
configurationTableSband.entries[Ports_ComPacketQueue::NUM_CONSTANTS + Ports_ComBufferQueue::FILE].priority = ComCcsdsConfig::QueuePriorities::file;

// Allocation identifier is 0 as the MallocAllocator discards it
ComCcsdsSband::comQueue.configure(configurationTableSband, 0, ComCcsds::Allocation::memAllocator);
"""
phase Fpp.ToCpp.Phases.tearDownComponents """
ComCcsdsSband::comQueue.cleanup();
"""
}

instance aggregator: Svc.ComAggregator base id ComCcsdsConfig.BASE_ID_SBAND + 0x06000 \
queue size ComCcsdsConfig.QueueSizes.aggregator \
stack size ComCcsdsConfig.StackSizes.aggregator

# ----------------------------------------------------------------------
# Passive Components
# ----------------------------------------------------------------------
instance frameAccumulator: Svc.FrameAccumulator base id ComCcsdsConfig.BASE_ID_SBAND + 0x01000 \
{

phase Fpp.ToCpp.Phases.configObjects """
Svc::FrameDetectors::CcsdsTcFrameDetector frameDetector;
"""
phase Fpp.ToCpp.Phases.configComponents """
ComCcsdsSband::frameAccumulator.configure(
ConfigObjects::ComCcsdsSband_frameAccumulator::frameDetector,
1,
ComCcsds::Allocation::memAllocator,
ComCcsdsConfig::BuffMgr::frameAccumulatorSize
);
"""

phase Fpp.ToCpp.Phases.tearDownComponents """
ComCcsdsSband::frameAccumulator.cleanup();
"""
}

instance commsBufferManager: Svc.BufferManager base id ComCcsdsConfig.BASE_ID_SBAND + 0x02000 \
{
phase Fpp.ToCpp.Phases.configObjects """
Svc::BufferManager::BufferBins bins;
"""

phase Fpp.ToCpp.Phases.configComponents """
memset(&ConfigObjects::ComCcsdsSband_commsBufferManager::bins, 0, sizeof(ConfigObjects::ComCcsdsSband_commsBufferManager::bins));
ConfigObjects::ComCcsdsSband_commsBufferManager::bins.bins[0].bufferSize = ComCcsdsConfig::BuffMgr::commsBuffSize;
ConfigObjects::ComCcsdsSband_commsBufferManager::bins.bins[0].numBuffers = ComCcsdsConfig::BuffMgr::commsBuffCount;
ConfigObjects::ComCcsdsSband_commsBufferManager::bins.bins[1].bufferSize = ComCcsdsConfig::BuffMgr::commsFileBuffSize;
ConfigObjects::ComCcsdsSband_commsBufferManager::bins.bins[1].numBuffers = ComCcsdsConfig::BuffMgr::commsFileBuffCount;
ComCcsdsSband::commsBufferManager.setup(
ComCcsdsConfig::BuffMgr::commsBuffMgrId,
0,
ComCcsds::Allocation::memAllocator,
ConfigObjects::ComCcsdsSband_commsBufferManager::bins
);
"""

phase Fpp.ToCpp.Phases.tearDownComponents """
ComCcsdsSband::commsBufferManager.cleanup();
"""
}

instance fprimeRouter: Svc.FprimeRouter base id ComCcsdsConfig.BASE_ID_SBAND + 0x03000

instance tcDeframer: Svc.Ccsds.TcDeframer base id ComCcsdsConfig.BASE_ID_SBAND + 0x04000

instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id ComCcsdsConfig.BASE_ID_SBAND + 0x05000

# NOTE: name 'framer' is used for the framer that connects to the Com Adapter Interface for better subtopology interoperability
instance framer: Svc.Ccsds.TmFramer base id ComCcsdsConfig.BASE_ID_SBAND + 0x07000

instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id ComCcsdsConfig.BASE_ID_SBAND + 0x08000

instance apidManager: Svc.Ccsds.ApidManager base id ComCcsdsConfig.BASE_ID_SBAND + 0x09000

instance comStub: Svc.ComStub base id ComCcsdsConfig.BASE_ID_SBAND + 0x0A000

topology FramingSubtopology {
# Usage Note:
#
# When importing this subtopology, users shall establish 5 port connections with a component implementing
# the Svc.Com (Svc/Interfaces/Com.fpp) interface. They are as follows:
#
# 1) Outputs:
# - ComCcsds.framer.dataOut -> [Svc.Com].dataIn
# - ComCcsds.frameAccumulator.dataReturnOut -> [Svc.Com].dataReturnIn
# 2) Inputs:
# - [Svc.Com].dataReturnOut -> ComCcsds.framer.dataReturnIn
# - [Svc.Com].comStatusOut -> ComCcsds.framer.comStatusIn
# - [Svc.Com].dataOut -> ComCcsds.frameAccumulator.dataIn


# Active Components
instance comQueue

# Passive Components
instance commsBufferManager
instance frameAccumulator
instance fprimeRouter
instance tcDeframer
instance spacePacketDeframer
instance framer
instance spacePacketFramer
instance apidManager
instance aggregator

connections Downlink {
# ComQueue <-> SpacePacketFramer
comQueue.dataOut -> spacePacketFramer.dataIn
spacePacketFramer.dataReturnOut -> comQueue.dataReturnIn
# SpacePacketFramer buffer and APID management
spacePacketFramer.bufferAllocate -> commsBufferManager.bufferGetCallee
spacePacketFramer.bufferDeallocate -> commsBufferManager.bufferSendIn
spacePacketFramer.getApidSeqCount -> apidManager.getApidSeqCountIn
# SpacePacketFramer <-> TmFramer
spacePacketFramer.dataOut -> aggregator.dataIn
aggregator.dataOut -> framer.dataIn

framer.dataReturnOut -> aggregator.dataReturnIn
aggregator.dataReturnOut -> spacePacketFramer.dataReturnIn

# ComStatus
framer.comStatusOut -> aggregator.comStatusIn
aggregator.comStatusOut -> spacePacketFramer.comStatusIn
spacePacketFramer.comStatusOut -> comQueue.comStatusIn
# (Outgoing) Framer <-> ComInterface connections shall be established by the user
}

connections Uplink {
# (Incoming) ComInterface <-> FrameAccumulator connections shall be established by the user
# FrameAccumulator buffer allocations
frameAccumulator.bufferDeallocate -> commsBufferManager.bufferSendIn
frameAccumulator.bufferAllocate -> commsBufferManager.bufferGetCallee
# FrameAccumulator <-> TcDeframer
frameAccumulator.dataOut -> tcDeframer.dataIn
tcDeframer.dataReturnOut -> frameAccumulator.dataReturnIn
# TcDeframer <-> SpacePacketDeframer
tcDeframer.dataOut -> spacePacketDeframer.dataIn
spacePacketDeframer.dataReturnOut -> tcDeframer.dataReturnIn
# SpacePacketDeframer APID validation
spacePacketDeframer.validateApidSeqCount -> apidManager.validateApidSeqCountIn
# SpacePacketDeframer <-> Router
spacePacketDeframer.dataOut -> fprimeRouter.dataIn
fprimeRouter.dataReturnOut -> spacePacketDeframer.dataReturnIn
# Router buffer allocations
fprimeRouter.bufferAllocate -> commsBufferManager.bufferGetCallee
fprimeRouter.bufferDeallocate -> commsBufferManager.bufferSendIn
}
} # end FramingSubtopology

# This subtopology uses FramingSubtopology with a ComStub component for Com Interface
topology Subtopology {
import FramingSubtopology

instance comStub

connections ComStub {
# Framer <-> ComStub (Downlink)
framer.dataOut -> comStub.dataIn
comStub.dataReturnOut -> framer.dataReturnIn
comStub.comStatusOut -> framer.comStatusIn

# ComStub <-> FrameAccumulator (Uplink)
comStub.dataOut -> frameAccumulator.dataIn
frameAccumulator.dataReturnOut -> comStub.dataReturnIn
}
} # end Subtopology

} # end ComCcsdsSband
7 changes: 7 additions & 0 deletions FprimeZephyrReference/ComCcsdsSband/PingEntries.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef COMCCSDS_SBAND_PINGENTRIES_HPP
#define COMCCSDS_SBAND_PINGENTRIES_HPP
namespace PingEntries {
// No ping-enabled components in ComCcsds S-band subtopology
}

#endif
21 changes: 21 additions & 0 deletions FprimeZephyrReference/ComCcsdsSband/SubtopologyTopologyDefs.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef COMCCSDSSBANDSUBDEFS_HPP
#define COMCCSDSSBANDSUBDEFS_HPP

#include <Fw/Types/MallocAllocator.hpp>
#include <Svc/BufferManager/BufferManager.hpp>
#include <Svc/FrameAccumulator/FrameDetector/CcsdsTcFrameDetector.hpp>

#include "ComCcsdsConfig/ComCcsdsSubtopologyConfig.hpp"
#include "Svc/Subtopologies/ComCcsds/ComCcsdsConfig/FppConstantsAc.hpp"

namespace ComCcsdsSband {
struct SubtopologyState {
// Empty - no external state needed for ComCcsdsSband subtopology
};

struct TopologyState {
SubtopologyState comCcsdsSband;
};
} // namespace ComCcsdsSband

#endif
5 changes: 5 additions & 0 deletions FprimeZephyrReference/ComCcsdsSband/docs/sdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ComCcsdsSband

This is a clone with a renamed module of the F Prime's Svc::ComCcsds.

See: [Svc::ComCcsds](../../../lib/fprime/Svc/Subtopologies/ComCcsds/docs/sdd.md)
1 change: 1 addition & 0 deletions FprimeZephyrReference/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ModeManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/NullPrmDb/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PowerMonitor/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ResetManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SBand/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/StartupManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog")
42 changes: 42 additions & 0 deletions FprimeZephyrReference/Components/SBand/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
####
# 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}/SBand.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/SBand.cpp"
"${CMAKE_CURRENT_LIST_DIR}/FprimeHal.cpp"
DEPENDS
RadioLib
)

add_subdirectory("${FPRIME_PROJECT_ROOT}/lib/RadioLib" "${CMAKE_BINARY_DIR}/RadioLib")

# Disable compile warnings for RadioLib as they pollute the log and we can't do anything about them.
target_compile_options(RadioLib PRIVATE -w)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/SBand.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/SBandTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/SBandTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
77 changes: 77 additions & 0 deletions FprimeZephyrReference/Components/SBand/FprimeHal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#define RADIOLIB_LOW_LEVEL 1

#include "FprimeHal.hpp"

#include <Fw/Buffer/Buffer.hpp>
#include <Fw/Time/Time.hpp>
#include <Os/Task.hpp>

#include "SBand.hpp"
#include <zephyr/kernel.h>

FprimeHal::FprimeHal(Components::SBand* component) : RadioLibHal(0, 0, 0, 0, 0, 0), m_component(component) {}

void FprimeHal::init() {}

void FprimeHal::term() {}

void FprimeHal::pinMode(uint32_t pin, uint32_t mode) {}

void FprimeHal::digitalWrite(uint32_t pin, uint32_t value) {}

uint32_t FprimeHal::digitalRead(uint32_t pin) {
if (pin == 5) {
Fw::Logic irqState;
Drv::GpioStatus state = this->m_component->getIRQLine_out(0, irqState);
FW_ASSERT(state == Drv::GpioStatus::OP_OK);
if (irqState == Fw::Logic::HIGH)
return 1;
else
return 0;
}
return 0;
}

void FprimeHal::attachInterrupt(uint32_t interruptNum, void (*interruptCb)(void), uint32_t mode) {}

void FprimeHal::detachInterrupt(uint32_t interruptNum) {}

void FprimeHal::delay(unsigned long ms) {
Os::Task::delay(Fw::TimeInterval(0, ms * 1000));
}

void FprimeHal::delayMicroseconds(unsigned long us) {
Os::Task::delay(Fw::TimeInterval(0, us));
}

unsigned long FprimeHal::millis() {
return k_uptime_get();
}

unsigned long FprimeHal::micros() {
return k_uptime_get() * 1000;
}

long FprimeHal::pulseIn(uint32_t pin, uint32_t state, unsigned long timeout) {
return 0;
}

void FprimeHal::tone(uint32_t pin, unsigned int frequency, unsigned long duration) {}

void FprimeHal::noTone(uint32_t pin) {}

void FprimeHal::spiBegin() {}

void FprimeHal::spiBeginTransaction() {}

void FprimeHal::spiTransfer(uint8_t* out, size_t len, uint8_t* in) {
Fw::Buffer writeBuffer(out, len);
Fw::Buffer readBuffer(in, len);
this->m_component->spiSend_out(0, writeBuffer, readBuffer);
}

void FprimeHal::yield() {}

void FprimeHal::spiEndTransaction() {}

void FprimeHal::spiEnd() {}
Loading
Loading