Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions FprimeZephyrReference/Components/ADCS/ADCS.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions FprimeZephyrReference/Components/ADCS/ADCS.fpp

This file was deleted.

41 changes: 0 additions & 41 deletions FprimeZephyrReference/Components/ADCS/ADCS.hpp

This file was deleted.

18 changes: 0 additions & 18 deletions FprimeZephyrReference/Components/ADCS/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions FprimeZephyrReference/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# Include project-wide components here

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ADCS/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/AntennaDeployer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BootloaderTrigger/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Burnwire/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComDelay/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Drv/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FatalHandler")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FsSpace/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/GenericDeviceMonitor/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ImuManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LoadSwitch/")
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}/StartupManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ThermalManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog")
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ Tmp112Manager ::~Tmp112Manager() {}
// Helper methods
// ----------------------------------------------------------------------

void Tmp112Manager::configure(const struct device* dev) {
void Tmp112Manager::configure(const struct device* tca,
const struct device* mux,
const struct device* dev,
bool loadSwitchCheck) {
this->m_tca = tca;
this->m_mux = mux;
this->m_dev = dev;
// TODO(nateinaction): Abstract load switch check, perhaps wrap this component and only use when needed?
this->m_load_switch_check = loadSwitchCheck;
}

// ----------------------------------------------------------------------
Expand Down Expand Up @@ -74,7 +81,7 @@ F64 Tmp112Manager ::temperatureGet_handler(FwIndexType portNum, Fw::Success& con
F64 temp = sensor_value_to_double(&val);
condition = Fw::Success::SUCCESS;

this->tlmWrite_Temperature(temp);
// this->tlmWrite_Temperature(temp);

return temp;
}
Expand Down Expand Up @@ -105,13 +112,13 @@ Fw::Success Tmp112Manager ::initializeDevice() {
return Fw::Success::SUCCESS;
}

if (this->tcaHealthGet_out(0) != Fw::Health::HEALTHY) {
if (!device_is_ready(this->m_tca)) {
this->log_WARNING_HI_TcaUnhealthy();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_TcaUnhealthy_ThrottleClear();

if (this->muxHealthGet_out(0) != Fw::Health::HEALTHY) {
if (!device_is_ready(this->m_mux)) {
this->log_WARNING_HI_MuxUnhealthy();
return Fw::Success::FAILURE;
}
Expand Down Expand Up @@ -151,7 +158,8 @@ Fw::Success Tmp112Manager ::deinitializeDevice() {
}

bool Tmp112Manager ::loadSwitchReady() {
return this->m_load_switch_state == Fw::On::ON && this->getTime() >= this->m_load_switch_on_timeout;
return (this->m_load_switch_state == Fw::On::ON && this->getTime() >= this->m_load_switch_on_timeout) ||
!this->m_load_switch_check;
}

} // namespace Drv
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ module Drv {
@ Port to initialize and deinitialize the TMP112 device on load switch state change
sync input port loadSwitchStateChanged: Components.loadSwitchStateChanged

@ Output port to check device TCA health
output port tcaHealthGet: Components.HealthGet

@ Output port to check device MUX health
output port muxHealthGet: Components.HealthGet

# Telemetry channels

@ Telemetry channel for temperature in degrees Celsius
telemetry Temperature: F64
# Commands
# @ Command to get the temperature from the TMP112 device
# sync command GET_TEMPERATURE(
# $port: FwIndexType @< Temperature Sensor to read
# )

# Events
@ Event for reporting TMP112 not ready error
event DeviceNotReady() severity warning high format "TMP112 device not ready" throttle 5

Expand Down Expand Up @@ -50,20 +46,29 @@ module Drv {
@ Event for reporting TMP112 sensor channel get failure
event SensorChannelGetFailed(ret: I32) severity warning high format "TMP112 sensor channel get failed with return code: {}" throttle 5

@ Event to report TMP112 temperature readout
event TemperatureReadout($port: FwIndexType, tempC: F64) severity activity high format "TMP112 {} Temperature Readout: {} °C"

###############################################################################
# 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

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Tmp112Manager final : public Tmp112ManagerComponentBase {
// ----------------------------------------------------------------------

//! Configure the TMP112 device
void configure(const struct device* dev);
void configure(const struct device* tca, const struct device* mux, const struct device* dev, bool loadSwitchCheck);

private:
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -75,18 +75,22 @@ class Tmp112Manager final : public Tmp112ManagerComponentBase {
//! Zephyr device stores the initialized TMP112 sensor
const struct device* m_dev;

//! TCA health state
Fw::Health m_tca_state = Fw::Health::FAILED;
//! Zephyr device for the TCA
const struct device* m_tca;

//! MUX health state
Fw::Health m_mux_state = Fw::Health::FAILED;
//! Zephyr device for the mux
const struct device* m_mux;

//! Load switch state
Fw::On m_load_switch_state = Fw::On::OFF;

//! Load switch on timeout
//! Time when we can consider the load switch to be fully on (giving time for power to normalize)
Fw::Time m_load_switch_on_timeout;

//! Load switch check
//! Available to disable if the component is not powered by a load switch
bool m_load_switch_check = true;
};

} // namespace Drv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Veml6031Manager ::~Veml6031Manager() {}
// Public helper methods
// ----------------------------------------------------------------------

void Veml6031Manager ::configure(const struct device* dev) {
void Veml6031Manager ::configure(const struct device* tca, const struct device* mux, const struct device* dev) {
this->m_tca = tca;
this->m_mux = mux;
this->m_dev = dev;
}

Expand Down Expand Up @@ -53,7 +55,7 @@ F32 Veml6031Manager ::ambientLightGet_handler(FwIndexType portNum, Fw::Success&

F32 lux = sensor_value_to_double(&val);

this->tlmWrite_VisibleLight(lux);
// this->tlmWrite_VisibleLight(lux);

condition = Fw::Success::SUCCESS;
return lux;
Expand All @@ -80,7 +82,7 @@ F32 Veml6031Manager ::infraRedLightGet_handler(FwIndexType portNum, Fw::Success&

F32 lux = sensor_value_to_double(&val);

this->tlmWrite_InfraRedLight(lux);
// this->tlmWrite_InfraRedLight(lux);

condition = Fw::Success::SUCCESS;
return lux;
Expand Down Expand Up @@ -124,7 +126,7 @@ F32 Veml6031Manager ::visibleLightGet_handler(FwIndexType portNum, Fw::Success&

F32 lux = sensor_value_to_double(&val);

this->tlmWrite_VisibleLight(lux);
// this->tlmWrite_VisibleLight(lux);

condition = Fw::Success::SUCCESS;
return lux;
Expand Down Expand Up @@ -160,13 +162,13 @@ Fw::Success Veml6031Manager ::initializeDevice() {
return Fw::Success::SUCCESS;
}

if (this->tcaHealthGet_out(0) != Fw::Health::HEALTHY) {
if (!device_is_ready(this->m_tca)) {
this->log_WARNING_HI_TcaUnhealthy();
return Fw::Success::FAILURE;
}
this->log_WARNING_HI_TcaUnhealthy_ThrottleClear();

if (this->muxHealthGet_out(0) != Fw::Health::HEALTHY) {
if (!device_is_ready(this->m_mux)) {
this->log_WARNING_HI_MuxUnhealthy();
return Fw::Success::FAILURE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ module Drv {
@ Parameter for setting the Ambient Light Sensor (ALS) persistence protect number setting (PERS).
param ALS_PERSISTENCE_PROTECT_NUMBER: ALS_PERS default ALS_PERS.VEML60XX_PERS_1

#### Telemetry ####
@ Telemetry for the illuminance in the visible spectrum, in lux
telemetry VisibleLight: F32

@ Telemetry for the illuminance in the infra-red spectrum, in lux
telemetry InfraRedLight: F32

@ Telemetry for the ambient illuminance in visible spectrum, in lux
telemetry AmbientLight: F32

#### Ports ####

@ Port to read the illuminance in visible spectrum, in lux
Expand All @@ -80,15 +70,6 @@ module Drv {
@ Port to initialize and deinitialize the VEML6031 device on load switch state change
sync input port loadSwitchStateChanged: Components.loadSwitchStateChanged

@ Output port to check device TCA health
output port tcaHealthGet: Components.HealthGet

@ Output port to check device MUX health
output port muxHealthGet: Components.HealthGet

@ Port for reading gpio status
output port gpioRead: Drv.GpioRead

#### Events ####

@ Event for reporting VEML6031 not ready error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Veml6031Manager final : public Veml6031ManagerComponentBase {
// ----------------------------------------------------------------------

//! Configure the TMP112 device
void configure(const struct device* dev);
void configure(const struct device* tca, const struct device* mux, const struct device* dev);

private:
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -109,11 +109,11 @@ class Veml6031Manager final : public Veml6031ManagerComponentBase {
//! Zephyr device stores the initialized TMP112 sensor
const struct device* m_dev;

//! TCA health state
Fw::Health m_tca_state = Fw::Health::FAILED;
//! Zephyr device for the TCA
const struct device* m_tca;

//! MUX health state
Fw::Health m_mux_state = Fw::Health::FAILED;
//! Zephyr device for the mux
const struct device* m_mux;

//! Load switch state
Fw::On m_load_switch_state = Fw::On::OFF;
Expand Down
Loading
Loading