作者:wogoyixikexie@gliet 2008.12.02
一直想搞明白这个SMDK2440.cec文件是怎么回事,起了什么作用。貌似如果新开发一个驱动一定要用到它,以前收集了很多资料,也没有看见怎么讲到他与开发驱动相关,不过可以确定,开发BSP一定和他有关系的了。
下面看PB的帮助文档吧。慢慢看,慢慢解释。
Platform Builder User's Guide > Catalog Overview > Catalog Customization
After you create a project, you can use a Catalog item (.cec) file to associate it with a Catalog item that you can display in the Catalog. For more information about sample .cec files, see Sample .cec Files.
——很明显了,这个CEC文件的作用就是让他显示在右侧的Catalog 里面。为了更加形象,我就贴图出来。
————先去打篮球了,叮嘱广大研发同志们:身体是革命的本钱,晚上回家继续写,明天还有新任务。
After the Catalog item is displayed in the Catalog, you can add the associated project to other OS designs you create on the same development workstation. To do this, you must first create a .cec file and then import the file into the Catalog.
A .cec file consists of blocks and subblocks that describe metadata about Catalog items and their relationships. The following table shows the blocks in a .cec file and the order they appear in.
Block name | Content |
---|---|
CECInfo Block | Basic information about the .cec file, such as the name, description, vendor, and version of the .cec file. 名字,属性,版本 |
ComponentType Block | Catalog item groups or a generalized Catalog item that might have many different implementations. 栏目主题,生成栏目等 |
Implementation Block | Definition of an implementation for a component type. 定义运行一个组件的执行 |
BuildMethod Block | Information about which CPUs support your Catalog item and, if applicable, links to source files, Help documentation (.chm) files, and user-created projects. 栏目的CPU信息,连接sources 文件,帮助文档,用户创建工程等 Note Build-specific information in custom CEC files is not supported in Windows CE 5.0. Although this does not prevent CEC files from earlier versions of Platform Builder from being used, the information that is no longer supported, such as custom build steps, is ignored. |
When you create a .cec file and want to add an implementation or ComponentType defined in another .cec file, use the existing Globally unique identifier (GUID) rather than creating a new GUID.
当你创建一个组件,定义一个CEC文件,定义一个唯一的标识(GUID),而不是创建一个新的GUID——这点真是要特别注意。对这个我还真是不了解。
When modifying an existing component type, specify only the Name and GUID fields. 指定名称和GUID
The following code example shows the ComponentType block that specifies a new display driver (an implementation of the Display component type).
ComponentType ( Name ( "Display") .. .. Implementations .. )
When adding to an existing implementation, use the same Implementation version number as the one you want to extend.
When the data for a field contains a space, enclose the data in quotes. Tokens are separated by spaces and lines are ignored. If you enter a comment line, include a space after // to avoid a syntax error.
For examples of the grammar used in .cec files, examine the default .cec files that are installed with Platform Builder. These default .cec files are installed in the %_WINCEROOT%/Public/Common/Oak/Catalog/Cec directory.
The Platform Builder import parser adheres to the following rules when importing a .cec file:
- GUIDs are generated for any structure that does not supply one, including component types, implementations, and build methods.
Note To ensure consistency, supply your own GUIDs for your Catalog items. You can use the GUIDGEN tool to create a GUID. GUIDGEN.exe is in the %_WINCEROOT%/SDK/BIN/i386 directory. For more information, see Guidgen Tool.
-
——哦,使用这个GUID生成工具,哈哈,有空弄弄。
- GUIDs are specified in the following standard format:
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
- A .cec file can reference other structures by name instead of GUID only if the structures are defined in the same .cec file.
- If the information for a field requires more than one value, such as Children(), quotes are not needed. However, if your value has a space in the string, such as "My Catalog item," include double quotes around the string.
- Modifications to .cec files are not incorporated if another .cec file references the same Catalog item group. To incorporate the changes to a Catalog item, all .cec files containing references to the specified Catalog item group must be removed from the Catalog and imported again.
- ——修改CEC文件后,必须删除,再重新导入。
A utility is included with Platform Builder that you can use to create and modify .cec files. For more information, see CEC Editor.
BSP .cec files contain data describing your device drivers and your OEM adaptation layer (OAL).
The following code example shows a BSP .cec file that contains a GUID identifying the file as an OAL in the Catalog.
ComponentType (
Name( BSPs )
GUID( {3CABD6DA-B577-4a87-9490-9432E80DC2F1} )
Description( "Board Support Packages" )
Implementations(
Implementation(
See Also
Developing a Board Support Package | CECInfo Block | ComponentType Block | Implementation Block | BuildMethod Block
那么先看这个
Platform Builder User's Guide > Catalog Overview > Catalog Customization > Catalog Item Files
The CECInfo block contains basic information about the .cec file, such as the name, description, vendor and version of the .cec file.
Note The CECInfo block must be the first block in a .cec file, and there can only be one CECInfo block in a .cec file.
The following code example shows a CECInfo block.
CECInfo ( Name(Mycecfile.cec) CECVersion (3.00) // CEC file GUID( <GUID value> ) Vendor ("Calc U. Later") // quotes are needed because of space in the string Description ("My CEC File description") )
The following table shows the elements of the CECInfo sub-blocks.
Element | Description |
---|---|
Name | Optional element that identifies the name of the .cec file. |
GUID | Optional element that supplies the GUID of the .cec file. If a value is not present, it is created when the .cec file is imported into the Catalog. |
Description | Optional element that describes the .cec file. |
CECVersion | Element that identifies the version of the .cec file. The following versions are supported: 2.12, 3.0, 4.0, and 5.0. Use version 2.12 and 3.0 only to support backward compatibility. |
Vendor | Optional element that defines the vendor of the .cec file. |
哈哈,下面几个不一一列举了,在PB帮助文档讲的相当详细。
不过我觉得开发驱动并不需要修改CEC文件,改dirs,souces等即可