资源简介
STM8新建IAR工程模版,本例程用的是STM8S003,很容易移植到其他系列,同时加入了简单的串口代码。
代码片段和文件信息
#include “debug.h“
#include “stm8s.h“
#include “uart.h“
#define DEBUGEN 1
#ifdef USE_STANDARD_PRINTF
/**
* @brief Retargets the C library printf function to the UART.
* @param c Character to send
* @retval char Character sent
*/
PUTCHAR_PROTOTYPE
{
/* Write a character to the UART1 */
UART1_SendData8(c);
/* Loop until the end of transmission */
while (UART1_GetFlagStatus(UART1_FLAG_TXE) == RESET);
return (c);
}
/**
* @brief Retargets the C library scanf function to the USART.
* @param None
* @retval char Character to Read
*/
GETCHAR_PROTOTYPE
{
#ifdef _COSMIC_
char c = 0;
#else
int c = 0;
#endif
/* Loop until the Read data register flag is SET */
while (UART1_GetFlagStatus(UART1_FLAG_RXNE) == RESET);
c = UART1_ReceiveData8();
return (c);
}
#else
void DebugPrintStr(const char *str)
{
if(DEBUGEN)
{
UartSendString(str);
}
}
#endif
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file uint32_t line)
{
/* User can add his own implementation to report the file name and line number
ex: printf(“Wrong parameters value: file %s on line %d\r\n“ file line) */
/* Infinite loop */
while (1)
{
}
}
#endif
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1518 2018-12-29 14:39 stm8-project\APP\debug.c
文件 551 2018-12-29 14:40 stm8-project\APP\debug.h
文件 371 2018-12-26 11:16 stm8-project\APP\delay.c
文件 130 2018-12-26 11:09 stm8-project\APP\delay.h
文件 1386 2019-01-04 10:27 stm8-project\APP\uart.c
文件 255 2019-01-03 19:30 stm8-project\APP\uart.h
文件 3 2019-01-04 09:14 stm8-project\BuildLog.log
文件 5770 2019-01-04 10:36 stm8-project\Debug\Exe\stm8.hex
文件 70876 2019-01-04 10:36 stm8-project\Debug\Exe\stm8.out
文件 19987 2019-01-04 10:36 stm8-project\Debug\List\stm8.map
文件 6124 2019-01-04 10:36 stm8-project\Debug\Obj\debug.o
文件 325047 2019-01-04 10:26 stm8-project\Debug\Obj\debug.pbi
文件 11471 2019-01-04 10:26 stm8-project\Debug\Obj\debug.pbi.xcl
文件 5538 2019-01-04 10:36 stm8-project\Debug\Obj\delay.o
文件 963 2019-01-04 10:26 stm8-project\Debug\Obj\delay.pbi
文件 11471 2019-01-04 10:26 stm8-project\Debug\Obj\delay.pbi.xcl
文件 4827 2019-01-04 10:36 stm8-project\Debug\Obj\main.o
文件 325545 2019-01-04 10:39 stm8-project\Debug\Obj\main.pbi
文件 11471 2019-01-04 10:39 stm8-project\Debug\Obj\main.pbi.xcl
文件 416714 2019-01-04 10:36 stm8-project\Debug\Obj\stm8.pbd
文件 468 2019-01-04 10:36 stm8-project\Debug\Obj\stm8.pbd.linf
文件 57283 2019-01-04 10:36 stm8-project\Debug\Obj\stm8s_clk.o
文件 345481 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_clk.pbi
文件 11498 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_clk.pbi.xcl
文件 24165 2019-01-04 10:36 stm8-project\Debug\Obj\stm8s_gpio.o
文件 328491 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_gpio.pbi
文件 11499 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_gpio.pbi.xcl
文件 33202 2019-01-04 10:36 stm8-project\Debug\Obj\stm8s_it.o
文件 326993 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_it.pbi
文件 11475 2019-01-04 10:26 stm8-project\Debug\Obj\stm8s_it.pbi.xcl
............此处省略92个文件信息
相关资源
- 意法半导体STM全系列微控制器STM32ST
- STM8S SX1278 项目和源代码
- STM8S003 红外遥控
- STM8S例程,基于IAR下的STM8S例程
- 基于STM8的HT1621B显示驱动程序
- STM8驱动HT1621B
- STM8L中文参考手册1-4全
- STM8L_MPU6500_DMP_震动唤醒
- arduino主机,stm8从机。I2C测试 。每次
- Lora通讯 stm8
- STM8+FM17750低成本刷卡方案资料硬件设
- STM8_无线315&433_脉宽自适应_通用解码
- STM8S103系列IO模拟串口通信实现真正串
- STM8S中文参考手册
- cosmic STM8破解
- STM8全系列封装
- STM8L051 低功耗运行模式 库函数例程
- STM8L051.串口接收IDLE中断.zip
- 移植在STM8上的实时操作系统uCOS
- 额温枪STM8L方案含原理图和代码.rar
- STM8L 硬件IIC主机
- (D)基于NTC热敏电阻的温度计.zip
- STM8s官方固件库
- STM8+NRF24l01+发送程序
- STM8+NRF24l01+接收程序
- stm8s006超声波硬件设计电路
- stm8的485串口收发程序
- STM8最强固件库
- STM8蜂鸣器音乐演奏
- IAR+for+STM8+ 破解
评论
共有 条评论