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

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "pru1Window.h"
  2. #include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
  3. pru1Window::pru1Window() : WindowCLI( NULL ){
  4. m_pSOC = classSOC::getInstance();
  5. #ifdef NEWT_CLI
  6. #else
  7. create( 40, 18, 40, 17 );
  8. #endif
  9. };
  10. pru1Window::~pru1Window(){
  11. #ifdef NEWT_CLI
  12. newtPopWindow();
  13. #else
  14. #endif
  15. };
  16. void pru1Window::paint( void ){
  17. #ifdef NEWT_CLI
  18. newtOpenWindow( 40, 18, 40, 17, "PRUSS0 Info" );
  19. newtDrawForm( m_oForm );
  20. #else
  21. volatile pruCfg *c_pPRUSS = NULL;
  22. volatile pruCtrl *c_pPRU = NULL;
  23. c_pPRUSS = m_pSOC->getPRUSS_GFG( 1 );
  24. c_pPRU = m_pSOC->getPRU_CTRL( 1, 0 );
  25. createBox( true );
  26. mvwprintw( m_pWND, 2,2, " PRUSS%d Config at: \t%p", 1, c_pPRUSS );
  27. if( c_pPRUSS != NULL ) {
  28. mvwprintw( m_pWND, 3,2, " PRUSS%d Revision ID: \t0x%08x", 1, c_pPRUSS->REVID );
  29. } else {
  30. mvwprintw( m_pWND, 3,2, " Not Init" );
  31. }
  32. if( c_pPRU != NULL ) {
  33. mvwprintw( m_pWND, 4,2, " PRUSS%d_PRU%d INFO:", 1, 0 );
  34. mvwprintw( m_pWND, 6,2, " soft reset bit: \t%d", c_pPRU->CTRL_bit.SOFT_RST_N );
  35. mvwprintw( m_pWND, 7,2, " enable bit: \t\t%d", c_pPRU->CTRL_bit.ENABLE );
  36. mvwprintw( m_pWND, 8,2, " sleeping bit: \t%d", c_pPRU->CTRL_bit.SLEEPING );
  37. mvwprintw( m_pWND, 9,2, " counter enable bit: \t%d", c_pPRU->CTRL_bit.COUNTER_ENABLE );
  38. mvwprintw( m_pWND, 10,2, " single step bit: \t%d", c_pPRU->CTRL_bit.SINGLE_STEP );
  39. mvwprintw( m_pWND, 11,2, " run state bit: \t%d", c_pPRU->CTRL_bit.RUNSTATE );
  40. mvwprintw( m_pWND, 12,2, " PC counter init val: x%08x", c_pPRU->CTRL_bit.PCOUNTER_RST_VAL );
  41. mvwprintw( m_pWND, 13,2, " PC counter value: \t%d", c_pPRU->STS_bit.PCOUNTER );
  42. mvwprintw( m_pWND, 14,2, " cycle count value: \t%d", c_pPRU->CYCLE_bit.CYCLECOUNT );
  43. mvwprintw( m_pWND, 15,2, " stall count value: \t%d", c_pPRU->STALL_bit.STALLCOUNT );
  44. } else {
  45. mvwprintw( m_pWND, 4,2, " NO PRU INFO" );
  46. }
  47. wrefresh( m_pWND );
  48. #endif
  49. };