一个典型的F2837xD应用工程包含两个独立的CCS工程:一个用于CPU1,一个用于CPU2.折两个工程师完全独立的工程,没有真正的连接。
1、从CCS主界面窗口,选择 File -> New -> CCS Project.选择你的目标器件”Generic
C28xx Device”命名你的工程并且选择工程目录,点击完成,你的工程就创建好了
2、在你可以成功编译工程之前,你需要设置一些参数。点击你的project 选择properies。找到 Processor Options ,保证和下图一样
3、In the C2000 Compiler entry look for and select the Include Options. Click on the add directory icon to add a directory to the search path. Click the File System button to browse to the commonninclude folder of your C2000Ware installation (typically C:ntinc2000nC2000Ware_X_XX_XX_XXndevice_supportnf2837xdncommonninclude). Replace the ’X’s with your current C2000Ware version installation. Click ok to add this path, and repeat this same process to add the headersninclude directory.
4. Expand the Advanced Options and look for the Predefined Symbol entry. Add a Pre-define NAME called “CPU1”. This ensures that the header files build correct for this CPU. If using a Launchpad, also add a pre-define NAME called “_LAUNCHXL_F28379D”. This is required to setup the proper device clocking
7. In the project explorer, check that no linker command file got added during project setup. If so,remove the linker command file that got added.
#include "F28x_Project.h"
void main(void)
{
uint32_t delay;
InitSysCtrl();
// Set pin direction
EALLOW;
GpioCtrlRegs.GPADIR.bit.GPIO10 = 1;
EDIS;
GPIO_SetupPinOptions(14, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(14, GPIO_MUX_CPU2, 0);
// turn off LED
GpioDataRegs.GPADAT.bit.GPIO10 = 1;
while(1)
{
// Turn on LED
GpioDataRegs.GPADAT.bit.GPIO10 = 0;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
// Turn off LED
GpioDataRegs.GPADAT.bit.GPIO10 = 1;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
}
}
In the project explorer, check that no linker command file got added during project setup. If so,remove the linker command file that got added.
Next we need to link in a few files which are used by the header files. To do this right click on your project in the workspace and select Add Files… Navigate to the headersnsource directory, and select F2837xD_GlobalVariableDefs.c. After you select the file you’ll have the
option to copy the file into the project or link it. We recommend you link files like this to the project as you will probably not modify these files. Link in the following files as well:
commonnsourcenF2837xD_CodeStartBranch.asm
commonnsourcenF2837xD_usDelay.asm
commonnsourcenF2837xD_SysCtrl.c
commonnsourcenF2837xD_Gpio.c
commonnsourcenF2837xD_Ipc.c
At this point your project workspace should look like the following:
#include "F28x_Project.h"
void main(void)
{
uint32_t delay;
// turn off LED
GpioDataRegs.GPADAT.bit.GPIO14 = 1;
while(1)
{
// Turn on LED
GpioDataRegs.GPADAT.bit.GPIO14 = 0;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
// Turn off LED
GpioDataRegs.GPADAT.bit.GPIO14 = 1;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
}
}
Ctrl + B
Ctrl + I
Ctrl + Q
Ctrl + L
Ctrl + K
Ctrl + G
Ctrl + H
Ctrl + O
Ctrl + U
Ctrl + R
Ctrl + Z
Ctrl + Y
Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档,然后转换成格式丰富的HTML页面。 —— [ 维基百科 ]
使用简单的符号标识不同的标题,将某些文字标记为粗体或者斜体,创建一个链接等,详细语法参考帮助?。
本编辑器支持 Markdown Extra , 扩展了很多好用的功能。具体请参考Github.
Markdown Extra 表格语法:
项目 | 价格 |
---|---|
Computer | $1600 |
Phone | $12 |
Pipe | $1 |
可以使用冒号来定义对齐方式:
项目 | 价格 | 数量 |
---|---|---|
Computer | 1600 元 | 5 |
Phone | 12 元 | 12 |
Pipe | 1 元 | 234 |
定义 D
定义D内容
代码块语法遵循标准markdown代码,例如:
@requires_authorization
def somefunc(param1='', param2=0):
'''A docstring'''
if param1 > param2: # interesting
print 'Greater'
return (param2 - param1 + 1) or None
class SomeClass:
pass
>>> message = '''interpreter
... prompt'''
生成一个脚注1.
用 [TOC]
来生成目录:
使用MathJax渲染LaTex 数学公式,详见math.stackexchange.com.
更多LaTex语法请参考 这儿.
可以渲染序列图:
或者流程图:
即使用户在没有网络的情况下,也可以通过本编辑器离线写博客(直接在曾经使用过的浏览器中输入write.blog.csdn.net/mdeditor即可。Markdown编辑器使用浏览器离线存储将内容保存在本地。
用户写博客的过程中,内容实时保存在浏览器缓存中,在用户关闭浏览器或者其它异常情况下,内容不会丢失。用户再次打开浏览器时,会显示上次用户正在编辑的没有发表的内容。
博客发表后,本地缓存将被删除。
用户可以选择 把正在写的博客保存到服务器草稿箱,即使换浏览器或者清除缓存,内容也不会丢失。
注意:虽然浏览器存储大部分时候都比较可靠,但为了您的数据安全,在联网后,请务必及时发表或者保存到服务器草稿箱。