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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 7620|回復: 0
打印 上一主題 下一主題
收起左側

利用Eclipse IDE for C/C++ Developers和GNU Tools ARM Embedded編譯器,建立的一...

[復制鏈接]
跳轉到指定樓層
樓主
工作環境說明:

1. 硬件平臺: DX開發板主板 + DX103核心板

2. 軟件平臺: Eclipse IDE for C/C++ Developers + GNU Tools ARM Embedded
  (1) IDE:    Eclipse IDE for C/C++ Developers
  (2) 編譯器: GNU Tools ARM Embedded編譯器,支持STM32F103的標準外設驅動庫3.5版本

//
// This file is part of the GNU ARM Eclipse distribution.
// Copyright (c) 2014 Liviu Ionescu.
//

// ----------------------------------------------------------------------------

#include <stdio.h>
#include "diag/Trace.h"
#include "stm32f10x_conf.h"
// ----------------------------------------------------------------------------
//
// STM32F1 empty sample (trace via ITM).
//
// Trace support is enabled by adding the TRACE macro definition.
// By default the trace messages are forwarded to the ITM output,
// but can be rerouted to any device o.r completely suppressed, by
// changing the definitions required in system/src/diag/trace_impl.c
// (currently OS_USE_TRACE_ITM, OS_USE_TRACE_SEMIHOSTING_DEBUG/_STDOUT).
//

// ----- main() ---------------------------------------------------------------

// Sample pragmas to cope with warnings. Please note the related line at
// the end of this function, used to pop the compiler diagnostics status.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#pragma GCC diagnostic ignored "-Wreturn-type"

int main(int argc, char* argv[])
{
  // At this stage the system clock should have already been configured
  // at high speed.

  // Enable GPIO Peripheral clock
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  GPIO_InitTypeDef GPIO_InitStructure;
  // Configure pin in output push/pull mode
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
  // Configure pin in output push/pull mode
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_14;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_Init(GPIOB, &GPIO_InitStructure);

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);
  // Configure pin in output push/pull mode
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_12;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_Init(GPIOD, &GPIO_InitStructure);

  // Infinite loop
  while (1)
    {
      // Add your code here.
       GPIO_Write(GPIOA, GPIOA->ODR^(0x00001 << 0)); // 單步運行,點亮或關閉LED1
       GPIO_Write(GPIOB, GPIOB->ODR^(0x00001 << 0));
       GPIO_Write(GPIOB, GPIOB->ODR^(0x00001 << 14));
       GPIO_Write(GPIOD, GPIOD->ODR^(0x00001 << 13));
       GPIO_Write(GPIOD, GPIOD->ODR^(0x00001 << 12));
    }
}

#pragma GCC diagnostic pop

// ----------------------------------------------------------------------------



【圖片】默認閃爍一個LED.jpg




【圖片】修改為空項目.jpg

增加的代碼,默認使用3.5的固件庫和相應的CMIS層,如果需要使用HAL的固件庫,CMIS層需要改動,會比較麻煩。
暫時用3.5的固件庫了,注意新建一個空項目,然后添加代碼。
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

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

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 一级做a爰片性色毛片16美国 | 91国内外精品自在线播放 | av黄色在线 | 久久久999免费视频 999久久久久久久久6666 | 国产精品久久久久久久久动漫 | 午夜精品91| 亚洲国产一区二区三区 | 婷婷激情综合 | 日韩av手机在线观看 | 看a级黄色毛片 | 日韩亚洲欧美一区 | 国产成人99久久亚洲综合精品 | 免费久久精品视频 | 在线播放第一页 | 天天色综| 女人夜夜春 | 中文字幕在线网 | 亚洲国产精品久久久 | julia中文字幕久久一区二区 | 午夜无码国产理论在线 | 狠狠伊人| 中文字幕国产一区 | 日本中文在线视频 | 国产精品成人在线播放 | 免费h在线 | 日韩一区二区免费视频 | 久久精品综合网 | av三级| 国内精品久久久久久久 | 婷婷五月色综合香五月 | 日韩精品亚洲专区在线观看 | 99精品国自产在线 | 精久久久 | 国产精品伦理一区二区三区 | 人人性人人性碰国产 | 精品欧美一区二区在线观看欧美熟 | xx性欧美肥妇精品久久久久久 | 亚洲第一天堂无码专区 | 国产精品免费观看 | 久久亚洲国产 | 四虎影视|