版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、_äìÉiÄ»d Line ToolsBlueLabUser GuideDecember 2006CSRCambridge Science ParkMilton Road CambridgeCB4 0WH United KingdomRegistered in England 4187346 Tel: +44 (0)1223 692000Fax: +44 (0)1223 692001© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.
2、CS-101506-UG4ContentsContents12Introduction3Overview of BlueLabd Line Applications42.12.22.32.42.5Tools that Generate Code4d Line Equivalents to Tools in BlueSuite4Tools to Orchestrate the Build Process5Tools to Package Code5Tools to Compile, Assemble and Link BlueLab Code634Build Process Overview7b
3、uttonparse84.14.24.3General8Description of .button Files8Additional functionality95ledparse105.15.25.3General10Description of .led Files10Using Autogenerated LED Patterns in the VM Application116genparse126.16.2General12Description of .parse Files126.2.1 Patterns136.2.2 Parameters136.2.3 Literals146
4、.2.4 Handlers14Description of Output Files14Packet Boundaries15Examples15User Defined Parameters176.6.1 Qualifiers176.36.46.56.6789BlueFlashCmd18pscli19make209.1 Introduction209.2 General20xap-local-xap-ar21xipbuild221011Document References23Terms and Definitions24Document History25Document Feedback
5、25© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 2 of 25_äìÉiÄÔ dBlLuienLeaTbools User GuideIntroduction1IntroductionThis document describes thed line applications that are shipped with the BlueLab v4.x SoftwareDevelopment
6、 Kit (SDK). It does not list all the individual options andds accepted by each application,where appropriate these are included within the application and are listed when the application is run.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 3 of 2
7、5_äìÉiÄÔ dBlLuienLeaTbools User GuideOverview of BlueLabd Line Applications2Overview of BlueLabd Line ApplicationsThe applications covered in this document can be divided into sub-groups based on their area of functionality:2.1Tools that Generate CodebuttonparseThe buttonpar
8、se application is used to bind button names to PIO pins and to define a message that will be sent when a button is pressed. It allows long, short, repeat and multiple button presses to be specified and assigned messages.From information input as a .button file, .buttonparse.exe generates the C files
9、 (.c) and header files (.h) required by the application to send the messages to a task, typically the AppTask, in response to a button event occurring.Note: It is the developers responsibility to write the necessary code to handle these messages when they are received by the task. Buttonparse just g
10、enerates the code to convert PIO transitions into messages.ledparseThe ledparse application is used to autogenerate C files (.c) and header files (.h) that bind LEDs to the PIO/LED pins they are connected to and define LED patterns that can then be used in the VM application.genparseThis utility gen
11、erates the code required to parsed strings (e.g. ATds) received by anapplication in order to identify thed.This application generates the necessary C files (.c) and header files (.h) from text string statements in a .parse file.The files are generated in the same location as the .parse file and can
12、be in either a library, as in the stereo headset reference application code which generates the files in the hfp library, or in the BlueLab Project files.Note: The best location for the files largely depends on the application and is at the discretion of the developer.2.2d Line Equivalents to Tools
13、in BlueSuiteThese applications ared line equivalents to the BlueFlash and PSTool applications that are shipped withBlueLab and are part of BlueSuite.BlueFlashCmdThe BlueFlashCmd application can be used to download and upload code to and from the flash memory on _äìÉçêÉ&
14、#187; chips.psclipscli is ad line interface to the BlueCore Persistent Store. It can be used to, modify andwrite the PS Keys that configure the BlueCore device.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 4 of 25_äìÉiÄÔ
15、dBlLuienLeaTbools User GuideOverview of BlueLabd Line Applications2.3Tools to Orchestrate the Build ProcessappqueryWhen invoked, this utility application generates a list of the API dependencies for the code passed to it.During the Build process in BlueLab make invokes appquery and passes it the fir
16、mware selected bymake as a result of a query of the BlueCore device performed using BlueFlashCmd.The output is then used to determine whether the firmware supports themake will evoke packfile to produce a .fs file to pass to vmbuilder.-only file system. If it doesAlternatively, if the firmware does
17、not support the-only file system the code will be passed tovmbuilder as an .app file, rather than as a.fs file.makeThis is the standard GNU make utility. The application executes a list of shellds associatedwith each target to create or update a file of the same name. It uses the makefiles (shipped
18、withBlueLab) to determine how the target is updated with regard to its dependencies.Seefors concerning make.recordflagsThis application records options passed to other tools so that when the options are changed the record can be used to force code to be recompiled.xipbuildThis application can be use
19、d to build xIDE projects from thed line rather than through the xIDEGUI. (xipbuild is not used by makefilesd with BlueLab).The following are small helper applications that are called, as required, by make during the build process and whose purpose is largely self-evident.copyfile createpath removewo
20、rkingdirectory2.4Tools to Package CodeThese utilities are automatically invoked, as required, by make during the build process:kalpac2This application generates the .kap files from output generated by kalasm2.packfileThis application generates a .fs file from a directory tree.unpackfileThis applicat
21、ion generates a directory tree from a .fs file, (unpackfile is not used by makefiles d with BlueLab).vmBuilderThis application combines the .fs or .app file with the BlueCore firmware. The output is passed toBlueFlashCmd to download the final code to a BlueCore device.© CSR plc 2006-2007This ma
22、terial is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 5 of 25_äìÉiÄÔ dBlLuienLeaTbools User GuideOverview of BlueLabd Line Applications2.5Tools to Compile, Assemble and Link BlueLab CodeThese utilities are automatically invoked,as required, by make during the
23、build process.xap-local-xap-arThis is a cut-down version of the standard ar utility that is used to build Library files. Seefor a description of the standard ar utility.The limited number of Chapter 10.d line options supported in BlueLabs implementation of ar are listed inxap-local-xap-gcc-3.3.3This
24、 is a slightly modified version of the standard GNU compiler, although some minor adaptations havebeento optimise the performance for use with BlueLab applications. The standard implementationis described atkalasm2kalasm2 is the Kalimba compiler. It accepts .asm, .kobj and .klib input files and prod
25、uces .klooutput files for the DSP on BlueCore Multimedia chips.Running kalasm2.exe in a application options, andd window will display the application help, which d availability.s theKalasm2 is described in more 101500-UG).in the Kalimba DSP Assembler User Guide (CSR reference: CS-© CSR plc 2006
26、-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 6 of 25_äìÉiÄÔ dBlLuienLeaTbools User GuideBuild Process Overview3Build Process OverviewThe following figure gives an overview of the utility applications and their use during the build and down
27、load processes as implemented by BlueLab.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 7 of 25_äìÉiÄÔ Bd lLuienLeaTbools User Guidebuttonparse4buttonparseThe buttonparse utility provides a quick and easy method of generat
28、ing the code to bind button names to PIO events and to define the message sent to the application task when the button event occurs.4.1GeneralButtonparse takes a .button file containing a description of the required buttons and outputs the .c and.h files required to implement them i.e:buttonparse.ex
29、e <input file.button> <output file name>4.2Description of .button Files.button files initially define button names for the PIO pins the engineer is interested in e.g:pio pio pio765UP DOWN OFFIt is also possible to specify debounce whening these PIOs by adding a statement in the form:debo
30、unce n mWhere n is the number of times tothe PIO before deciding the value is correct and m is the period inmilliseconds to wait betweens.Note: If no debounce is specified, the default values n = 1 and m = 0 are used.Next, the messages for the buttons and when they will be sent can be defined. The f
31、ollowing code extracts describe the options available, with a brief description of the resulting functionality:1.To send a message (VOLUME_UP) when a PIO (7) is pressed and a repeat message every 500ms if it is held down:message VOLUME_UP UP enterUP repeat 5002.To send a message (VOLUME_DOWN) when a
32、 PIO (6) is pressed but no repeat message if it is held down:message VOLUME_DOWN DOWN enter3.To send a message (RESET) when two PIOs (6 and 7) are pressed simultaneously for a given period (1 second), with no repeat message being sent:message RESETUP DOWN held 10004.To send a message (OFF) when a PI
33、O (5) is held down for a specified period (2 seconds) i.e. a long press, with a repeat message sent at a different repeat period (every 1 second) after the initial message:message POWER_OFF OFF held 2000OFF repeat 10005.To send a message (SHORT_PRESS) when a PIO (5) is released:message SHORT_PRESS O
34、FF release© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 8 of 25_äìÉiÄÔ dBlLuienLeaTbools User GuidebuttonparseNote: If a HELD event (i.e. a long press, if defined) is detected and a message is sent as a result, it will ca
35、ncel any release messages. This allows short and long press messages to be specified.6.To send a message (DOUBLE_PRESS) when a PIO (7) is pressed twice within a specified period (within a second):message DOUBLE_PRESS UP double 10007.An additional label held_release enables short, long and very long
36、press to be defined.For example, to send a message (LONG_RELEASE) when a button is released after being pressed for a specified period (2 seconds):message LONG_RELEASE OFF held_release 2000Note: If a held event is defined and a message has been sent the held_release message is suppressed (if a relea
37、se event is defined the SHORT_PRESS message will be suppressed if either a held_release or held message has been sent).8.Changes in the PIO state can be sent to the application task in the form of a PIO_RAW message.Note: This is generally used when monitoring the state of PIOs not used to monitor bu
38、tton events.To receive the PIO message in this form statements aded to the top of the .button file e.g:pio_raw 13pio_raw 15The PIO_RAW message received by the task will contain the state of both PIOs and can be each by looking at the relevant bit position for the required PIO e.g:for(PIO_RAW_T*)mess
39、age)->pio & (1<<13) to(PIO_RAW_T*)message)->pio & (1<<15) toPIO 13PIO 15Note: A case statement to handle PIO_RAW messages needs to be added to the handler code for the AppTask.Developers should not attempt to specify a given PIO as both a button and non-button event. If thi
40、s is done the code will not implement the button instance.4.3Additional functionalityThe buttonparse utility:1. Supports up to 32 PIO lines.2. Can interpret VREG_EN and CHG_EN in the same way as PIO lines.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4
41、Page 9 of 25_äìÉiÄÔ dBlLuienLeaTbools User Guideledparse5ledparseThe ledparse utility provides a quick and easy method of generating the code to define LED patterns.ledparse includes support for:Multiple LEDs (including tri-colour) Start/stop LED patternsPattern configuratio
42、n Single play patterns Repeated patternsRestarting a repeated pattern interrupted by a single play patternledparse is compatible with all BlueCore variants with or without special LED drive pins.5.1Generalledparse takes a .led file containing a description of the required LED patterns and outputs th
43、e .c and .hfiles required to implement them i.e:ledparse.exe <input file.led> <output file name>5.2Description of .led Files.led files initially define the PIO/LED pins to be used in the patterns e.g:pio led led801GREEN RED BLUEThen go on to define the required patterns. Each pattern is
44、defined using the following syntax:pattern NAME_OF_PATTERN REPEAT LED LED2 LED3 ACTION DURATIONExamples1.To define a pattern where both the red and blue LEDs are on for 1second:pattern RED_BLUE_ONE_SEC RED BLUE ON 1000RED BLUE OFF 02.To define a repeating pattern where the red and blue LEDs alternat
45、e with a 200ms duration.pattern RED_BLUE_ALT RPT RED ON 200RED OFF 0 BLUE ON200 BLUE OFF 03.Green permanently on:pattern GREEN_ON RPT GREEN ON 0© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 10 of 25_äìÉiÄÔ Bd lLuienLeaTbo
46、ols User Guideledparse5.3Using Autogenerated LED Patterns in the VM ApplicationWhen ledparse has been used to generate the LED patterns they can be implemented in the VM application code by including the <output file name>.h and calling ledsPlay() when the pattern is to be played:#include <
47、ledpatterns.h>Bool ledsPlay (LedPattern_t pNewPattern)i.e. to play the repeating pattern RED_BLUE_ALT pattern defined in section 5.2 example 2:bool ledsPlay (RED_BLUE_ALT)ledsPlay FunctionalityThe effect of calling ledsPlay depends on the whether an LED pattern is al playing and the type of the n
48、ew pattern called:y playing, the type of pattern1.When a repeating pattern aly playing:If the new pattern is a repeating pattern, the new pattern will replace the original pattern.If the new pattern is a non-repeating the original pattern is interrupted, the new pattern is played then the original p
49、attern is resumed.2.When a non-repeating pattern is playing:If the new pattern is a repeating pattern, the new pattern will play when the original pattern completes.If the new pattern is a non-repeating pattern, the new pattern is not played and ledsPlay returnsfalse.Note: It is up to the caller to
50、queue non-repeating patterns if required.Further insight into use of ledparse in VM applications can be gained by examining the example application in BlueLab.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 11 of 25_äìÉiÄÔ
51、dBlLuienLeaTbools User Guidegenparse6genparseparse utility provides a quick and easy method of generating the code required by an application toTidentify incod strings. e.g. to parse and identify ATds in applications implementing audiogateway, headset or hands-applications.6.1Generalgenparse takes o
52、ne or more .parse file(s) containing a description ofd strings as input and outputsterated code as a .c and an .h file.The output files can then be compiled and linked into the application. In BlueLab make will identify a .parse file when included in a BlueLab Project and call genparse.exe before co
53、mpiling and linking the application code.6.2Description of .parse Files.parse files use the syntax:pattern : handleror<literal> : handlerThe following code extract shows examples taken from the .parse file included in the hfp library (which can be found in C:/BlueLab_3.x/src/lib/hfp/hfp_parse.
54、parse):#Set speaker gain indication (allowed values: 0-15)r n + VGS = %d:gain r n : hfpHandleSpeakerGain#Incocall indication (literal)<rnRINGrn> : hfpHandleRingThe hfp_parse.parse file contains all the ATds that are mandatory to the headset and hands-specification. However, if a developer wish
55、es to support additionalds these can be added as required.© CSR plc 2006-2007This material is subject to CSRs non-disclosure agreement.CS-101506-UG4Page 12 of 25_äìÉiÄÔ dBlLuienLeaTbools User Guidegenparse6.2.1PatternsEach pattern is processed by terated code from left
56、to right. Fields in the pattern aandled as follows:6.2.2ParametersA % in a pattern should be followed by either s:name, or d:name indicating a string or numeric parameter respectively. name is a non-empty sequence of alphanumeric characters, which the handler can use to refer to that parameter.A str
57、ing parameter matches an (optionally) quoted, non-empty sequence of alphanumeric characters or spaces in the input. If it succeeds, the contents of the string (without enclosing quote marks) will be passed to the handler, otherwise the pattern will fail and the next one is considered.A numeric parameter matches a non-empty sequence of decimal digits in the input. If it succeeds, the decimal value of the sequence will be passed to the handler, otherwise the pattern will fail and the next one is considered.Any parameters passed to the handler are assembled in a structure whose name
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二零二五年教育辅助机构劳动合同及教学质量协议3篇
- 二零二五年环保产品生产加工合作合同范本2篇
- 二零二五年度塑料加工工厂承包生产与环保责任合同3篇
- 潍坊护理职业学院《学习科学与技术》2023-2024学年第一学期期末试卷
- 天津艺术职业学院《灯光照明基础》2023-2024学年第一学期期末试卷
- 二零二五年度高科技设备租赁担保服务合同3篇
- 2024民间借贷合同(自动放弃利息)
- 二零二五年影视制作项目投资合同正本3篇
- 二零二五版影视制作借款合同示范文本2篇
- 2025年度餐饮股份合作开发项目合同3篇
- 骨科临床路径全集(范本模板)
- 破产申请异议书
- 金蝶云星辰初级考试题库
- 常见老年慢性病防治与护理课件整理
- 履约情况证明(共6篇)
- 云南省迪庆藏族自治州各县区乡镇行政村村庄村名居民村民委员会明细
- 设备机房出入登记表
- 六年级语文-文言文阅读训练题50篇-含答案
- 医用冰箱温度登记表
- 口袋妖怪白金光图文攻略2周目
- 三年级下册生字组词(带拼音)
评论
0/150
提交评论