本文整理汇总了C++中UART_Printf函数的典型用法代码示例。如果您正苦于以下问题:C++ UART_Printf函数的具体用法?C++ UART_Printf怎么用?C++ UART_Printf使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UART_Printf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SYSC_CLKInform
void SYSC_CLKInform(void)
{
u32 uTTT0, uTTT1;
SYSC_CtrlCLKOUT( eCLKOUT_APLLOUT, 4);
SYSC_GetClkInform();
UART_InitDebugCh(0, 115200);
uTTT0 = SYSC_RdLockDetect(eAPLL);
uTTT1= SYSC_RdLockDetect(eMPLL);
UART_Printf("\n\n");
UART_Printf("***************************************************\n");
UART_Printf("* S3C6410 - Test firmware v0.1 *\n");
UART_Printf("***************************************************\n");
UART_Printf("System ID : Revision [%d], Pass [%d]\n", g_System_Revision, g_System_Pass);
UART_Printf("ARMCLK: %.2fMHz HCLKx2: %.2fMHz HCLK: %.2fMHz PCLK: %.2fMHz\n",(float)g_ARMCLK/1.0e6, (float)g_HCLKx2/1.0e6, (float)g_HCLK/1.0e6, (float)g_PCLK/1.0e6);
UART_Printf("SYNC Mode : %d\n", g_SYNCACK);
UART_Printf("APLL Lock : %d, MPLL_Lock: %d\n", uTTT0, uTTT1);
UART_Printf("AMPLL: %.2fMHz \n",(float)g_MPLL/1.0e6);
UART_Printf("\n");
}
示例2: init
int init() {
// unselect all SPI devices first
SDCARD_Unselect();
ST7735_Unselect();
// initialize SD-card as fast as possible, it glitches otherwise
// (this is important only if SPI bus is shared by multiple devices)
int code = SDCARD_Init();
if(code < 0) {
UART_Printf("SDCARD_Init() failed, code = %d\r\n", code);
return -1;
}
ST7735_Init();
ST7735_FillScreen(ST7735_BLACK);
// mount the default drive
FRESULT res = f_mount(&fs, "", 0);
if(res != FR_OK) {
UART_Printf("f_mount() failed, res = %d\r\n", res);
return -2;
}
UART_Printf("f_mount() done!\r\n");
return 0;
}
示例3: SYSC_Test
void SYSC_Test(void)
{
u32 i;
s32 uSel;
UART_Printf("[SYSC_Test]\n\n");
Outp32Inform(0,0);
Outp32Inform(1,0);
Outp32Inform(2,0);
Outp32Inform(3,0);
Outp32Inform(4,0);
Outp32Inform(5,0);
Outp32Inform(6,0);
Outp32Inform(7,0);
while(1)
{
for (i=0; (u32)(sysc_menu[i].desc)!=0; i++)
UART_Printf("%2d: %s\n", i, sysc_menu[i].desc);
UART_Printf("\nSelect the function to test : ");
uSel =UART_GetIntNum();
UART_Printf("\n");
if(uSel == -1)
break;
if (uSel>=0 && uSel<(sizeof(sysc_menu)/8-1))
(sysc_menu[uSel].func) ();
}
}
示例4: My_LPT
static void My_LPT(void* pvParameters)
{
unsigned char LowPrio;
LED_PORT = LED_My_LPT; /* Led to indicate the execution of My_LPT*/
LowPrio = uxTaskPriorityGet(LPT_Handle);
UART_Printf("\n\rLPT:%d,Acquiring semaphore",LowPrio);
xSemaphoreTake(Sem_A,portMAX_DELAY);
UART_Printf("\n\rLPT: Creating HPT");
xTaskCreate( My_HPT, ( signed char * )"HighTask", configMINIMAL_STACK_SIZE, NULL, 3, &HPT_Handle );
LED_PORT = LED_My_LPT; /* Led to indicate the execution of My_LPT*/
LowPrio = uxTaskPriorityGet(LPT_Handle);
UART_Printf("\n\rLPT:%d Creating MPT",LowPrio);
xTaskCreate( My_MPT, ( signed char * )"MidTask", configMINIMAL_STACK_SIZE, NULL, 2, &MPT_Handle );
LED_PORT = LED_My_LPT; /* Led to indicate the execution of My_LPT*/
LowPrio = uxTaskPriorityGet(LPT_Handle);
UART_Printf("\n\rLPT:%d Releasing Semaphore",LowPrio);
xSemaphoreGive(Sem_A);
LED_PORT = LED_My_LPT; /* Led to indicate the execution of My_LPT*/
LowPrio = uxTaskPriorityGet(LPT_Handle);
UART_Printf("\n\rFinally Exiting LPT:%d",LowPrio);
vTaskDelete(LPT_Handle);
}
示例5: rtc_test
void rtc_test()
{
rtc_t rtc;
UART_Printf("\n\rConnections SCL->PC.3 SDA->PC.4");
UART_Printf("\n\r Make connections and hit 'k' to test! ");
while(UART_RxChar()!='k');
RTC_Init();
rtc.hour = 0x10; // 10:40:20 am
rtc.min = 0x40;
rtc.sec = 0x00;
rtc.date = 0x01; //1st Jan 2016
rtc.month = 0x01;
rtc.year = 0x16;
rtc.weekDay = 5; // Friday: 5th day of week considering monday as first day.
/*##### Set the time and Date only once. Once the Time and Date is set, comment these lines
and reflash the code. Else the time will be set every time the controller is reset*/
RTC_SetDateTime(&rtc); // 10:40:20 am, 1st Jan 2016
/* Display the Time and Date continuously */
while(1)
{
RTC_GetDateTime(&rtc);
UART_Printf("\n\rtime:%2x:%2x:%2x \nDate:%2x/%2x/%2x",(uint16_t)rtc.hour,(uint16_t)rtc.min,(uint16_t)rtc.sec,(uint16_t)rtc.date,(uint16_t)rtc.month,(uint16_t)rtc.year);
}
}
示例6: rtc_test
void rtc_test()
{
unsigned char sec,min,hour,day,month,year;
UART_Printf("\n\rConnections SCL->P0.6 SDA->P0.7");
UART_Printf("\n\r Make connections and hit 'k' to test! ");
while(UART_RxChar()!='k');
RTC_Init();
/*##### Set the time and Date only once. Once the Time and Date is set, comment these lines
and reflash the code. Else the time will be set every time the controller is reset*/
RTC_SetTime(0x10,0x40,0x00); // 10:40:20 am
RTC_SetDate(0x01,0x01,0x15); // 1st Jan 2015
/* Display the Time and Date continuously */
while(1)
{
RTC_GetTime(&hour,&min,&sec);
RTC_GetDate(&day,&month,&year);
UART_Printf("\n\rtime:%2x:%2x:%2x \nDate:%2x/%2x/%2x",(uint16_t)hour,(uint16_t)min,(uint16_t)sec,(uint16_t)day,(uint16_t)month,(uint16_t)year);
}
}
示例7: I2S_PCMDataOutIntr
void I2S_PCMDataOutIntr(AUDIO_PORT rhs_ePort)
{
UART_Printf("\nListen to Sound via Speak Out Connector.\n");
UART_Printf("Press any key to play.\n");
UART_Getc();
if ((g_oI2SInfor[rhs_ePort].m_CLKSRC != I2S_EXTERNALCDCLK) && (g_oI2SInfor[rhs_ePort].m_eOpMode == Master))
{
I2S_CDCLKOut(rhs_ePort);
}
else if ((g_oI2SInfor[rhs_ePort].m_CLKSRC == I2S_FIN) && (g_oI2SInfor[rhs_ePort].m_eOpMode == Slave))
{
I2S_CDCLKOut(rhs_ePort); //12MHz Out
}
else if ((g_oI2SInfor[rhs_ePort].m_CLKSRC != I2S_EXTERNALCDCLK) && (g_oI2SInfor[rhs_ePort].m_CLKSRC != I2S_FIN) && (g_oI2SInfor[rhs_ePort].m_eOpMode == Slave))
{
if ( g_oI2SInfor[rhs_ePort].m_dSamplingFreq % 11025)
I2S_SetEpllCDCLKOut(rhs_ePort, I2S_USERCLKOUT2); // 11.2896MHz Out
else
I2S_SetEpllCDCLKOut(rhs_ePort, I2S_USERCLKOUT1); // 12.288MHz Out
}
#if (I2S_CODEC == WM8753)
WM8753_CodecInitPCMOut(g_oI2SInfor[rhs_ePort].m_eDataFormat, (u32) g_oI2SInfor[rhs_ePort].m_dSamplingFreq,
g_oI2SInfor[rhs_ePort].m_eOpMode, g_oI2SInfor[rhs_ePort].m_eWordLength, SMDK_I2S);
#elif (I2S_CODEC == WM8990)
WM8990_CodecInitPCMOut(g_oI2SInfor[rhs_ePort].m_eDataFormat, (u32) g_oI2SInfor[rhs_ePort].m_dSamplingFreq,
g_oI2SInfor[rhs_ePort].m_eOpMode, g_oI2SInfor[rhs_ePort].m_eWordLength, SMDK_I2S);
#elif (I2S_CODEC == WM8580)
WM8580_CodecInitPCMOut(g_oI2SInfor[rhs_ePort].m_eDataFormat, (u32) g_oI2SInfor[rhs_ePort].m_dSamplingFreq,
g_oI2SInfor[rhs_ePort].m_eOpMode, g_oI2SInfor[rhs_ePort].m_eWordLength, SMDK_I2S);
#endif
I2SMOD_SetTXR(rhs_ePort, TXOnly);
I2S_DataOutIntr(rhs_ePort);
}
示例8: MyTask3
static void MyTask3(void* pvParameters)
{
LED_PORT = LED_Task3; /* Led to indicate the execution of Task3*/
UART_Printf("\n\rTask3, creating new tasks 2 and 4");
/* Create two new tasks 2, 4 */
xTaskCreate( MyTask2, ( signed char * )"Task2", configMINIMAL_STACK_SIZE, NULL, 2, &TaskHandle_2);
xTaskCreate( MyTask4, ( signed char * )"Task4", configMINIMAL_STACK_SIZE, NULL, 4, &TaskHandle_4);
LED_PORT = LED_Task3; /* Led to indicate the execution of Task3*/
UART_Printf("\n\rBack in Task3, Creating Task5");
xTaskCreate( MyTask5, ( signed char * )"Task5", configMINIMAL_STACK_SIZE, NULL, 5, &TaskHandle_5);
LED_PORT = LED_Task3; /* Led to indicate the execution of Task3*/
UART_Printf("\n\rBack in Task3, Waiting for some time");
vTaskDelay(200);
LED_PORT = LED_Task3; /* Led to indicate the execution of Task3*/
UART_Printf("\n\rFinally in Task3");
vTaskDelete(TaskHandle_3);
}
示例9: OtgDev_Test
//////////
// Function Name : OtgDev_Test
// Function Desctiption : test function of the OTG DEV
// Input : NONE
// Output : NONE
// Version :
void OtgDev_Test(void)
{
s32 i, sel;
const testFuncMenu menu[]=
{
Download_Only, "Donwload Only",
Upload_Only, "Upload Only",
Select_OpMode, "Select Op Mode",
0, 0
};
while(1)
{
UART_Printf("\n");
for (i=0; (int)(menu[i].desc)!=0; i++)
UART_Printf("%2d: %s\n", i, menu[i].desc);
UART_Printf("\nSelect the function to test : ");
sel = UART_GetIntNum();
UART_Printf("\n");
if (sel == -1)
break;
else if (sel>=0 && sel<(sizeof(menu)/8-1))
(menu[sel].func)();
}
}
示例10: Select_OpMode
//////////
// Function Name : Select_OpMode
// Function Description : This function selects an operation mode of USB OTG of CPU or DMA mode.
// Input : NONE
// Output : NONE
// Version :
void Select_OpMode(void)
{
int iSel;
UART_Printf(" Current Op Mode : ");
if(eOpMode == USB_CPU)
{
UART_Printf("CPU mode\n");
}
else if(eOpMode== USB_DMA)
{
UART_Printf("DMA mode\n");
}
UART_Printf(" Enter the op. mode (0: CPU_MODE, 1: DMA_MODE) : ");
iSel = UART_GetIntNum();
if (iSel != -1)
{
if (iSel == 0)
eOpMode = USB_CPU;
else if (iSel == 1)
eOpMode = USB_DMA;
else
UART_Printf("Invalid selection\n");
}
}
示例11: Capture_XY
void Capture_XY(void)
{
//u32 uXDat = 0;
//u32 uYDat = 0;
UART_Printf("\n\n[ADCTS touch screen Tracking test.]\n");
ADCTS_Init();
g_oADCTSInform.ucTouchStatus = ADCTS_TOUCH_INIT;
ADC_InitADCCON();
ADCTS_SetDelay(50000);
ADCTS_SetMeasureMode(eADCTS_MEASURE_FOR_STYLUS);
Delay(10000);
INTC_SetVectAddr(NUM_PENDNUP, ADCTS_ISR);
INTC_Enable(NUM_PENDNUP);
UART_Printf("\nPress any key to exit!!!\n");
UART_Printf("\nStylus Down, please...... \n");
// while(!GetKey())
// {
if (g_oADCTSInform.ucTouchStatus == ADCTS_TOUCH_DOWN)
{
while( ADCTS_GetXPStylusIntState() == STYLUS_DOWN )
{
ADC_InitADCCON();
ADCTS_SetMeasureMode(eADCTS_MEASURE_AUTO_SEQ);
ADC_EnableStart(ENABLE);
while(! (ADC_IsAfterStartup() )) ; // Wait for begin sampling
while (! (ADC_IsEOCFlag())); // Wait for the EOC
uXDat = ADCTS_GetXPData();
uYDat = ADCTS_GetYPData();
UART_Printf("X : %f, Y : %f\n",uXDat,uYDat);
ADCTS_SetMeasureMode(eADCTS_MEASURE_FOR_STYLUS);
ADCTS_SetStylusDetectMode(STYLUS_UP);
Delay(300);
}
}
// else if (g_oADCTSInform.ucTouchStatus == ADCTS_TOUCH_UP)
// {
// if ( ADCTS_GetXPStylusIntState() == STYLUS_UP )
// {
// ADCTS_SetMeasureMode(eADCTS_MEASURE_FOR_STYLUS);
// }
// }
// }
// INTC_Disable(NUM_PENDNUP);
UART_Printf("\n\n[ADCTS touch screen Tracking test End.]\n");
}
示例12: gpio_test
void gpio_test()
{
unsigned char i;
UART_Printf("\n\rConnect any IO Pins to buzzer, relays, leds ");
UART_Printf("\n\rMake connections and hit 'k' to test ");
while(UART_RxChar()!='k');
ADCON0 = 0x00;
ADCON1 = 0x07;
TRISA = C_PortOutput_U8;
TRISB = C_PortOutput_U8;
TRISC = C_PortOutput_U8;
TRISD = C_PortOutput_U8;
TRISE = C_PortOutput_U8;
while(1)
{
for(i=0;i<2;i++)
{
/* Turn On all the leds and wait for one second */
PORTA = 0xff;
PORTB = 0xff;
PORTC = 0xff;
PORTD = 0xff;
PORTE = 0xff;
DELAY_ms(500);
/* Turn off all the leds and wait for one second */
PORTA = 0x00;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
PORTE = 0x00;
DELAY_ms(500);
}
for(i=1;i;i=i<<1)
{
PORTA = i;
PORTB = i;
PORTC = i;
PORTD = i;
PORTE = i;
DELAY_ms(100);
}
for(i=0x80;i;i=i>>1)
{
PORTA = i;
PORTB = i;
PORTC = i;
PORTD = i;
PORTE = i;
DELAY_ms(100);
}
}
}
示例13: CompareData
void CompareData(void)
{
u32 uCnt;
u32 uBCnt;
u32 uFcnt=0;
// Clear Check Data ----------------START
pIrDA_CKBUFFER=(u8 *)MemoryCk;
for (uCnt=0; uCnt<0x100000; uCnt++)
{
// *pIrDA_CKBUFFER++ = 'U';
*pIrDA_CKBUFFER++ = 0x0; // for Performance test(to check signal)
// *pIrDA_CKBUFFER++ = uCnt;
}
pIrDA_CKBUFFER=(u8 *)MemoryCk;
// Clear Check Data -----------------END
UART_Printf("\nCount Number : ");
uBCnt=UART_GetIntNum();
UART_Printf("\n");
// Initialize Check Data ----------------START
pIrDA_CKBUFFER=(u8 *)MemoryCk;
for (uCnt=0; uCnt<uBCnt; uCnt++)
{
// *pIrDA_CKBUFFER++ = 'U';
// *pIrDA_CKBUFFER++ = 0x0; // for Performance test(to check signal)
*pIrDA_CKBUFFER++ = uCnt;
}
pIrDA_CKBUFFER=(u8 *)MemoryCk;
// Initialize Check Data -----------------END
pIrDA_RXBUFFER=(u8 *)MemoryRx;
for (uCnt=0; uCnt<=uBCnt; uCnt++)
{
if(*pIrDA_CKBUFFER != *pIrDA_RXBUFFER)
uFcnt++;
*pIrDA_CKBUFFER++;
*pIrDA_RXBUFFER++;
}
UART_Printf("Rx data Check Done!!\n");
UART_Printf("%d times have been failed\n",uFcnt);
}
示例14: MyTask5
static void MyTask5(void* pvParameters)
{
LED_PORT = LED_Task5; /* Led to indicate the execution of Task4*/
UART_Printf("\n\rIn Task5, waiting for some time");
vTaskDelay(200);
LED_PORT = LED_Task5; /* Led to indicate the execution of Task4*/
UART_Printf("\n\rBack in Task5");
vTaskDelete(TaskHandle_5);
}
示例15: I2S_ChangePort
AUDIO_PORT I2S_ChangePort(void)
{
AUDIO_PORT eSelPort;
UART_Printf("Which Port do you controll?\n");
UART_Printf("0. Port 0 1. Port 1 \n");
eSelPort = (AUDIO_PORT)UART_GetIntNum();
if (eSelPort == 1)
return AUDIO_PORT1;
else
return AUDIO_PORT0;
}