资源简介
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之间的转换实现
相关资源
- WIFI串口调试助手APK
- mySerialPort.rar
- STM32F407 USB虚拟串口
- CC2530_spi通信
- udp网络通信源代码(单播、组播、广
- verilog 实现串口通信 含fifo很好用!
- 在PCS7中如何实现CP341做从站进行MODB
- fpga串口通信,利用fifo转发
- LABVIEW中串口程序大全.rar
- stm8双机iic通讯程序
- 基于STM8定制轻量操作系统Aatomthreads官
- stm32F407ADC电压采集串口输出程序
- Arduino串口转发源代码
- Qt mqtt通信
- CC2530+OLED电压信号模拟信号显示串口传
- servlet获取表单数据详解十分全
- 单片机单总线通信的自已编写
- 带串口通信的温度控制器(带proteus仿
- 用vhdl语言设计交通信号灯控制器
- AD7606原理图库+并口,串口原理图
- 攻击图技术应用研究综述
- Socket 进程通信(类似QQ的聊天程序)
- 串口调试助手源码(绝对正版)
- 无线通信与网络(课后习题答案)
- SerialDebug V3.0
- 51 单片机串口通信程序,RS232串口通信
- 水下光通信技术的研究
- LabVIEW与USB串口通信源代码
- LCD12864驱动及接口程序(SPI通信)
- STM32F107实现DP83848-UDP-TCP通信程序
评论
共有 条评论