<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 使用IAR如何修改STM8S庫(一)

          使用IAR如何修改STM8S庫(一)

          作者: 時間:2016-11-24 來源:網(wǎng)絡(luò) 收藏
          注意:以下修改在IAR for STM8 1.10 SP3下驗證,庫文件為IAR自帶的1.1.1

          1、選擇CPU類型(支持STM8S系列設(shè)備)

          本文引用地址:http://www.ex-cimer.com/article/201611/320848.htm

          stm8s.h

          ...

          /* Uncomment the line below according to the target STM8S device used in your

          application.

          Tip: To avoid modifying this file each time you need to switch between these

          devices, you can define the device in your toolchain compiler preprocessor. */

          #if !defined (STM8S208) && !defined (STM8S207) && !defined (STM8S105) && !defined (STM8S103) && !defined (STM8S903)

          #define STM8S208

          /* #define STM8S207 */

          /* #define STM8S105 */

          /* #define STM8S103 */

          /* #define STM8S903 */

          #endif

          根據(jù)你的CPU類型選擇宏定義,比如我這里用的是105系列,則修改為:

          /* #define STM8S208 */

          /* #define STM8S207 */

          #define STM8S105

          /* #define STM8S103 */

          /* #define STM8S903 */

          選擇好CPU類型后,還需查看選擇的類型中哪些外設(shè)是包含的哪些外設(shè)沒有包含,將沒有包含的外設(shè)驅(qū)動c文件在工程中去掉

          如105系列沒有adc2、can、uart1、uart3

          2、修改stm8s_conf.h文件

          選擇好CPU類型后,接下來就是選擇要使用的外設(shè)了,stm8s_conf.h就是外設(shè)驅(qū)動選擇開關(guān),在用戶函數(shù)中,只需包含此頭文件即可。

          比如程序中需要使用到SPI外設(shè),則將此文件的

          /************************************* SPI ************************************/
          /* #define _SPI (1) */

          修改為:

          /************************************* SPI ************************************/
          #define _SPI (1)



          關(guān)鍵詞: IARSTM8S

          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();