资源简介
STM8 模拟串口 IO口模拟,实现接收数据返回测试
代码片段和文件信息
/**
******************************************************************************
* @file main.c
* @brief This file contains the firmware main function.
* @author STMicroelectronics - MCD Application Team
* @version V1.0.0
* @date 10/13/2008
******************************************************************************
*
* 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.
* FOR MORE INFORMATION PLEASE CAREFULLY READ THE LICENSE AGREEMENT FILE
* LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.
*
* © COPYRIGHT 2008 STMicroelectronics
* @image html logo.bmp
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “stm8s.h“
#include “swuart.h“
/**
* @addtogroup SW_UART
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Evalboard I/Os configuration */
#define LEDS_PORT (GPIOA)
#define ALL_LEDs (GPIO_PIN_3) // LEDs mask (EVAL board)
/* Private macro -------------------------------------------------------------*/
#define switch_all_LEDs_on { GPIO_WriteHigh(LEDS_PORT ALL_LEDs); } //LEDs control
#define switch_all_LEDs_off { GPIO_WriteLow(LEDS_PORT ALL_LEDs); }
/* Private variables ---------------------------------------------------------*/
u8 tx_byte; // transmitted byte
/* Private function prototypes -----------------------------------------------*/
/**
* @brief Programable loop delay
* @par Parameters:
* wt: number of loops
* @retval None
*/
void delay_loop(u16 wt) {
while(wt--);
}
/* ---------------------------------------------------------------------------*/
/**
* @brief Simple example of use swuart procedures
* @par Parameters:
* None
* @retval None
*/
void main(void) {
u8 buff sts;
#ifdef TO_HSE
ErrorStatus val;
#endif
// *** GPIO INIT ***
GPIO_Init(LEDS_PORT ALL_LEDs GPIO_MODE_OUT_PP_LOW_FAST);
// *** CLK INIT ***
#ifdef TO_HSE
CLK_SYSCLKConfig(CLK_PRESCALER_CPUDIV1); // set the highest HSE speed
val= CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTOCLK_SOURCE_HSEDISABLECLK_CURRENTCLOCKSTATE_ENABLE);
#else
CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV1); // set the highest HSI speed
#endif
uart_init(); // init pins and variables of SW UART
uart_receive_enable; // e
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4955 2017-03-18 13:09 AN2781\Swuart_AN\include\stm8s_conf.h
文件 3666 2009-11-18 17:08 AN2781\Swuart_AN\include\stm8s_it.h
文件 7888 2017-03-18 13:31 AN2781\Swuart_AN\include\swuart.h
文件 5469 2017-03-18 13:45 AN2781\Swuart_AN\Project\Debug\Exe\Swuart.hex
文件 67408 2017-03-18 13:45 AN2781\Swuart_AN\Project\Debug\Exe\Swuart.out
文件 8912 2017-03-18 13:45 AN2781\Swuart_AN\Project\Debug\Obj\main.o
文件 308481 2017-03-18 13:45 AN2781\Swuart_AN\Project\Debug\Obj\main.pbi
文件 10338 2017-03-18 13:45 AN2781\Swuart_AN\Project\Debug\Obj\main.pbi.cout
文件 54109 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_adc1.o
文件 327329 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_adc1.pbi
文件 10364 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_adc1.pbi.cout
文件 10364 2017-03-18 13:05 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_adc2.pbi.cout
文件 16572 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_awu.o
文件 305785 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_awu.pbi
文件 10363 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_awu.pbi.cout
文件 11078 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_beep.o
文件 304667 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_beep.pbi
文件 10364 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_beep.pbi.cout
文件 10363 2017-03-18 13:05 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_can.pbi.cout
文件 55180 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_clk.o
文件 324318 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_clk.pbi
文件 10363 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_clk.pbi.cout
文件 13844 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_exti.o
文件 306821 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_exti.pbi
文件 10364 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_exti.pbi.cout
文件 45931 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_flash.o
文件 319413 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_flash.pbi
文件 10365 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_flash.pbi.cout
文件 23048 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_gpio.o
文件 307328 2017-03-18 13:09 AN2781\Swuart_AN\Project\Debug\Obj\stm8s_gpio.pbi
............此处省略129个文件信息
- 上一篇:工业机器人技术课件ppt内容全
- 下一篇:2019美赛原题和翻译
相关资源
- stm8s003f3最小系统原理图
- 智能车载空气净化器的完整设计
- STM8S003F3-数据手册
- stm8 红外收发
- STM8S103中文数据手册
- 基于stm8s103f3p6的NRF24L01收发模块资料电
- STM8S的固件库V2.1.0
- STM8程序IAR环境
- 普通IO口模拟spi,stm8程序
- STM8L标准库,包含10x和15x两个系列,解
- stm8l使用AD测量内部温度 库函数版本工
- STM8L101官方例程
- STM8L标准库函数库c
-
STM8 ST-li
nk驱动 - STM8L15例程
- STM8官方老版本电机库
- stm8s ds18b20 温度传感器 IAR函数库源代
- stm8固件库函数使用手册
- 调试OK的stm8+rc522原理图和源代码
- CC1101IARForSTM8源码
- STM8芯片S系列的完整固件库
- STM8S固件库
- STM8单片机3通道ADC数据采集及串口波形
- STM8S003 IAR环境库函数模拟串口
- STM8s003 IAR库函数定时器1输入捕获功能
- STM8S103F3封装库ddb(schpcb)
- sx1278+stm8s lora通信及信号强度提取
- stm8+SHTC3.zip
- 基于STM8S103F3P6的模拟串口程序
- stm8l151串口通信例程
评论
共有 条评论