資源簡介
stm32 串口 打印程序。C語言編寫。
打印機。

代碼片段和文件信息
#include?????????????????????????//?主頭文件,引用了所以其他頭文件
#include?“STM32_Init.h“???????????????????????????//?STM32初始化庫
#include?“stdio.h“
//void?delay(unsigned?int?n)
//{
// for(;n>0;n--);
//}
int?SendChar?(int?ch)??
{
??while?(!(USART1->SR?&?USART_FLAG_TXE)); ??//USART_FLAG_TXE=1數據已經轉移到移位寄存器
//??if(ch==‘c‘)
?//?{
?? USART1->DR?=?(ch?&?0x1FF);
?//?}
?//?else
?//? USART1->DR=‘E‘;
??return?(ch);
}
int?GetKey(int?ch)
{
while(!(USART1->SR&USART_FLAG_RXNE)); ???//USART_FLAG_RXNE=1收到數據?可以讀出
return((int)(USART1->DR&0X1FF)); ???//返回讀出的數據
}
int?main(void)
{
unsigned?char?c;
stm32_Init();
while(1)
{
printf(“hallo?word!\n“);
c=getchar();
printf(“\n“);
printf(“you?press?the?key?is?‘%c‘\n“c);
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????821??2009-12-30?13:13??hallo?word\code\mian.c
?????文件???????2388??2009-12-29?23:10??hallo?word\code\Retarget.c
?????文件??????65598??2009-12-30?13:46??hallo?word\code\STM32_Init.c
?????文件???????1185??2008-09-23?08:18??hallo?word\code\STM32_Init.h
?????文件???????8609??2008-09-23?08:18??hallo?word\code\STM32_Reg.h
?????文件??????60025??2009-12-30?13:47??hallo?word\hallo?word.map
?????文件???????2597??2010-01-15?15:12??hallo?word\hallo?word.Opt
?????文件????????171??2009-12-29?16:32??hallo?word\hallo?word.plg
?????文件???????2655??2009-12-29?17:14??hallo?word\hallo?word.Uv2
?????文件???????4582??2010-01-15?15:04??hallo?word\hallo?word_hallo?word.dep
?????文件???????2589??2009-12-30?13:47??hallo?word\hallo?word_Opt.Bak
?????文件?????????77??2009-12-29?16:32??hallo?word\hallo?word_Target?1.dep
?????文件??????25224??2009-12-30?13:47??hallo?word\output\hallo?word.axf
?????文件???????4318??2009-12-30?13:47??hallo?word\output\hallo?word.hex
?????文件??????35162??2009-12-30?13:47??hallo?word\output\hallo?word.htm
?????文件????????347??2009-12-30?13:47??hallo?word\output\hallo?word.lnp
?????文件????????187??2010-01-15?15:04??hallo?word\output\hallo?word.plg
?????文件????????479??2009-12-29?16:34??hallo?word\output\hallo?word.sct
?????文件???????1180??2009-12-30?13:47??hallo?word\output\hallo?word.tra
?????文件?????151956??2009-12-30?13:47??hallo?word\output\mian.crf
?????文件???????1898??2009-12-30?13:47??hallo?word\output\mian.d
?????文件?????173364??2009-12-30?13:47??hallo?word\output\mian.o
?????文件???????5622??2009-12-30?13:47??hallo?word\output\retarget.crf
?????文件????????142??2009-12-30?13:47??hallo?word\output\retarget.d
?????文件??????10960??2009-12-30?13:47??hallo?word\output\retarget.o
?????文件???????5184??2009-12-30?13:47??hallo?word\output\STM32F10x.o
?????文件?????161900??2009-12-30?13:47??hallo?word\output\stm32_init.crf
?????文件???????2036??2009-12-30?13:47??hallo?word\output\stm32_init.d
?????文件?????180460??2009-12-30?13:47??hallo?word\output\stm32_init.o
?????文件??????10613??2009-12-19?20:42??hallo?word\start\STM32F10x.s
............此處省略8個文件信息
- 上一篇:自適應霍夫曼編碼(C++)
- 下一篇:數據結構 C語言 迷宮問題求解 棧
評論
共有 條評論