资源简介
两块stm32见通过Usart通信的代码,望对大家有帮助
代码片段和文件信息
/* Includes ------------------------------------------------------------------*/
#include “main.h“
#include “stm32f10x.h“
#include “stm3210c_eval_lcd.h“
#include “stm32_eval.h“
#include
/** @addtogroup STM32F10x_StdPeriph_Examples
* @{
*/
/** @addtogroup GPIO_JTAG_Remap
* @{
*/
/* Private typedef -----------------------------------------------------------*/
typedef enum { FAILED = 0 PASSED = !FAILED} TestStatus;
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimebaseInitTypeDef TIM_TimebaseStructure;
USART_InitTypeDef USART_InitStructure;
static __IO uint32_t TimingDelay;
//static float temperature; /* temperature */
//static float humidity; /* humidity */
int TIM1Counter;
/** @addtogroup sensor_temperature
* @{
*/
uint8_t TxCounter = 0 ;
//uint8_t RxCounter = 0 ;
unsigned char TxBuffer[3]={0x000x000x00};
//unsigned char RxBuffer[3]={0x000x000x00};
u32 readyToSendReport = REPORT_INTERVAL;
extern uint16_t Xaddr;
extern uint8_t Yaddr;
ErrorStatus HSEStartUpStatus;
/* Private functions ---------------------------------------------------------*/
void RCC_Configuration(void);
void GPIO_Configuration(void);
//TestStatus Buffercmp(uint8_t* pBuffer1 uint8_t* pBuffer2 uint16_t BufferLength);
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
float Distance;
/* Configure the system clocks and GPIO */
RCC_Configuration();
GPIO_Configuration();
TIM_Init();
/**/
USART_InitStructure.USART_BaudRate = 9600;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Tx|USART_Mode_Rx;
/* Configure USARTy */
USART_Init(USART2 &USART_InitStructure);
/* Configure USARTz */
//USART_Init(USART3 &USART_InitStructure);
/* Enable the USARTy */
USART_Cmd(USART2 ENABLE);
/* Enable the USARTz */
//USART_Cmd(USART3 ENABLE);
/* Initialize the LCD */
STM3210C_LCD_Init();
/* Clear the LCD */
LCD_Clear(White);
/* Set the LCD Text Color */
LCD_SetTextColor(Black);
printf(“ STM3210C-EVAL \n“);
printf(“ transmit distance by USART \n“) ;
//GPIO_Configuration();
/* Initialize LEDs */
STM_EVAL_LEDInit(LED1);
STM_EVAL_LEDInit(LED2);
STM_EVAL_LEDInit(LED3);
STM_EVAL_LEDInit(LED4);
/* Setup SysTick Timer for 1 msec interrupts */
if (SysTick_Config(SystemFrequency / 1000000))
{
/* Capture error */
while (1);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-10-10 15:45 两块中断(未加协议)\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\
文件 17206 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\core_cm3.c
文件 46533 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\core_cm3.h
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\arm\
文件 15600 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_cl.s
文件 15872 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_hd.s
文件 12164 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_ld.s
文件 12564 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\arm\startup_stm32f10x_md.s
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\gcc\
文件 12531 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_cl.s
文件 13007 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_hd.s
文件 9505 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_ld.s
文件 9994 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\gcc\startup_stm32f10x_md.s
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\iar\
文件 16309 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_cl.s
文件 16709 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_hd.s
文件 12333 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_ld.s
文件 12594 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\startup\iar\startup_stm32f10x_md.s
文件 593385 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\stm32f10x.h
文件 30616 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\system_stm32f10x.c
文件 2404 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\CM3\system_stm32f10x.h
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\CMSIS\Core\Documentation\
文件 52463 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\Core\Documentation\CMSIS_Core.htm
文件 39936 2009-06-23 13:55 两块中断(未加协议)\发送\Libraries\CMSIS\License.doc
目录 0 2012-10-10 15:43 两块中断(未加协议)\发送\Libraries\STM32F10x_StdPeriph_Driver\
............此处省略341个文件信息
相关资源
- CH451手册及按键源码
- stm32-小车超声波避障v3.5
- STM32双机通讯
- STM32F103_SPI驱动nRF24L01
- STM32F107-lwip-UDP-client发送数据
- 电子设计大赛电源组PID程序
- STM32定时器产生PWM波控制电机寄存器版
- stm32+esp8266上传数据到移动onenet平台
- INA226硬件IICSTM32F4驱动.7z
- 基于stm32f103vc的超声波测距
- STM32 语音模块资料
- MS5837水深传感器-stm32程序源码
- STM32F103 SX1278通讯程序
- STM32F103C8T6定时器秒表TM1650显示.rar
- ULN2003驱动28BYJ-48步进电机STM32F103库函
- stm32sk6812灯带
- stm32+ov7670+颜色识别追踪
- STM32F0工程模板
- 基于STM32室内温度报警控制系统设计
- STM32F103串口使用空闲IDLE中断接收不定
- STM32+USB+W25Q实现U盘程序
- BQ40Z50通讯正常-基于STM32F0.rar
- 基于STM32单片机的窗帘自动控制系统设
- STM32_ADC+TIM+DMA
- lsm303dlhc Stm32f103 驱动程序
- 基于MQ135+STM32的环境空气质量检测
- STM32编码器程序
- ARM stm32f407 开发板原理图及 PCB图
- STM32驱动12864点阵LCD,多级菜单,完整
- 基于LABVIEW的STM32F0多路数据采集系统源
评论
共有 条评论