久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1178|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

STM32f103控制系統(tǒng)板燈的呼吸亮滅源程序

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:361500 發(fā)表于 2018-12-26 15:13 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
#include "stm32f10x.h"q
#include "stm32_eval.h"
#include <stdio.h>

#ifdef USE_STM32100B_EVAL
#include "stm32100b_eval_lcd.h"
#elif defined USE_STM3210B_EVAL
#include "stm3210b_eval_lcd.h"
#elif defined USE_STM3210E_EVAL
#include "stm3210e_eval_lcd.h"
#elif defined USE_STM3210C_EVAL
#include "stm3210c_eval_lcd.h"
#elif defined USE_STM32100E_EVAL
#include "stm32100e_eval_lcd.h"
#endif

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#ifdef USE_STM32100B_EVAL
  #define MESSAGE1   "STM32 MD Value Line "
  #define MESSAGE2   " Device running on  "
  #define MESSAGE3   "  STM32100B-EVAL    "
#elif defined (USE_STM3210B_EVAL)
  #define MESSAGE1   "STM32 Medium Density"
  #define MESSAGE2   " Device running on  "
  #define MESSAGE3   "   STM3210B-EVAL    "
#elif defined (STM32F10X_XL) && defined (USE_STM3210E_EVAL)
  #define MESSAGE1   "  STM32 XL Density  "
  #define MESSAGE2   " Device running on  "
  #define MESSAGE3   "   STM3210E-EVAL    "
#elif defined (USE_STM3210E_EVAL)
  #define MESSAGE1   " STM32 High Density "
  #define MESSAGE2   " Device running on  "
  #define MESSAGE3   "   STM3210E-EVAL    "
#elif defined (USE_STM3210C_EVAL)
  #define MESSAGE1   " STM32 Connectivity "
  #define MESSAGE2   " Line Device running"
  #define MESSAGE3   " on STM3210C-EVAL   "
#elif defined (USE_STM32100E_EVAL)
  #define MESSAGE1   "STM32 HD Value Line "
  #define MESSAGE2   " Device running on  "
  #define MESSAGE3   "  STM32100E-EVAL    "   
#endif

USART_InitTypeDef USART_InitStructure;
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
   set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */


int main(void)
{

  STM_EVAL_LEDInit(LED1);
  STM_EVAL_LEDInit(LED2);
  STM_EVAL_LEDInit(LED3);
  STM_EVAL_LEDInit(LED4);

  /* USARTx configured as follow:
        - BaudRate = 115200 baud  
        - Word Length = 8 Bits
        - One Stop Bit
        - No parity
        - Hardware flow control disabled (RTS and CTS signals)
        - Receive and transmit enabled
  */
  USART_InitStructure.USART_BaudRate = 115200;
  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_Rx | USART_Mode_Tx;

  STM_EVAL_COMInit(COM1, &USART_InitStructure);

  /* Initialize the LCD */
#ifdef USE_STM32100B_EVAL
  STM32100B_LCD_Init();
#elif defined (USE_STM3210B_EVAL)
  STM3210B_LCD_Init();
#elif defined (USE_STM3210E_EVAL)
  STM3210E_LCD_Init();
#elif defined (USE_STM3210C_EVAL)
  STM3210C_LCD_Init();
#elif defined (USE_STM32100E_EVAL)
  STM32100E_LCD_Init();  
#endif

  /* Display message on STM3210X-EVAL LCD *************************************/
  /* Clear the LCD */
  LCD_Clear(LCD_COLOR_WHITE);

  /* Set the LCD Back Color */
  LCD_SetBackColor(LCD_COLOR_BLUE);
  /* Set the LCD Text Color */
  LCD_SetTextColor(LCD_COLOR_WHITE);
  LCD_DisplayStringLine(LCD_LINE_0, (uint8_t *)MESSAGE1);
  LCD_DisplayStringLine(LCD_LINE_1, (uint8_t *)MESSAGE2);
  LCD_DisplayStringLine(LCD_LINE_2, (uint8_t *)MESSAGE3);

  /* Retarget the C library printf function to the USARTx, can be USART1 or USART2
     depending on the EVAL board you are using ********************************/
  printf("\n\r %s", MESSAGE1);
  printf(" %s", MESSAGE2);
  printf(" %s\n\r", MESSAGE3);

  /* Turn on leds available on STM3210X-EVAL **********************************/
  STM_EVAL_LEDOn(LED1);
  STM_EVAL_LEDOn(LED2);
  STM_EVAL_LEDOn(LED3);
  STM_EVAL_LEDOn(LED4);

  /* Add your application code here
     */

  /* Infinite loop */
  while (1)
  {
  }
}


PUTCHAR_PROTOTYPE
{
  USART_SendData(EVAL_COM1, (uint8_t) ch);

  while (USART_GetFlagStatus(EVAL_COM1, USART_FLAG_TC) == RESET)
  {}

  return ch;
}

#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


test.zip

305.54 KB, 下載次數(shù): 3, 下載積分: 黑幣 -5

相應(yīng)工程包

評分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: av中文在线观看 | a在线免费观看视频 | 特级黄一级播放 | 成人免费观看视频 | 青青草在线播放 | 亚洲精品福利在线 | 国产96色在线 | av网站观看 | 国产精品2 | 韩国欧洲一级毛片 | 亚洲成人久久久 | 涩涩视频网站在线观看 | 欧美日韩三级 | 日韩精品一区二区三区中文在线 | 麻豆av一区二区三区久久 | 在线视频中文字幕 | 欧美日韩高清免费 | 亚洲高清av | 欧洲一级毛片 | 欧美一级毛片免费观看 | 国产精品网址 | 亚洲国产精品人人爽夜夜爽 | 国产高清视频一区 | 免费看片国产 | 亚洲精品一区中文字幕乱码 | 秋霞电影院午夜伦 | 日韩欧美一区二区在线播放 | 亚洲精品久久久一区二区三区 | 99re6在线视频精品免费 | 黄色av观看| 日本成年免费网站 | 欧美一区日韩一区 | 日本理论片好看理论片 | 精品乱人伦一区二区三区 | 欧美久久久久久 | 精品欧美一区二区三区久久久小说 | 狼色网 | 亚洲欧美精 | 日韩视频在线一区二区 | 祝你幸福电影在线观看 | 久久综合一区 |