added back old GPS handler
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include <fsfw_hal/linux/uio/UioMapper.h>
|
||||
#include <linux/obc/PapbVcInterface.h>
|
||||
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId,
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/obc/VcInterfaceIF.h"
|
||||
|
@ -1,9 +1,12 @@
|
||||
#include "PdecHandler.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "PdecHandler.h"
|
||||
#include "fsfw/ipc/QueueFactory.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <linux/obc/Ptme.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "PtmeConfig.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
|
@ -1,41 +1,40 @@
|
||||
#include "PtmeAxiConfig.h"
|
||||
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw_hal/linux/uio/UioMapper.h"
|
||||
|
||||
PtmeAxiConfig::PtmeAxiConfig(object_id_t objectId, std::string configAxiUio, int mapNum) :
|
||||
SystemObject(objectId), configAxiUio(configAxiUio), mapNum(mapNum) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
if (mutex == nullptr) {
|
||||
sif::warning << "Failed to create mutex" << std::endl;
|
||||
}
|
||||
PtmeAxiConfig::PtmeAxiConfig(object_id_t objectId, std::string configAxiUio, int mapNum)
|
||||
: SystemObject(objectId), configAxiUio(configAxiUio), mapNum(mapNum) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
if (mutex == nullptr) {
|
||||
sif::warning << "Failed to create mutex" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
PtmeAxiConfig::~PtmeAxiConfig() {
|
||||
}
|
||||
PtmeAxiConfig::~PtmeAxiConfig() {}
|
||||
|
||||
ReturnValue_t PtmeAxiConfig::initialize() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
UioMapper uioMapper(configAxiUio, mapNum);
|
||||
result = uioMapper.getMappedAdress(&baseAddress, UioMapper::Permissions::READ_WRITE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
UioMapper uioMapper(configAxiUio, mapNum);
|
||||
result = uioMapper.getMappedAdress(&baseAddress, UioMapper::Permissions::READ_WRITE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PtmeAxiConfig::writeCaduRateReg(uint8_t rateVal) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
result = mutex->lockMutex(timeoutType, mutexTimeout);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "PtmeAxiConfig::writeCaduRateReg: Failed to lock mutex" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
*(baseAddress + CADU_BITRATE_REG) = static_cast<uint32_t>(rateVal);
|
||||
result = mutex->unlockMutex();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "PtmeAxiConfig::writeCaduRateReg: Failed to unlock mutex" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
result = mutex->lockMutex(timeoutType, mutexTimeout);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "PtmeAxiConfig::writeCaduRateReg: Failed to lock mutex" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
*(baseAddress + CADU_BITRATE_REG) = static_cast<uint32_t>(rateVal);
|
||||
result = mutex->unlockMutex();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "PtmeAxiConfig::writeCaduRateReg: Failed to unlock mutex" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,10 @@
|
||||
#define LINUX_OBC_PTMEAXICONFIG_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "fsfw/ipc/MutexIF.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
/**
|
||||
* @brief Class providing low level access to the configuration interface of the PTME.
|
||||
@ -12,31 +13,30 @@
|
||||
* @author J. Meier
|
||||
*/
|
||||
class PtmeAxiConfig : public SystemObject {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param configAxiUio Device file of UIO belonging to the AXI configuration interface.
|
||||
* @param mapNum Number of map belonging to axi configuration interface.
|
||||
*/
|
||||
PtmeAxiConfig(object_id_t objectId, std::string configAxiUio, int mapNum);
|
||||
virtual ~PtmeAxiConfig();
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param configAxiUio Device file of UIO belonging to the AXI configuration interface.
|
||||
* @param mapNum Number of map belonging to axi configuration interface.
|
||||
*/
|
||||
PtmeAxiConfig(object_id_t objectId, std::string configAxiUio, int mapNum);
|
||||
virtual ~PtmeAxiConfig();
|
||||
|
||||
virtual ReturnValue_t initialize() override;
|
||||
ReturnValue_t writeCaduRateReg(uint8_t rateVal);
|
||||
virtual ReturnValue_t initialize() override;
|
||||
ReturnValue_t writeCaduRateReg(uint8_t rateVal);
|
||||
|
||||
private:
|
||||
// Address of register storing the bitrate configuration parameter
|
||||
static const uint32_t CADU_BITRATE_REG = 0x0;
|
||||
private:
|
||||
// Address of register storing the bitrate configuration parameter
|
||||
static const uint32_t CADU_BITRATE_REG = 0x0;
|
||||
|
||||
std::string configAxiUio;
|
||||
std::string uioMap;
|
||||
int mapNum = 0;
|
||||
MutexIF* mutex = nullptr;
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t mutexTimeout = 20;
|
||||
|
||||
uint32_t* baseAddress = nullptr;
|
||||
std::string configAxiUio;
|
||||
std::string uioMap;
|
||||
int mapNum = 0;
|
||||
MutexIF* mutex = nullptr;
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t mutexTimeout = 20;
|
||||
|
||||
uint32_t* baseAddress = nullptr;
|
||||
};
|
||||
|
||||
#endif /* LINUX_OBC_PTMEAXICONFIG_H_ */
|
||||
|
@ -2,10 +2,10 @@
|
||||
#define LINUX_OBC_PTMERATESETTER_H_
|
||||
|
||||
#include "TxRateSetterIF.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/obc/PtmeAxiConfig.h"
|
||||
#include "linux/obc/PtmeConfig.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
|
||||
/**
|
||||
* @brief Class to set the downlink bit rate by writing to the AXI configuration interface of the
|
||||
@ -31,7 +31,6 @@ class PtmeRateSetter : public TxRateSetterIF, public SystemObject, public HasRet
|
||||
virtual ReturnValue_t setRate(uint32_t bitRate);
|
||||
|
||||
private:
|
||||
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::RATE_SETTER;
|
||||
|
||||
//! [EXPORT] : [COMMENT] The commanded rate is not supported by the current FPGA design
|
||||
|
Reference in New Issue
Block a user