You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
2.1 KiB

#include "pru0Window.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
pru0Window::pru0Window() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 0, 18, 40, 17 );
#endif
};
pru0Window::~pru0Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void pru0Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 0, 18, 40, 17, "PRUSS0 Info" );
newtDrawForm( m_oForm );
#else
volatile pruCfg *c_pPRUSS = NULL;
volatile pruCtrl *c_pPRU = NULL;
c_pPRUSS = m_pSOC->getPRUSS_GFG( 0 );
c_pPRU = m_pSOC->getPRU_CTRL( 0, 0 );
createBox( true );
mvwprintw( m_pWND, 2,2, " PRUSS%d Config at: \t%p", 0, c_pPRUSS );
if( c_pPRUSS != NULL ) {
mvwprintw( m_pWND, 3,2, " PRUSS%d Revision ID: \t0x%08x", 0, c_pPRUSS->REVID );
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
if( c_pPRU != NULL ) {
mvwprintw( m_pWND, 4,2, " PRUSS%d_PRU%d INFO:", 0, 0 );
mvwprintw( m_pWND, 6,2, " soft reset bit: \t%d", c_pPRU->CTRL_bit.SOFT_RST_N );
mvwprintw( m_pWND, 7,2, " enable bit: \t\t%d", c_pPRU->CTRL_bit.ENABLE );
mvwprintw( m_pWND, 8,2, " sleeping bit: \t%d", c_pPRU->CTRL_bit.SLEEPING );
mvwprintw( m_pWND, 9,2, " counter enable bit: \t%d", c_pPRU->CTRL_bit.COUNTER_ENABLE );
mvwprintw( m_pWND, 10,2, " single step bit: \t%d", c_pPRU->CTRL_bit.SINGLE_STEP );
mvwprintw( m_pWND, 11,2, " run state bit: \t%d", c_pPRU->CTRL_bit.RUNSTATE );
mvwprintw( m_pWND, 12,2, " PC counter init val: x%08x", c_pPRU->CTRL_bit.PCOUNTER_RST_VAL );
mvwprintw( m_pWND, 13,2, " PC counter value: \t%d", c_pPRU->STS_bit.PCOUNTER );
mvwprintw( m_pWND, 14,2, " cycle count value: \t%d", c_pPRU->CYCLE_bit.CYCLECOUNT );
mvwprintw( m_pWND, 15,2, " stall count value: \t%d", c_pPRU->STALL_bit.STALLCOUNT );
} else {
mvwprintw( m_pWND, 4,2, " NO PRU INFO" );
}
wrefresh( m_pWND );
#endif
};