没有合适的资源?快使用搜索试试~ 我知道了~
Embedded SDK(Software Development Kit)Programmer’s Guide.pdf
需积分: 10 15 下载量 72 浏览量
2013-06-05
17:50:30
上传
评论
收藏 1.95MB PDF 举报
温馨提示
试读
278页
Embedded SDK(Software Development Kit)Programmer’s Guide.pdf
资源推荐
资源详情
资源评论
© Motorola, Inc., 2001. All rights reserved.
Semiconductor Products Sector
Embedded SDK
(Software Development Kit)
Programmer’s Guide
SDK122/D
Rev. 1.6, 08/16/2001
OnCE™ is a trademarks of Motorola, Inc.
This document contains information on a new product. Specifications and information herein are subject to change without notice.
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and
specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may be provided in Motorola
data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including
“Typicals” must be validated for each customer application by customer’s technical experts. Motorola does not convey any license under its patent rights nor the
rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other
applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury
or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola
and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees
arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that
Motorola was negligent regarding the design or manufacture of the part. Motorola and
are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal
Opportunity/Affirmative Action Employer.
How to reach us:
USA/EUROPE/Locations Not Listed: Motorola Literature Distribution: P.O. Box 5405, Denver, Colorado 80217.
1-303-675-2140 or 1-800-441-2447
JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1 Minami-Azabu. Minato-ku, Tokyo 106-8573 Japan.
81-3-3440-3569
ASIA/PACIFIC:
Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tao Po, N.T.,
Hong Kong. 852-26668334
Technical Information Center: 1-800-521-6274
HOME PAGE:
http://motorola.com/semiconductors/dsp MOTOROLA HOME PAGE: http://motorola.com/semiconductors/
Table of Contents i
About This Document
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Suggested Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Definitions, Acronymns and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Chapter 1
Introduction
1.1 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1
1.2 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
1.2.1 SDK APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
1.2.2 SDK Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
1.2.3 SDK Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.2.3.1 Board Support Package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.2.3.2 Interrupt Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.2.3.3 Memory Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
1.2.3.4 Input/Output (I/O). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-4
1.2.3.5 Timers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-4
1.2.4 SDK Rules and Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
1.3 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
Chapter 2
CodeWarrior Tour
2.1 Basics of CodeWarrior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.2 SDK Additions to CodeWarrior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.2.1 Compiler and Linker Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.2.2 Entry Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
2.2.3 New Directory Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
2.2.4 Default Target Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
2.3 Creating a New SDK Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
2.3.1 Embedded SDK Stationery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-6
2.3.2 SDK Configuration files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-7
2.3.3 SDK Project Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-8
2.3.4 Steps to Create a New Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-8
Contents
ii Programmer’s Guide
Chapter 3
Rules and Guidelines
3.1 Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
3.1.1 Use of C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
3.1.2 Use of Peripherals by Algorithms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2
3.1.3 Use of Peripherals by Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
3.2 Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
3.2.1 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
3.2.1.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3
3.2.1.2 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
3.2.1.3 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
3.2.2 Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.3 Entry/Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.4 Conditional Compilation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.5 Self Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.6 Source Statements per Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.7 Fractional Arithmetic Calculations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.8 Reserve Word Redefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6
3.2.9 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.10 Data Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.11 Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.12 Repetitive Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.13 Use of Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.14 GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.15 Switch Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.16 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
3.2.16.1 File Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
3.2.16.2 Function Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
3.2.17 Data Typing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.2.18 Portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.2.19 Macro Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.2.20 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.2.21 Reentrancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
3.2.22 Interrupt Handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
3.2.23 Code Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
Chapter 4
Directory Structure
4.1 Required Core Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2
4.2 Optional (Domain-Specific) Directories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2
4.3 Application Directories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-4
Chapter 5
Core Libraries
5.1 System Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1
5.1.1 Basic Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Table of Contents iii
5.1.2 Architecture Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
5.1.2.1 Architecture Services Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
5.1.2.2 Architecture Services Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12
5.1.2.3 ArchIO - Architecture I/O Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-13
5.1.2.4 pArchInterrupts - Architecture Interrupts. . . . . . . . . . . . . . . . . . . . . . . . .5-14
5.1.2.5 archDelay - Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
5.1.2.6 archDisableInt - Disable Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
5.1.2.7 archEnableInt - Enable Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-17
5.1.2.8 archGetLimitBit - Get Limit Bit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
5.1.2.9 archGetSetSaturationMode - Get and Set Saturation Mode . . . . . . . . . . .5-19
5.1.2.10 archInstallISR - Install Normal ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
5.1.2.11 archInstallFastISR - Install Fast ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-21
5.1.2.12 archInstallSFastISR - Install Super Fast ISR . . . . . . . . . . . . . . . . . . . . . .5-22
5.1.2.13 archRemoveISR - Uninstall Normal ISR . . . . . . . . . . . . . . . . . . . . . . . . .5-23
5.1.2.14 archRemoveFastISR - Uninstall Fast ISR . . . . . . . . . . . . . . . . . . . . . . . .5-24
5.1.2.15 archRemoveSFastISR - Uninstall Super Fast ISR . . . . . . . . . . . . . . . . . .5-25
5.1.2.16 archResetLimitBit - Reset Limit Bit. . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
5.1.2.17 archSet2CompRound - Set Two’s-Complement Rounding Mode . . . . . .5-27
5.1.2.18 archSetConvRound - Set Convergent Rounding Mode . . . . . . . . . . . . . .5-28
5.1.2.19 archSetNoSat - Set No Saturation Mode . . . . . . . . . . . . . . . . . . . . . . . . .5-29
5.1.2.20 archSetSat32 - Set Saturation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
5.1.2.21 archStart - Entry Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-31
5.1.2.22 archStop - Stop Processing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
5.1.2.23 archTrap - Software Trap State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
5.1.2.24 archWait - Wait Processing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
5.1.3 Bit Manipulation Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35
5.1.3.1 Bit Manipulation Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35
5.1.3.2 Bit Manipulation Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-36
5.1.3.3 bitChange - Flip Selected Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-37
5.1.3.4 bitClear - Clear Selected Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38
5.1.3.5 bitSet - Set Selected Bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
5.1.3.6 bitTestHigh - Test Bit-field High . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-40
5.1.3.7 bitTestLow - Test Bit-field Low. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-41
5.1.3.8 bitWordClear - Clear Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-42
5.1.3.9 bitWordSet - Set Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43
5.1.4 I/O Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44
5.1.4.1 I/O Services Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44
5.1.4.2 I/O Services Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-47
5.1.4.3 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48
5.1.4.4 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-49
5.1.4.5 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
5.1.4.6 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-51
5.1.4.7 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
5.1.5 Timer Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
5.1.5.1 Realtime System Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
5.1.5.2 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
5.1.5.3 Timer Services Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-60
剩余277页未读,继续阅读
资源评论
磁场OS
- 粉丝: 35
- 资源: 636
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功