摘要: 1 /**********串口1初始化函数**********/ 2 //bound:波特率 3 void My_USART1_Init(u32 bound) 4 { 5 //定义结构体变量 6 GPIO_InitTypeDef GPIO_InitStructure; 7 USART_InitTyp 阅读全文
posted @ 2019-12-09 15:51 迪迦奥特快 阅读(690) 评论(0) 推荐(0) 编辑
摘要: 前言STM32固件库中提供了串口收发的标志位函数,包括USART_GetFlagStatus(…,…);和USART_GetITStatus(…,…);,两者容易混淆,重点区别就在于:前者返回值是中断标志位状态(读SR寄存器),后者返回值是中断发生与否的判断(读CR寄存器),以下主要对这两个函数进行 阅读全文
posted @ 2019-12-09 14:30 迪迦奥特快 阅读(5014) 评论(0) 推荐(0) 编辑
摘要: 1.fgetc(FILE *fp) 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 FILE *fp; 7 int ch; 8 if((fp=fopen("demo.txt","r"))==NULL) 9 { 10 pr 阅读全文
posted @ 2019-12-09 10:30 迪迦奥特快 阅读(1321) 评论(0) 推荐(0) 编辑