#include "adc1Window.h" //#include "../../source/lib/hardware/soc/modules/adc/adc_ss.h" #ifdef NEWT_CLI adc1Window::adc1Window(){ m_pSOC = classSOC::getInstance(); m_x = 81; m_y = 18; m_w = 44; m_h = 17; m_l1 = newtLabel( 3, 1, "ADC1 Config:" ); m_t1 = newtTextbox( 3, 3, 38, 1, 0 ); m_t2 = newtTextbox( 3, 4, 38, 1, 0 ); m_t3 = newtTextbox( 3, 5, 38, 1, 0 ); m_t4 = newtTextbox( 3, 6, 38, 1, 0 ); m_t5 = newtTextbox( 3, 7, 38, 1, 0 ); m_t6 = newtTextbox( 3, 8, 38, 1, 0 ); m_t7 = newtTextbox( 3, 9, 38, 1, 0 ); m_t8 = newtTextbox( 3, 10, 38, 1, 0 ); m_t9 = newtTextbox( 3, 11, 38, 1, 0 ); m_t10 = newtTextbox( 3, 12, 38, 1, 0 ); m_t11 = newtTextbox( 3, 13, 38, 1, 0 ); m_b1 = newtCompactButton( 3, 15, "Close" ); newtFormAddComponents( m_oForm, m_l1, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_b1, NULL ); //newtFormSetBackground( m_oForm, NEWT_COLORSET_CHECKBOX ); //paint(); }; adc1Window::~adc1Window(){ newtPopWindow(); }; void adc1Window::paint(){ volatile sysAdc1MagSs *c_pADC = NULL; char tBuffer[245]; c_pADC = m_pSOC->getADC1_CTRL(); //newtOpenWindow( m_x, m_y, m_w, m_h, "ADC Info" ); newtCenteredWindow( m_w, m_h, "ADC Info" ); if( c_pADC != NULL ) { sprintf( tBuffer, "ADC1 Revision ID: \t0x%08x", c_pADC->REVISION ); newtTextboxSetText( m_t1, tBuffer ); sprintf( tBuffer, "ADC CTRL: \t\t%08x", c_pADC->CTRL ); newtTextboxSetText( m_t2, tBuffer ); sprintf( tBuffer, "ADC STEPEN: \t\t%08x", c_pADC->STEPEN ); newtTextboxSetText( m_t3, tBuffer ); sprintf( tBuffer, "Seq[0]: \t\t%08x", c_pADC->STEPCONFIG1 ); newtTextboxSetText( m_t4, tBuffer ); sprintf( tBuffer, "Seq[1]: \t\t%08x", c_pADC->STEPCONFIG2 ); newtTextboxSetText( m_t5, tBuffer ); sprintf( tBuffer, "Seq[2]: \t\t%08x", c_pADC->STEPCONFIG3 ); newtTextboxSetText( m_t6, tBuffer ); sprintf( tBuffer, "Seq[3]: \t\t%08x", c_pADC->STEPCONFIG4 ); newtTextboxSetText( m_t7, tBuffer ); sprintf( tBuffer, "Seq[4]: \t\t%08x", c_pADC->STEPCONFIG5 ); newtTextboxSetText( m_t8, tBuffer ); sprintf( tBuffer, "Seq[5]: \t\t%08x", c_pADC->STEPCONFIG6 ); newtTextboxSetText( m_t9, tBuffer ); sprintf( tBuffer, "Seq[6]: \t\t%08x", c_pADC->STEPCONFIG7 ); newtTextboxSetText( m_t10, tBuffer ); sprintf( tBuffer, "Seq[7]: \t\t%08x", c_pADC->STEPCONFIG8 ); newtTextboxSetText( m_t11, tBuffer ); } else { sprintf( tBuffer, "Not Initialized" ); newtTextboxSetText( m_t1, tBuffer ); } newtDrawForm( m_oForm ); newtRefresh(); }; #else // Constructor implementation adc1Window::adc1Window() : WindowCLI( NULL ){ m_pSOC = classSOC::getInstance(); create( 81, 18, 40, 17 ); }; void adc1Window::paint( void ){ volatile sysAdc1MagSs *c_pADC = NULL; c_pADC = m_pSOC->getADC1_CTRL(); createBox( true ); mvwprintw( m_pWND, 2,2, " ADC%d Config at: \t%p", 1, c_pADC ); if( c_pADC != NULL ) { mvwprintw( m_pWND, 3,2, " ADC%d Revision ID: \t0x%08x", 1, c_pADC->REVISION ); } else { mvwprintw( m_pWND, 3,2, " Not Init" ); } if( c_pADC != NULL ) { mvwprintw( m_pWND, 4,2, " ADC%d INFO:", 1 ); mvwprintw( m_pWND, 6,2, " ADC CTRL: \t\t%08x", c_pADC->CTRL ); mvwprintw( m_pWND, 7,2, " ADC STEPEN: \t\t%08x", c_pADC->STEPEN ); mvwprintw( m_pWND, 8,2, " Seq[0]: \t\t%08x", c_pADC->STEPCONFIG[0].CONFIG ); mvwprintw( m_pWND, 9,2, " Seq[1]: \t\t%08x", c_pADC->STEPCONFIG[1].CONFIG ); mvwprintw( m_pWND, 10,2, " Seq[2]: \t\t%08x", c_pADC->STEPCONFIG[2].CONFIG ); mvwprintw( m_pWND, 11,2, " Seq[3]: \t\t%08x", c_pADC->STEPCONFIG[3].CONFIG ); mvwprintw( m_pWND, 12,2, " Seq[4]: \t\t%08x", c_pADC->STEPCONFIG[4].CONFIG ); mvwprintw( m_pWND, 13,2, " Seq[5]: \t\t%08x", c_pADC->STEPCONFIG[5].CONFIG ); mvwprintw( m_pWND, 14,2, " Seq[6]: \t\t%08x", c_pADC->STEPCONFIG[6].CONFIG ); mvwprintw( m_pWND, 15,2, " Seq[7]: \t\t%08x", c_pADC->STEPCONFIG[7].CONFIG ); } else { mvwprintw( m_pWND, 4,2, " NO ADC INFO" ); } wrefresh( m_pWND ); }; #endif