资源简介
STM8 串口通信模板 要实现的功能需要自己添加

代码片段和文件信息
/**
******************************************************************************
* @file UART1_HalfDuplex\main.c
* @author MCD Application Team
* @version V2.0.0
* @date 25-February-2011
* @brief This file contains the main function for UART1 in Half-Duplex mode example.
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* © COPYRIGHT 2011 STMicroelectronics
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “stm8s.h“
/**
* @addtogroup UART1_HalfDuplex
* @{
*/
/* Private typedef -----------------------------------------------------------*/
typedef enum {FAILED = 0 PASSED = !FAILED} TestStatus;
/* Private define ------------------------------------------------------------*/
#define TxBufferSize1 (countof(TxBuffer1) - 1)
#define TxBufferSize2 (countof(TxBuffer2) - 1)
/* Private macro -------------------------------------------------------------*/
#define countof(a) (sizeof(a) / sizeof(*(a)))
/* To run the transmitter connect the UART1_TX on the UART3_RX uncomment the line
“#define transmitter“ and comment the line “#define receiver“ */
#define transmitter
/* To run the transmitter connect the UART1_TX on the UART3_TX uncomment the line
“#define receiver“ and comment the line “#define transmitter“ */
#define receiver
/* Private variables ---------------------------------------------------------*/
uint8_t TxBuffer1[] = “HalfDuplex Example: UART1 -> UART3 using HalfDuplex mode“;
uint8_t TxBuffer2[] = “HalfDuplex Example: UART3 -> UART1 using HalfDuplex mode“;
uint8_t RxBuffer1[TxBufferSize2]={0};
uint8_t RxBuffer2[TxBufferSize1]={0};
uint8_t NbrOfDataToRead1 = TxBufferSize2;
uint8_t NbrOfDataToRead2 = TxBufferSize1;
uint8_t TxCounter1 = 0 RxCounter1 = 0;
uint8_t TxCounter2 = 0 RxCounter2 = 0;
__IO TestStatus TransferStatus1 = FAILED TransferStatus2 = FAILED;
/* Private function prototypes -----------------------------------------------*/
TestStatus Buffercmp(uint8_t* pBuffer1 uint8_t* pBuffer2 uint16_t BufferLength);
static void CLK_Config(void);
static void UART_Config(void);
static void GPIO_Config(void);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program.
* @param None
* @retval None
*/
void
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4299 2011-02-25 17:26 stm8s_conf.h
文件 13352 2011-02-25 17:26 stm8s_it.c
文件 5214 2011-02-25 17:26 stm8s_it.h
文件 7896 2011-02-25 17:22 main.c
文件 4284 2011-02-25 17:22 readme.txt
----------- --------- ---------- ----- ----
35045 5
- 上一篇:深度学习综述英文
- 下一篇:正规文法_NFA_DFA之间的转换实现
相关资源
- 易语言OTG串口通信
- delphi 串口通讯
- STM32 2.4G通信例程
- Visio图标-最新最全的网络通信图标库
- 基于蓝牙4.0的设备通信方案设计与实
- STM32蓝牙和串口程序
- LCD显示温度+串口接收温度.rar
- WPF USB 网络 串口 通信软件
- 使用选择性重传协议实现UDP可靠通信
- DELPHI与西门子200PLC的串口通信实例
- Labview与CH372CH375的通信测试
- Verilog FPGA UART串口控制器
- 通信软件的具体实例──基于Socket的
- USB转串口驱动,FT232R驱动程序,最新
- PC -- 单片机的串口数据传输系统设计
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- PC 串口调试软件
- 51单片机读取温度数据存储到SD卡中并
- 防火墙编程-Visual C 网络通信开发
- 单片机与PC机串口通讯仿真
- 串口调试助手V5.0
- 双串口调试助手 V4.0 _ 可同时调试两个
- 读取串口数据并画实时曲线的VC 程序
- 通信原理各种调制与解调的C程序
- 课程设计蔬菜大棚自动控制系统,包
- 网络(UDP)转串口程序
- MCGS与单片机通信
- 清华通信重要国际学术会议目录
- 串口绘制曲线 将收到的数据进行曲线
评论
共有 条评论