Merge branch 'meier/syrlinks' into meier/StarTracker
This commit is contained in:
@ -257,7 +257,7 @@ bool PdecHandler::checkFrameAna(uint32_t pdecFar) {
|
||||
switch(frameAna) {
|
||||
case(FrameAna_t::ABANDONED_CLTU): {
|
||||
triggerEvent(INVALID_TC_FRAME, ABANDONED_CLTU);
|
||||
sif::debug << "PdecHandler::checkFrameAna: Abondoned CLTU" << std::endl;
|
||||
sif::warning << "PdecHandler::checkFrameAna: Abondoned CLTU" << std::endl;
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::FRAME_DIRTY): {
|
||||
@ -266,36 +266,38 @@ bool PdecHandler::checkFrameAna(uint32_t pdecFar) {
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::FRAME_ILLEGAL): {
|
||||
sif::debug << "PdecHandler::checkFrameAna: Frame illegal for one reason" << std::endl;
|
||||
sif::warning << "PdecHandler::checkFrameAna: Frame illegal for one reason" << std::endl;
|
||||
handleIReason(pdecFar, FRAME_ILLEGAL_ONE_REASON);
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::FRAME_ILLEGAL_MULTI_REASON): {
|
||||
sif::debug << "PdecHandler::checkFrameAna: Frame illegal for multiple reasons"
|
||||
sif::warning << "PdecHandler::checkFrameAna: Frame illegal for multiple reasons"
|
||||
<< std::endl;
|
||||
handleIReason(pdecFar, FRAME_ILLEGAL_MULTIPLE_REASONS);
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::AD_DISCARDED_LOCKOUT): {
|
||||
triggerEvent(INVALID_TC_FRAME, AD_DISCARDED_LOCKOUT);
|
||||
sif::debug << "PdecHandler::checkFrameAna: AD frame discarded because of lockout"
|
||||
sif::warning << "PdecHandler::checkFrameAna: AD frame discarded because of lockout"
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::AD_DISCARDED_WAIT): {
|
||||
triggerEvent(INVALID_TC_FRAME, AD_DISCARDED_LOCKOUT);
|
||||
sif::debug << "PdecHandler::checkFrameAna: AD frame discarded because of wait"
|
||||
sif::warning << "PdecHandler::checkFrameAna: AD frame discarded because of wait"
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::AD_DISCARDED_NS_VR): {
|
||||
triggerEvent(INVALID_TC_FRAME, AD_DISCARDED_NS_VS);
|
||||
sif::debug << "PdecHandler::checkFrameAna: AD frame discarded because N(S) or V(R)"
|
||||
sif::warning << "PdecHandler::checkFrameAna: AD frame discarded because N(S) or V(R)"
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
case(FrameAna_t::FRAME_ACCEPTED): {
|
||||
sif::debug << "PdecHandler::checkFrameAna: Accepted TC frame" << std::endl;
|
||||
#if OBSW_DEBUG_PDEC_HANDLER == 1
|
||||
sif::info << "PdecHandler::checkFrameAna: Accepted TC frame" << std::endl;
|
||||
#endif
|
||||
frameValid = true;
|
||||
break;
|
||||
}
|
||||
@ -482,6 +484,10 @@ uint32_t PdecHandler::getClcw() {
|
||||
return *(registerBaseAddress + PDEC_CLCW_OFFSET);
|
||||
}
|
||||
|
||||
uint32_t PdecHandler::getPdecMon() {
|
||||
return *(registerBaseAddress + PDEC_MON_OFFSET);
|
||||
}
|
||||
|
||||
void PdecHandler::printClcw() {
|
||||
uint32_t clcw = getClcw();
|
||||
uint8_t type = static_cast<uint8_t>((clcw >> 31) & 0x1);
|
||||
@ -523,6 +529,39 @@ void PdecHandler::printClcw() {
|
||||
<< "0x" << static_cast<unsigned int>(repValue) << std::endl;
|
||||
}
|
||||
|
||||
void PdecHandler::printPdecMon() {
|
||||
uint32_t pdecMon = getPdecMon();
|
||||
uint32_t tc0ChannelStatus = (pdecMon & TC0_STATUS_MASK) >> TC0_STATUS_POS;
|
||||
uint32_t tc1ChannelStatus = (pdecMon & TC1_STATUS_MASK) >> TC1_STATUS_POS;
|
||||
uint32_t tc2ChannelStatus = (pdecMon & TC2_STATUS_MASK) >> TC2_STATUS_POS;
|
||||
uint32_t tc3ChannelStatus = (pdecMon & TC3_STATUS_MASK) >> TC3_STATUS_POS;
|
||||
uint32_t tc4ChannelStatus = (pdecMon & TC4_STATUS_MASK) >> TC4_STATUS_POS;
|
||||
uint32_t tc5ChannelStatus = (pdecMon & TC5_STATUS_MASK) >> TC5_STATUS_POS;
|
||||
uint32_t lock = (pdecMon & LOCK_MASK) >> LOCK_POS;
|
||||
sif::info << std::setw(30) << std::left << "TC0 status: " << getMonStatusString(tc0ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "TC1 status: " << getMonStatusString(tc1ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "TC2 status: " << getMonStatusString(tc2ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "TC3 status: " << getMonStatusString(tc3ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "TC4 status: " << getMonStatusString(tc4ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "TC5 status: " << getMonStatusString(tc5ChannelStatus) << std::endl;
|
||||
sif::info << std::setw(30) << std::left << "Start sequence lock: " << lock << std::endl;
|
||||
}
|
||||
|
||||
std::string PdecHandler::getMonStatusString(uint32_t status) {
|
||||
switch(status) {
|
||||
case TC_CHANNEL_INACTIVE:
|
||||
return std::string("inactive");
|
||||
case TC_CHANNEL_ACTIVE:
|
||||
return std::string("active");
|
||||
case TC_CHANNEL_TIMEDOUT:
|
||||
return std::string("timed out");
|
||||
default:
|
||||
sif::warning << "PdecHandler::getMonStatusString: Invalid status" << std::endl;
|
||||
return std::string();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ReturnValue_t PdecHandler::executeAction(ActionId_t actionId,
|
||||
MessageQueueId_t commandedBy, const uint8_t* data, size_t size) {
|
||||
@ -530,6 +569,9 @@ ReturnValue_t PdecHandler::executeAction(ActionId_t actionId,
|
||||
case PRINT_CLCW:
|
||||
printClcw();
|
||||
return EXECUTION_FINISHED;
|
||||
case PRINT_PDEC_MON:
|
||||
printPdecMon();
|
||||
return EXECUTION_FINISHED;
|
||||
default:
|
||||
return COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
@ -61,16 +61,6 @@ public:
|
||||
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t* data, size_t size) override;
|
||||
|
||||
/**
|
||||
* brief Returns the 32-bit wide communication link control word (CLCW)
|
||||
*/
|
||||
uint32_t getClcw();
|
||||
|
||||
/**
|
||||
* @rief Reads and prints the CLCW. Can be useful for debugging.
|
||||
*/
|
||||
void printClcw();
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PDEC_HANDLER;
|
||||
|
||||
//! [EXPORT] : [COMMENT] Frame acceptance report signals an invalid frame
|
||||
@ -119,6 +109,8 @@ private:
|
||||
|
||||
// Action IDs
|
||||
static const ActionId_t PRINT_CLCW = 0;
|
||||
// Print PDEC monitor register
|
||||
static const ActionId_t PRINT_PDEC_MON = 1;
|
||||
|
||||
static const uint8_t STAT_POSITION = 31;
|
||||
static const uint8_t FRAME_ANA_POSITION = 28;
|
||||
@ -129,6 +121,28 @@ private:
|
||||
static const uint32_t FRAME_ANA_MASK = 0x70000000;
|
||||
static const uint32_t IREASON_MASK = 0x0E000000;
|
||||
|
||||
static const uint32_t TC_CHANNEL_INACTIVE = 0x0;
|
||||
static const uint32_t TC_CHANNEL_ACTIVE = 0x1;
|
||||
static const uint32_t TC_CHANNEL_TIMEDOUT = 0x2;
|
||||
|
||||
static const uint32_t TC0_STATUS_MASK = 0x3;
|
||||
static const uint32_t TC1_STATUS_MASK = 0xC;
|
||||
static const uint32_t TC2_STATUS_MASK = 0x300;
|
||||
static const uint32_t TC3_STATUS_MASK = 0xC00;
|
||||
static const uint32_t TC4_STATUS_MASK = 0x30000;
|
||||
static const uint32_t TC5_STATUS_MASK = 0xc00000;
|
||||
// Lock register set to 1 when start sequence has been found (CLTU is beeing processed)
|
||||
static const uint32_t LOCK_MASK = 0xc00000;
|
||||
|
||||
static const uint32_t TC0_STATUS_POS = 0;
|
||||
static const uint32_t TC1_STATUS_POS = 2;
|
||||
static const uint32_t TC2_STATUS_POS = 4;
|
||||
static const uint32_t TC3_STATUS_POS = 6;
|
||||
static const uint32_t TC4_STATUS_POS = 8;
|
||||
static const uint32_t TC5_STATUS_POS = 10;
|
||||
// Lock register set to 1 when start sequence has been found (CLTU is beeing processed)
|
||||
static const uint32_t LOCK_POS = 12;
|
||||
|
||||
/**
|
||||
* UIO is 4 byte aligned. Thus offset is calculated with "true offset" / 4
|
||||
* Example: PDEC_FAR = 0x2840 => Offset in virtual address space is 0xA10
|
||||
@ -138,7 +152,7 @@ private:
|
||||
static const uint32_t PDEC_BFREE_OFFSET = 0xA24;
|
||||
static const uint32_t PDEC_BPTR_OFFSET = 0xA25;
|
||||
static const uint32_t PDEC_SLEN_OFFSET = 0xA26;
|
||||
static const uint32_t PDEC_MON = 0xA27;
|
||||
static const uint32_t PDEC_MON_OFFSET = 0xA27;
|
||||
|
||||
#if BOARD_TE0720 == 1
|
||||
static const int CONFIG_MEMORY_MAP_SIZE = 0x400;
|
||||
@ -330,6 +344,29 @@ private:
|
||||
*/
|
||||
uint8_t getOddParity(uint8_t number);
|
||||
|
||||
/**
|
||||
* brief Returns the 32-bit wide communication link control word (CLCW)
|
||||
*/
|
||||
uint32_t getClcw();
|
||||
|
||||
/**
|
||||
* @brief Returns the PDEC monitor register content
|
||||
*
|
||||
*/
|
||||
uint32_t getPdecMon();
|
||||
|
||||
/**
|
||||
* @brief Reads and prints the CLCW. Can be useful for debugging.
|
||||
*/
|
||||
void printClcw();
|
||||
|
||||
/**
|
||||
* @brief Prints monitor register information to debug console.
|
||||
*/
|
||||
void printPdecMon();
|
||||
|
||||
std::string getMonStatusString(uint32_t status);
|
||||
|
||||
object_id_t tcDestinationId;
|
||||
|
||||
AcceptsTelecommandsIF* tcDestination = nullptr;
|
||||
|
Reference in New Issue
Block a user