Sunteți pe pagina 1din 132

CoIDE

Manual V2.0

Table of Contents
1. Introduction
2. How to Contribute to this Manual
3. Getting-Started
i. Download and Install CoIDE
ii. Getting Start
iii. Support Device & Debugger
4. Project-Management
i. Project Configuration
5. Component-Workflow
i. Component Definition
ii. Component Coding Conventions
iii. CoIDE Component Workflow
iv. Component-Development-Thought
6. Create-a-Component
i. Create Component Example
ii. Detailed Introduction
7. Maintain-a-Component
8. Document-for-Code
i. CoIDE Markdown Formatting Syntax
ii. Use Markdown in Doxygen
9. Compiler
i. Select GCC path
ii. Compile Output

2
CoIDE Manual V2.0

CoIDE User Manual

Introduction of this document


This File is an introduction of the CoIDE Dev 2.0 and the higher version.

CoIDE is a free integrated development environment focusing on ARM Cortex-M0/M0+/M3/M4 based microcontrollers. It
uses GCC (GCC-ARM-Embedded) tool chain, and is based on Eclipse, but has been customized and simplified to give
users a minimalism experience. With a powerful code component sharing and collaborative cloud platform Git integrated,
over 800 code components are within easy reach, allowing users to implement programs simply by stacking up building
blocks.

To learn more about CooCox, you can visit http://www.coocox.org.

You can also view the online version of this document on http://www.coocox.org/book/coocox/coide-dev-manual.en

Contact us:

Techical support: Master@coocox.com


Market: Market@coocox.com
Forum: http://www.coocox.org/forum/

Introduction 3
CoIDE Manual V2.0

How to Contribute this manual


We will appreciate if you can help us to make this manual better. Any affect translate it to other language is welcomed, too.

If anyone want to contribute to this manual, you can download the whole document through Git. The repository url is:
http://www.coocox.org/git/coocox/coide-dev-manual.en.git. The account and password is your CooCox account and
password.

This manual is written in markdown. If you don't know how to write markdown language, read chapter: 07-Document-for-
Code

Currently, you cannot modify the pages on web or upload to coocox server directly, you can send your modification to
master@coocox.com. We will check the modification and add them to the manual.

Thanks for your support!

How to Contribute to this Manual 4


CoIDE Manual V2.0

Download and Install CoIDE

Where to download CoIDE download CoIDE


CoIDE 2.0 can be downloaded from the http://www.coocox.org/software/coide.php, and the old version of the CoIDE can be
downloaded from the http://www1.coocox.org/CooCox_CoIDE.htm.

Before downloading, users need to register for a CooCox account then log in the web site of CooCox, downloading and
using the CoIDE do not charge any fees.

How to install CoIDE install CoIDE


1. Double click on the CoIDE installation files, such as: CoIDE-V2Beta-20141205.exe

2. Allow the program to run

Download and Install CoIDE 5


CoIDE Manual V2.0

3. Enter the installation interface

4. You can click on the "Terms of Use" to check the terms of use

Download and Install CoIDE 6


CoIDE Manual V2.0

5. Click on "Next" to continue

6. Elect the installation path, Start Menu and desktop icons

Download and Install CoIDE 7


CoIDE Manual V2.0

7. Click on "Install" to start to install

8. Erection sequence shows the progress of the installation and product's introduction

Download and Install CoIDE 8


CoIDE Manual V2.0

9. Installation is complete

Note : Don't forget to configure the GCC toolchain after installation . See: Compiler Setting.

CoIDE File structure


The version 2.0 and above of CoIDE use the following 3 paths

C:\CooCox\CoIDE_V2Beta
C:\Users\%USERNAME%\CoIDE\workspace
C:\Users\%USERNAME%\Appdata\Roaming\CooCox\CoIDE

Corresponding

CoIDE Software Directory: the main part of software

Download and Install CoIDE 9


CoIDE Manual V2.0

CoIDE project default directory: create default path of CoIDE project


User data: store temporary files, the data that users use the CoIDE to download , personal configuration, log etc.

Download and Install CoIDE 10


CoIDE Manual V2.0

Quick Start
To create a simple embedded application using CooCox CoIDE, you will perform the following steps: (Before that, do not
forget to configure the GCC compiler and debugger).

Next we will show you an example to introduce how to set up new projects and debugging on COIDE.

Step 1 Launch CoIDE, select "Browse in Repository".

Step 2 Select the manufacturer

Getting Start 11
CoIDE Manual V2.0

Step 3 Select your target chip

Step 4 Download device

Getting Start 12
CoIDE Manual V2.0

Step 5 Create New Project

Step 6 Input project name. You can also modify the Project Path

Getting Start 13
CoIDE Manual V2.0

Step 7 After clicking "Finish", CoIDE will create a project for you, then we can view components to select which is
needed.

Step 8 when we find the component, we need to download it

Getting Start 14
CoIDE Manual V2.0

Step 9 Then add the component to our project

Step 10 After clicking "Add", CoIDE will add the component and it's dependence components to project for you. If we
need anther component, we need click "On-chip peripherals".

Getting Start 15
CoIDE Manual V2.0

Step 11 Click the name of the component can view components related document information

Step 12 Download and add new component

Getting Start 16
CoIDE Manual V2.0

Step 13 These are all the components in the project

Step 14 Select the debugger, and enabled Semihosting

Getting Start 17
CoIDE Manual V2.0

Step 15 Write the main.c

Step 16 Click the "Build" button to compile and link the program

Getting Start 18
CoIDE Manual V2.0

Step 17 Click the "Download" button to download code to flash

Step 18 To start debugging, click on the "Debug" icon or press "Ctrl+F5"

Getting Start 19
CoIDE Manual V2.0

Step 19 If debugging is launched successfully, CoIDE will enter the debug mode. Press F10 can step to run the
program

Step 20 Double-click on the left of the code line number area can set breakpoints

Getting Start 20
CoIDE Manual V2.0

Step 21 Click on the "Varibles", We can see the value of a variable process

Step 22 Click on the "red button", We can exit the debug mode

Getting Start 21
CoIDE Manual V2.0

Step 23 Exit the debug mode

Note: Here We use Nuvoton NUC472HI8AE as the example, you may need to change the chip according to the device at
hand.

Getting Start 22
CoIDE Manual V2.0

Support list

Support Devices for CoIDE 2.0 Dev version


The CooCox CoIDE mainly supports ARM Cortex-M based devices. Till now, CoIDE 2.0 dev version has supported Cortex-
M4, Cortex-M3, Cortex-M0 and Cortex-M0+ chips from Freescale, NXP, Nuvoton, Spansion, ST and Toshiba. The following
is detailed list.

Freescale

KL0x

MKL04Z16VFK4, MKL04Z16VFM4, MKL04Z16VLC4, MKL04Z16VLF4, MKL04Z32VFK4, MKL04Z32VFM4,


MKL04Z32VFM4R, MKL04Z32VLC4, MKL04Z32VLC4R, MKL04Z32VLF4, MKL04Z32VLF4R, MKL04Z8VFK4,
MKL04Z8VFM4, MKL04Z8VLC4, MKL05Z16VFK4, MKL05Z16VFM4, MKL05Z16VLC4, MKL05Z16VLF4,
MKL05Z32VFK4, MKL05Z32VFM4R, MKL05Z32VLF4, MKL05Z8VFK4, MKL05Z8VFM4, MKL05Z8VLC4, M,
MKL05Z32VLC4
KL1x

MKL14Z32VFM4, MKL14Z32VFT4, MKL14Z32VLH4, MKL14Z32VLK4, MKL14Z64VFM4, MKL14Z64VFT4,


MKL14Z64VLH4, MKL14Z64VLK4, MKL15Z128CAD4R, MKL15Z128VFM4, MKL15Z128VFT4, MKL15Z128VLH4,
MKL15Z128VLH4R, MKL15Z128VLK4, MKL15Z32VFM4, MKL15Z32VFT4, MKL15Z32VLH4, MKL15Z32VLK4,
MKL15Z64VFM4, MKL15Z64VFM4R, MKL15Z64VFT4, MKL15Z64VLH4, MKL15Z64VLK4M, MKL14Z64VFM4R
KL2x

MKL24Z32VFM4, MKL24Z32VFT4, MKL24Z64VFM4, MKL24Z64VFT4, MKL24Z64VLH4, MKL24Z64VLK4,


MKL25Z128VFM4, MKL25Z128VFT4, MKL25Z128VLH4, MKL25Z128VLK4, MKL25Z32VFM4, MKL25Z32VFT4,
MKL25Z32VLH4, MKL25Z32VLK4, MKL25Z64VFM4, MKL25Z64VFT4, MKL25Z64VLH4, MKL25Z64VLK4,
MKL24Z32VLH4, MKL24Z32VLK4

Nuvoton

M051

M0516LBN, M0516LDE, M0516LDN, M0516ZBN, M0516ZDE, M0516ZDN, M052LBN, M052LDE, M052LDN,


M052ZBN, M052ZDE, M052ZDN, M054LBN, M054LDE, M054LDN, M054ZBN, M054ZDE, M054ZDN, M058LBN,
M058LDE, M058LDN, M058SFAN, M058SLAN, M058SSAN, M058SZAN, M058ZBN, M058ZDE, M058ZDN
NANO1x2

NANO102LB1AN, NANO102LC2AN, NANO102SC2AN, NANO102ZB1AN, NANO102ZC2AN, NANO112LB1AN,


NANO112LC2AN, NANO112RB1AN, NANO112RC2AN, NANO112SB1AN, NANO112SC2AN, NANO112VC2AN
NUC200

NUC200LC2AN, NUC200LD2AN, NUC200LE3AN, NUC200SC2AN, NUC200SD2AN, NUC200SE3AN,


NUC200VE3AN, NUC220LC2AN, NUC220LD2AN, NUC220LE3AN, NUC220SC2AN, NUC220SD2AN,
NUC220SE3AN, NUC220VE3AN
NUC230240

NUC230LC2AE, NUC230LD2AE, NUC230LE3AE, NUC230SC2AE, NUC230SD2AE, NUC230SE3AE,


NUC230VE3AE, NUC240LC2AE, NUC240LD2AE, NUC240LE3AE, NUC240SC2AE, NUC240SD2AE,
NUC240SE3AE, NUC240VE3AE

Support Device & Debugger 23


CoIDE Manual V2.0

NUC440

NUC442JG8AE, NUC442JI8AE, NUC442KG7AE, NUC442KI8AE, NUC442RG7AE, NUC442RI8AE,


NUC442VG7AE, NUC442VI8AE
NUC470

NUC472HG8AE, NUC472HI8AE, NUC472JG8AE, NUC472JI8AE, NUC472KG8AE, NUC472KI8AE,


NUC472VG8AE, NUC472VI8AE

NXP

LPC1100LV

LPC1101LVUK, LPC1102LVUK, LPC1112LVFHI33_103, LPC1112LVFHN24_003, LPC1114LVFHI33_103,


LPC1114LVFHI33_303, LPC1114LVFHN24_303
LPC1100XL

LPC1102UK, LPC1104UK, LPC1110FD20, LPC1111FDH20_002, LPC1111FHN33_103, LPC1111FHN33_203,


LPC1111JHN33_103, LPC1111JHN33_203, LPC1112FD20_102, LPC1112FDH20_102, LPC1112FDH28_102,
LPC1112FHI33_102, LPC1112FHI33_202, LPC1112FHI33_203, LPC1112FHN24_102, LPC1112FHN33_103,
LPC1112FHN33_203, LPC1112JHI33_203, LPC1112JHN33_103, LPC1112JHN33_203, LPC1113FBD48_303,
LPC1113FHN33_203, LPC1113FHN33_303, LPC1113JBD48_303, LPC1113JHN33_203, LPC1113JHN33_303,
LPC1114FBD48_302, LPC1114FBD48_303, LPC1114FBD48_323, LPC1114FBD48_333, LPC1114FDH28_102,
LPC1114FHI33_302, LPC1114FHI33_303, LPC1114FHN33_202, LPC1114FHN33_203, LPC1114FHN33_302,
LPC1114FHN33_303, LPC1114FHN33_333, LPC1114FN28_102, LPC1114JBD48_303, LPC1114JBD48_323,
LPC1114JBD48_333, LPC1114JHI33_303, LPC1114JHN33_203, LPC1114JHN33_303, LPC1114JHN33_333,
LPC1115FET48_303, LPC1115JBD48_303, LPC1115JET48_303
LPC11C00

LPC11C12FBD48_301, LPC11C14FBD48_301, LPC11C22FBD48_301, LPC11C24FBD48_301


LPC1200

LPC1224FBD48_101, LPC1224FBD48_121, LPC1224FBD64_101, LPC1224FBD64_121, LPC1225FBD48_301,


LPC1225FBD64_301, LPC1226FBD48_301, LPC1226FBD64_301, LPC1227FBD48_301, LPC1227FBD64_301
LPC1300

LPC1311FHN33, LPC1313FBD48, LPC1313FHN33, LPC1315FBD48, LPC1315FHN33, LPC1316FBD48,


LPC1316FHN33, LPC1317FBD48, LPC1317FBD64, LPC1317FHN33, LPC1342FBD48, LPC1342FHN33,
LPC1343FBD48, LPC1343FHN33, LPC1345FBD48, LPC1345FHN33, LPC1346FBD48, LPC1346FHN33,
LPC1347FBD48, LPC1347FBD64, LPC1347FHN33
LPC17xx

LPC1751, LPC1752, LPC1754, LPC1756, LPC1758, LPC1759, LPC1763, LPC1764, LPC1765, LPC1766,
LPC1767, LPC1768, LPC1769

Spansion

MB9BF16x

MB9B164KPMC, MB9BF164KQN, MB9BF164LPMC, MB9BF164LPMC1, MB9BF164LQN, MB9BF165KPMC,


MB9BF165KQN, MB9BF165LPMC, MB9BF165LPMC1, MB9BF165LQN, MB9BF166KPMC, MB9BF166KQN,
MB9BF166LPMC, MB9BF166LPMC1, MB9BF166LQN, MB9BF166MPMC, MB9BF166NBGL, MB9BF166NPMC,
MB9BF166RBGL, MB9BF166RPMC, MB9BF167MPMC, MB9BF167NBGL, MB9BF167NPMC, MB9BF167RBGL,
MB9BF167RPMC, MB9BF168MPMC, MB9BF168NBGL, MB9BF168NPMC, MB9BF168RBGL, MB9BF168RPMC

Support Device & Debugger 24


CoIDE Manual V2.0

MB9BF36x

MB9BF364KPMC, MB9BF364KQN, MB9BF364LPMC, MB9BF364LPMC1, MB9BF364LQN, MB9BF365KPMC,


MB9BF365KQN, MB9BF365LPMC, MB9BF365LPMC1, MB9BF365LQN, MB9BF366KPMC, MB9BF366KQN,
MB9BF366LPMC, MB9BF366LPMC1, MB9BF366LQN, MB9BF366MPMC, MB9BF366NBGL, MB9BF366NPMC,
MB9BF366RBGL, MB9BF366RPMC, MB9BF367MPMC, MB9BF367NBGL, MB9BF367NPMC, MB9BF367RBGL,
MB9BF367RPMC, MB9BF368MPMC, MB9BF368NBGL, MB9BF368NPMC, MB9BF368RBGL, MB9BF368RPMC
MB9BF46x

MB9BF464KPMC, MB9BF464KQN, MB9BF464LPMC, MB9BF464LPMC1, MB9BF464LQN, MB9BF465KPMC,


MB9BF465KQN, MB9BF465LPMC, MB9BF465LPMC1, MB9BF465LQN, MB9BF466KPMC, MB9BF466KQN,
MB9BF466LPMC, MB9BF466LPMC1, MB9BF466LQN, MB9BF466MPMC, MB9BF466NBGL, MB9BF466NPMC,
MB9BF466RBGL, MB9BF466RPMC, MB9BF467MPMC, MB9BF467NBGL, MB9BF467NPMC, MB9BF467RBGL,
MB9BF467RPMC, MB9BF468MPMC, MB9BF468NBGL, MB9BF468NPMC, MB9BF468RBGL, MB9BF468RPMC
MB9BF56x

MB9BF564KPMC, MB9BF564KQN, MB9BF564LPMC, MB9BF564LPMC1, MB9BF564LQN, MB9BF565KPMC,


MB9BF565KQN, MB9BF565LPMC, MB9BF565LPMC1, MB9BF565LQN, MB9BF566KPMC, MB9BF566KQN,
MB9BF566LPMC, MB9BF566LPMC1, MB9BF566LQN, MB9BF566MPMC, MB9BF566NBGL, MB9BF566NPMC,
MB9BF566RBGL, MB9BF566RPMC, MB9BF567MPMC, MB9BF567NBGL, MB9BF567NPMC, MB9BF567RBGL,
MB9BF567RPMC, MB9BF568MPMC, MB9BF568NBGL, MB9BF568NPMC, MB9BF568RBGL, MB9BF568RPMC

ST

STM32F030 Series

STM32F030C6T6, STM32F030C6T6TR, STM32F030C8T6, STM32F030C8T6TR, STM32F030F4P6,


STM32F030F4P6TR, STM32F030K6T6, STM32F030K6T6TR, STM32F030R8T6, STM32F030R8T6TR
STM32F031 Series

STM32F031C4T6, STM32F031C4T6TR, STM32F031C6T6, STM32F031C6T6TR, STM32F031C6T7,


STM32F031F4P6, STM32F031F4P7, STM32F031F4U6, STM32F031F6P6, STM32F031F6P7,
STM32F031F6P7TR, STM32F031G4U6, STM32F031G4U6TR, STM32F031G4U7, STM32F031G4U7TR,
STM32F031G6U6, STM32F031G6U6TR, STM32F031G6U7, STM32F031K4U6, STM32F031K6T6,
STM32F031K6T7, STM32F031K6U6, STM32F031K6U7
STM32F038 Series

STM32F038C6T6, STM32F038C6T7, STM32F038F6P6, STM32F038G6U6, STM32F038K6U6


STM32F042 Series

STM32F042C4T6, STM32F042C6T6, STM32F042C6U6, STM32F042C6U7, STM32F042F4P6,


STM32F042F4P6TR, STM32F042F6P6, STM32F042F6P7, STM32F042G4U6, STM32F042G6U6,
STM32F042K4U6, STM32F042K6T6, STM32F042K6T7, STM32F042K6U6, STM32F042K6U7,
STM32F042T6Y6TR
STM32F048 Series

STM32F048C6T6, STM32F048C6U6, STM32F048G6U6, STM32F048T6Y6TR


STM32F051 Series

STM32F051C4T6, STM32F051C6T6, STM32F051C6T6TR, STM32F051C6T7, STM32F051C6U6,


STM32F051C8T6, STM32F051C8T6TR, STM32F051C8T7, STM32F051C8T7TR, STM32F051C8U6,
STM32F051C8U6TR, STM32F051C8U7, STM32F051K4T6, STM32F051K4T6TR, STM32F051K4U6,
STM32F051K4U6TR, STM32F051K4U7, STM32F051K4U7TR, STM32F051K6T6, STM32F051K6T6TR,
STM32F051K6T7, STM32F051K6T7TR, STM32F051K6U6, STM32F051K6U6TR, STM32F051K6U7,

Support Device & Debugger 25


CoIDE Manual V2.0

STM32F051K6U7TR, STM32F051K8T6, STM32F051R4T6, STM32F051R4T6TR, STM32F051R6T6,


STM32F051R8T6, STM32F051R8T6TR, STM32F051R8T7
STM32F058 Series

STM32F058C8U6, STM32F058R8T6
STM32F071 Series

STM32F071CBT6, STM32F071CBT6TR, STM32F071CBT7, STM32F071CBU6, STM32F071CBU6TR,


STM32F071CBU7, STM32F071CBU7TR, STM32F071CBY6TR, STM32F071RBT6, STM32F071RBT7TR,
STM32F071V8H6, STM32F071V8T6, STM32F071VBH6, STM32F071VBT6
STM32F072 Series

STM32F072C8T6, STM32F072C8T6TR, STM32F072C8U6, STM32F072C8U7, STM32F072CBT6,


STM32F072CBT6TR, STM32F072CBU6, STM32F072CBY6TR, STM32F072R8T6, STM32F072R8T6TR,
STM32F072RBH6TR, STM32F072RBI6, STM32F072RBT6, STM32F072V8H6, STM32F072V8T6,
STM32F072VBH6, STM32F072VBH6TR, STM32F072VBT6
STM32F078 Series

STM32F078CBT6, STM32F078CBU6, STM32F078CBY6TR, STM32F078RBT6, STM32F078VBH6,


STM32F078VBT6 Series
STM32F091 Series

STM32F091CBT6, STM32F091CBU6, STM32F091CCT6, STM32F091CCU6, STM32F091RBT6,


STM32F091RCH6, STM32F091RCT6, STM32F091RCT7, STM32F091RCY6TR, STM32F091VBT6,
STM32F091VCH6, STM32F091VCT6
STM32F098 Series

STM32F098CCT6, STM32F098CCU6, STM32F098RCT6, STM32F098RCY6TR, STM32F098VCT6


STM32F100 Series

STM32F100C4T6B, STM32F100C4T6BTR, STM32F100C4T7B, STM32F100C6T6B, STM32F100C6T6BTR,


STM32F100C6T7B, STM32F100C8T6B, STM32F100C8T6BTR, STM32F100C8T7B, STM32F100CBT6B,
STM32F100CBT6BTR, STM32F100CBT7B, STM32F100CBT7BTR, STM32F100R4H6B, STM32F100R4T6B,
STM32F100R4T6BTR, STM32F100R6H6B, STM32F100R6T6B, STM32F100R6T6BTR, STM32F100R8H6B,
STM32F100R8H7B, STM32F100R8T6B, STM32F100R8T6BTR, STM32F100R8T7B, STM32F100RBH6B,
STM32F100RBH6BTR, STM32F100RBT6B, STM32F100RCT6B, STM32F100RDT6B, STM32F100RDT6BTR,
STM32F100RET6B, STM32F100RET6BTR, STM32F100V8T6B, STM32F100V8T7B, STM32F100VBT6B,
STM32F100VBT6BTR, STM32F100VBT7B, STM32F100VCT6, STM32F100VCT6B, STM32F100VCT6BTR,
STM32F100VDT6, STM32F100VDT6B, STM32F100VDT6BTR, STM32F100VDT7B, STM32F100VET6,
STM32F100VET6B, STM32F100VET6BTR, STM32F100VET7B, STM32F100ZCT6B, STM32F100ZDT6B,
STM32F100ZET6B, STM32F100ZET6BTR, STM32F100ZET7B
STM32F101 Series

STM32F101C6T6A, STM32F101C6T6ATR, STM32F101C8T6, STM32F101CBT6, STM32F101CBT6TR,


STM32F101CBU6, STM32F101CBU6TR, STM32F101R4T6A, STM32F101R6T6A, STM32F101R6T6ATR,
STM32F101R8T6, STM32F101R8T6TR, STM32F101RBT6, STM32F101RBT6TR, STM32F101RCT6,
STM32F101RCT6TR, STM32F101RDT6, STM32F101RDT6TR, STM32F101RET6, STM32F101RFT6,
STM32F101RGT6, STM32F101RGT6TR, STM32F101T4U6A, STM32F101T6U6A, STM32F101T6U6ATR,
STM32F101T8U6, STM32F101T8U6TR, STM32F101TBU6, STM32F101TBU6TR, STM32F101V8T6,
STM32F101V8T6TR, STM32F101VBT6, STM32F101VBT6TR, STM32F101VCT6, STM32F101VCT6TR,
STM32F101VDT6, STM32F101VDT6TR, STM32F101VET6, STM32F101VFT6, STM32F101VFT6TR,
STM32F101VGT6, STM32F101ZCT6, STM32F101ZDT6, STM32F101ZET6, STM32F101ZFT6,
STM32F101ZGT6
STM32F102 Series

Support Device & Debugger 26


CoIDE Manual V2.0

STM32F102C4T6A, STM32F102C4T6ATR, STM32F102C6T6A, STM32F102C6T6ATR, STM32F102C8T6,


STM32F102C8T6TR, STM32F102CBT6, STM32F102CBT6TR, STM32F102R4T6A, STM32F102R6T6A,
STM32F102R8T6, STM32F102RBT6, STM32F102RBT6TR
STM32F103 Series

STM32F103C4T6A, STM32F103C6T6A, STM32F103C6T7A, STM32F103C6T7ATR, STM32F103C6U6A,


STM32F103C8T6, STM32F103C8T6TR, STM32F103C8T7, STM32F103C8T7TR, STM32F103CBT6,
STM32F103CBT6TR, STM32F103CBT7TR, STM32F103CBU6TR, STM32F103R4H6A, STM32F103R4T6A,
STM32F103R6H6A, STM32F103R6T6A, STM32F103R6T6ATR, STM32F103R6T7A, STM32F103R8H6,
STM32F103R8H6TR, STM32F103R8H7, STM32F103R8T6, STM32F103R8T6TR, STM32F103R8T7,
STM32F103R8T7TR, STM32F103RBH6, STM32F103RBH6TR, STM32F103RBT6, STM32F103RCT6,
STM32F103RCT6TR, STM32F103RCT7, STM32F103RDT6, STM32F103RDT6TR, STM32F103RDY6TR,
STM32F103RET6, STM32F103RET6TR, STM32F103RET7, STM32F103REY6TR, STM32F103RFT6,
STM32F103RFT6JTR, STM32F103RFT6TR, STM32F103RGT6, STM32F103RGT6TR, STM32F103RGT7,
STM32F103T4U6A, STM32F103T6U6A, STM32F103T6U7A, STM32F103T8U6, STM32F103T8U6TR,
STM32F103T8U7, STM32F103T8U7TR, STM32F103TBU6, STM32F103TBU7, STM32F103V8H6,
STM32F103V8T6, STM32F103V8T6TR, STM32F103VBH6, STM32F103VBH7, STM32F103VBI6,
STM32F103VBT6, STM32F103VBT6TR, STM32F103VBT7, STM32F103VBT7TR, STM32F103VCH6,
STM32F103VCT6, STM32F103VCT6TR, STM32F103VDH6, STM32F103VDH6TR, STM32F103VDT6,
STM32F103VDT6TR, STM32F103VDT7, STM32F103VEH6, STM32F103VEH6TR, STM32F103VEH7,
STM32F103VET6, STM32F103VET6TR, STM32F103VET7, STM32F103VET7TR, STM32F103VFT6,
STM32F103VFT6TR, STM32F103VFT7, STM32F103VGT6, STM32F103VGT6J, STM32F103VGT6TR,
STM32F103VGT7, STM32F103ZCH6, STM32F103ZCT6, STM32F103ZCT6TR, STM32F103ZCT7,
STM32F103ZDH6, STM32F103ZDH6TR, STM32F103ZDT6, STM32F103ZEH6, STM32F103ZEH6TR,
STM32F103ZEH7, STM32F103ZET6, STM32F103ZET6TR, STM32F103ZET7, STM32F103ZFH6,
STM32F103ZFH6TR, STM32F103ZFT6, STM32F103ZGH6, STM32F103ZGH6TR, STM32F103ZGH7,
STM32F103ZGT6, STM32F103ZGT6J, STM32F103ZGT6TR
STM32F105 Series

STM32F105R8T6, STM32F105R8T6TR, STM32F105RBT6, STM32F105RBT6TR, STM32F105RCT6,


STM32F105RCT6TR, STM32F105RCT6V, STM32F105RCT6W, STM32F105RCT7, STM32F105V8T6,
STM32F105VBH6, STM32F105VBT6, STM32F105VCT6, STM32F105VCT6TR, STM32F105VCT6V,
STM32F105VCT6W, STM32F105VCT7
STM32F107 Series

STM32F107RBT6, STM32F107RBT6TR, STM32F107RCT6, STM32F107RCT6TR, STM32F107RCT7,


STM32F107VBT6, STM32F107VCH6, STM32F107VCT6, STM32F107VCT6TR
STM32F205 Series

STM32F205RBT6, STM32F205RBT7, STM32F205RCT6, STM32F205RCT6TR, STM32F205RCT7,


STM32F205RET6TR, STM32F205RET7, STM32F205RET7TR, STM32F205RFT6, STM32F205RGT6,
STM32F205RGT6TR, STM32F205RGT6V, STM32F205RGT6W, STM32F205RGT7, STM32F205RGY6TR,
STM32F205VBT6, STM32F205VCT6, STM32F205VCT6TR, STM32F205VCT7, STM32F205VCT7TR,
STM32F205VET6, STM32F205VET6TR, STM32F205VET7, STM32F205VFT6, STM32F205VFT6TR,
STM32F205VGT6, STM32F205VGT6J, STM32F205VGT6V, STM32F205VGT6W, STM32F205VGT7,
STM32F205VGT7TR, STM32F205ZCT6, STM32F205ZCT6TR, STM32F205ZCT7, STM32F205ZCT7TR,
STM32F205ZET6, STM32F205ZET6TR, STM32F205ZET7, STM32F205ZET7TR, STM32F205ZFT6,
STM32F205ZGT6, STM32F205ZGT6J, STM32F205ZGT6TR, STM32F205ZGT6V, STM32F205ZGT6W
STM32F207 Series

STM32F207ICH6, STM32F207ICT6, STM32F207IEH6, STM32F207IEH6TR, STM32F207IET6, STM32F207IFH6,


STM32F207IFH6TR, STM32F207IFT6, STM32F207IGH6, STM32F207IGH6J, STM32F207IGH6TR,
STM32F207IGH6U, STM32F207IGH7, STM32F207IGT6, STM32F207IGT6U, STM32F207IGT7,
STM32F207VCT6, STM32F207VCT6TR, STM32F207VCT7, STM32F207VET6, STM32F207VET6TR,

Support Device & Debugger 27


CoIDE Manual V2.0

STM32F207VFT6, STM32F207VFT6TR, STM32F207VGT6, STM32F207VGT6J, STM32F207VGT6TR,


STM32F207VGT6U, STM32F207VGT7, STM32F207ZCT6, STM32F207ZET6, STM32F207ZET6TR,
STM32F207ZFT6, STM32F207ZGT6, STM32F207ZGT6J, STM32F207ZGT6TR, STM32F207ZGT6U,
STM32F207ZGT6W, STM32F207ZGT7
STM32F215 Series

STM32F215RET6, STM32F215RGT6, STM32F215RGT6TR, STM32F215VET6, STM32F215VGT6,


STM32F215ZET6, STM32F215ZET6TR, STM32F215ZGT6
STM32F217 Series

STM32F217IEH6, STM32F217IET6, STM32F217IGH6, STM32F217IGH6U, STM32F217IGT6, STM32F217IGT7,


STM32F217VET6, STM32F217VET6TR, STM32F217VGT6, STM32F217VGT6TR, STM32F217ZET6,
STM32F217ZET7, STM32F217ZGT6
STM32F301 Series

STM32F301C6T6, STM32F301C8T6, STM32F301C8Y6, STM32F301K6U6, STM32F301K8U6,


STM32F301R6T6, STM32F301R8T6
STM32F302 Series

STM32F302C6T6, STM32F302C8T6, STM32F302C8Y6, STM32F302CB, STM32F302CC, STM32F302K6U6,


STM32F302K8U6, STM32F302R6T6, STM32F302R8T6, STM32F302RB, STM32F302RC, STM32F302VB,
STM32F302VC
STM32F303 Series

STM32F303CB, STM32F303CC, STM32F303RB, STM32F303RC, STM32F303VB, STM32F303VC


STM32F401 Series

STM32F401CB, STM32F401CC, STM32F401RB, STM32F401RC, STM32F401VB, STM32F401VC


STM32F405 Series

STM32F405OE, STM32F405OG, STM32F405RG, STM32F405VG, STM32F405ZG


STM32F407 Series

STM32F407IE, STM32F407IG, STM32F407VE, STM32F407VG, STM32F407ZE, STM32F407ZG


STM32F415 Series

STM32F415OG, STM32F415RG, STM32F415VG, STM32F415ZG


STM32F417 Series

STM32F417IE, STM32F417IG, STM32F417VE, STM32F417VG, STM32F417ZE, STM32F417ZG


STM32F429 Series

STM32F429BE, STM32F429BG, STM32F429BI, STM32F429IE, STM32F429IG, STM32F429II, STM32F429NE,


STM32F429NG, STM32F429NI, STM32F429VE, STM32F429VG, STM32F429VI, STM32F429ZE,
STM32F429ZG, STM32F429ZI
STM32F439 Series

STM32F439BG, STM32F439BI, STM32F439IG, STM32F439II, STM32F439NG, STM32F439NI, STM32F439VG,


STM32F439VI, STM32F439ZG, STM32F439ZI Series
STM32FL051 Series

STM32L051C6T6, STM32L051C6T6TR, STM32L051C8T3, STM32L051C8T6, STM32L051C8T6TR,


STM32L051C8T7, STM32L051K6T6, STM32L051K6U6, STM32L051K6U6TR, STM32L051K8T6,
STM32L051K8T7, STM32L051K8U3, STM32L051K8U6, STM32L051K8U6DTR, STM32L051K8U6TR,
STM32L051K8U7, STM32L051R6H6, STM32L051R6T6, STM32L051R8H6, STM32L051R8H7,

Support Device & Debugger 28


CoIDE Manual V2.0

STM32L051R8T6, STM32L051R8T7, STM32L051T6TR, STM32L051T8Y6DTR, STM32L051T8Y6TR


STM32FL052 Series

STM32L052C6T6, STM32L052C8T6, STM32L052C8T7, STM32L052K6T6, STM32L052K6U6TR,


STM32L052K8T6, STM32L052K8T6D, STM32L052K8T7, STM32L052K8U6, STM32L052K8U6D,
STM32L052K8U6DTR, STM32L052K8U6TR, STM32L052R6H6, STM32L052R6T6, STM32L052R8H6,
STM32L052R8T6, STM32L052R8T7, STM32L052T6Y6TR, STM32L052T8Y6TR
STM32FL053 Series

STM32L053C6T6, STM32L053C6T7, STM32L053C8T6, STM32L053C8T6D, STM32L053C8T7,


STM32L053R6H6, STM32L053R6T6, STM32L053R8H6, STM32L053R8H6D, STM32L053R8T3,
STM32L053R8T6, STM32L053R8T7
STM32FL062 Series

STM32L062K8T6, STM32L062K8U6
STM32FL063 Series

STM32L063C8T6, STM32L063R8T6
STM32L100 Series

STM32L100C6U6, STM32L100C6U6A, STM32L100C6U6ATR, STM32L100C6U6TR, STM32L100R8T6,


STM32L100R8T6A, STM32L100R8T6TR, STM32L100RBT6, STM32L100RBT6A, STM32L100RBT6ATR,
STM32L100RBT6TR, STM32L100RCT6, STM32L100RCT6TR
STM32L151 Series

STM32L151C6T6, STM32L151C6T6A, STM32L151C6T6TR, STM32L151C6U6, STM32L151C6U6A,


STM32L151C6U6TR, STM32L151C8T6, STM32L151C8T6A, STM32L151C8T6TR, STM32L151C8U6,
STM32L151C8U6A, STM32L151C8U6TR, STM32L151CBT6, STM32L151CBT6A, STM32L151CBT6D,
STM32L151CBT6TR, STM32L151CBU6, STM32L151CBU6A, STM32L151CBU6D, STM32L151CBU6TR,
STM32L151CCT6, STM32L151CCT6J, STM32L151CCT6TR, STM32L151CCU6, STM32L151CCU6TR,
STM32L151QCH6, STM32L151QDH6, STM32L151QDH6TR, STM32L151QEH6, STM32L151R6H6,
STM32L151R6H6A, STM32L151R6T6, STM32L151R6T6A, STM32L151R6T6TR, STM32L151R8H6,
STM32L151R8H6A, STM32L151R8H6ATR, STM32L151R8H6TR, STM32L151R8T6, STM32L151R8T6A,
STM32L151RBH6A, STM32L151RBH6TR, STM32L151RBT6, STM32L151RBT6A, STM32L151RBT6D,
STM32L151RBT6TR, STM32L151RCT6, STM32L151RCT6A, STM32L151RCT6ATR, STM32L151RCY6TR,
STM32L151RDT6, STM32L151RDT6TR, STM32L151RET6, STM32L151RET6TR, STM32L151UCY6TR,
STM32L151V8H6, STM32L151V8H6A, STM32L151V8T6, STM32L151V8T6A, STM32L151VBH6,
STM32L151VBH6A, STM32L151VBH6D, STM32L151VBT6, STM32L151VBT6A, STM32L151VBT6TR,
STM32L151VCH6, STM32L151VCH6A, STM32L151VCH6ATR, STM32L151VCH6TR, STM32L151VCT6,
STM32L151VCT6TR, STM32L151VDT6, STM32L151VET6, STM32L151VEY6TR, STM32L151ZCT6,
STM32L151ZCT6TR, STM32L151ZDT6, STM32L151ZET6, STM32L152RCT6A, STM32L152VCT6A
STM32L152 Series

STM32L152C6T6, STM32L152C6T6A, STM32L152C6U6, STM32L152C6U6A, STM32L152C8T6,


STM32L152C8T6A, STM32L152C8U6, STM32L152C8U6A, STM32L152CBT6, STM32L152CBT6A,
STM32L152CBU6, STM32L152CBU6A, STM32L152CCT6, STM32L152CCU6, STM32L152QCH6,
STM32L152QDH6, STM32L152QEH6, STM32L152R6H6, STM32L152R6H6A, STM32L152R6T6,
STM32L152R6T6A, STM32L152R6T6TR, STM32L152R8H6, STM32L152R8H6A, STM32L152R8T6,
STM32L152R8T6A, STM32L152R8T6TR, STM32L152RBH6, STM32L152RBH6A, STM32L152RBT6,
STM32L152RBT6A, STM32L152RCT6, STM32L152RDT6, STM32L152RDT6TR, STM32L152RET6,
STM32L152V8H6, STM32L152V8H6A, STM32L152V8H6TR, STM32L152V8T6, STM32L152V8T6A,
STM32L152V8T6TR, STM32L152VBH6, STM32L152VBH6A, STM32L152VBT6, STM32L152VBT6A,
STM32L152VBT6ATR, STM32L152VBT6TR, STM32L152VCH6, STM32L152VCT6, STM32L152VDT6,
STM32L152VET6, STM32L152VEY6TR, STM32L152ZCT6, STM32L152ZCT6TR, STM32L152ZDT6,

Support Device & Debugger 29


CoIDE Manual V2.0

STM32L152ZET6
STM32L162 Series

STM32L162QDH6, STM32L162RCT6, STM32L162RCT6A, STM32L162RDT6, STM32L162RDT6TR,


STM32L162RDY6TR, STM32L162RET6, STM32L162VCH6, STM32L162VCH6TR, STM32L162VCT6,
STM32L162VCT6A, STM32L162VDT6, STM32L162VET6, STM32L162VEY6TR, STM32L162ZDT6,
STM32L162ZET6

Toshiba

TMPM037
TMPM037FWUG
TMPM061
TMPM061FWFG
TMPM330
TMPM330FDFG, TMPM330FWFG, TMPM330FYFG
TMPM332
TMPM332FWUG
TMPM333
TMPM333FDFG, TMPM333FWFG, TMPM333FYFG
TMPM341
TMPM341FDXBG, TMPM341FYXBG
TMPM342
TMPM342FYXBG
TMPM343
TMPM343F10XBG, TMPM343FDXBG, TMPM343FEXBG
TMPM361
TMPM361F10FG, TMPM361FDFG, TMPM361FYFG
TMPM362
TMPM362F10FG
TMPM363
TMPM363F10FG
TMPM364
TMPM364F10FG
TMPM365
TMPM365FWXBG, TMPM365FYXBG
TMPM366
TMPM366FDFG, TMPM366FDXBG, TMPM366FWFG, TMPM366FWXBG, TMPM366FYFG, TMPM366FYXBG
TMPM367
TMPM367FDFG, TMPM367FDXBG, TMPM367FWFG, TMPM367FWXBG, TMPM367FYFG, TMPM367FYXBG
TMPM368
TMPM368FDFG, TMPM368FDXBG, TMPM368FWFG, TMPM368FWXBG, TMPM368FYFG, TMPM368FYXBG
TMPM369
TMPM369FDFG, TMPM369FDXBG, TMPM369FYFG, TMPM369FYXBG
TMPM36B
TMPM36BF10FG, TMPM36BFYFG
TMPM370
TMPM370FYDFG, TMPM370FYFG
TMPM372
TMPM372FWFG, TMPM372FWUG
TMPM373
TMPM373FWDUG
TMPM374

Support Device & Debugger 30


CoIDE Manual V2.0

TMPM374FWUG
TMPM375
TMPM375FSDMG
TMPM376
TMPM376FDDFG, TMPM376FDFG
TMPM377
TMPM377FYDFG, TMPM377FYFG
TMPM395
TMPM395FWAXBG

Supported Adapters
List of debug adapters, supported by CoIDE

Debugging
Available Devices PC USB Driver
Adapter

Atmel, TI, NXP, ST, Toshiba,


Colink Colink Driver
details

Atmel, Energy Micro,


CoLinkEx
CoLinkEx Freescale, Holtek, TI, NXP,
Driverhttp://192.168.2.154/coocox.org/hardware/colinkex.php
Nuvoton, ST, Toshiba, details

Nu-Link, Nu-
Link-Me or Nuvoton, details Don't need
Nu-Link-pro

Atmel, TI, NXP, ST, Toshiba,


FTDI devices FTDI Driver
details

ST-Link or ST-
ST, details ST-Link/V2 Driver
Link/V2

e-link32 Holtek, details e-link32 Driver

Open-
SDA(How to Freescale, details Don't need
use)

Active-Semi, Atmel, Energy


Micro, Freescale , TI, Toshiba,
CMSIS-DAP Don't need
NXP, Nuvoton, Spansion, ST,
Holtek

Requirement for CoIDE


System requirements:

Windows XP SP3/Windows Vista/Windows 7

Hardware requirements:

Debug adapter such as CoLinkEx, Open-SDA, etc.

Software requirements:

GCC ARM Embedded (see: Set GCC Compiler)

Install the related driver for the adapter you used

Support Device & Debugger 31


CoIDE Manual V2.0

Support Device & Debugger 32


CoIDE Manual V2.0

Introduction
Click Configuration button to open project configuration view.

Configuration area is divided into six different configuration items: Compile, Link, Output, User, Debugger and Download.
The first four configurations are building and linking configurations, the last two are debugging/programming configurations.

Compile configuration

1) Option area:
a) FPU: Select MCU type, it includes Not use FPU, FPU soft and FPU hard(Note: If you select the FPU hard, you need
to enable FPU module in the code)

Project Configuration 33
CoIDE Manual V2.0

b) Optimization: Select the level of optimization, it includes (None(-O0), Optimize(-O1), Optimize More(-O2), Optimize
Most(-O3), Optimize Size(-Os))

c) Support C++: Select this option to support C++ code.

2) Include paths area:


Add / Remove header files' paths

The added paths will be associated to the current path of the project file to be processed.

3) Defined Symbols area:


Add / Remove pretreatment (macro definition) Symbol

4) Misc Controls area:


User can edit (add) user-defined compile commands.

5) Compile Control String area:


Show compile commands (can not be edited manually)

Link configuration

Project Configuration 34
CoIDE Manual V2.0

1) Options area:
a) Use Memory Layout from Memory Window (Checked by default)

Check: Memory Area will be available; Scatter File Area will be unavailable.

Mean to use memory Area memory data, and use IDE default link file (such as link.ld).

Uncheck: Memory Area will be unavailable; Scatter File will be available.

The system will add default link.ld/arm-gcc-link.ld and file in the directory of the project file, at the same time, the link file
path is filled into the Scatter File area, and user can select a custom link file in the Scatter File area.

b) Discard unused sections

Allow recovery of unused input section. Segments that contain the entrance symbol and all the segments of undefined
symbols in the command line will be retained. Segments that contain a dynamic object reference symbol will also be
retained. Check this option to reduce code size.

Project Configuration 35
CoIDE Manual V2.0

c) Dont use standard system startup files

Do not use the standard system startup files when linking. The standard system

libraries are used in default unless -nostdlib or -nodefaultlibs is used.

d) Library select list

Select link library: Not use C Library, Use base C Library, Use nano C Library*, Semihosting, Retarget

Options: Printf float, Scanf float

Note: "Use nano C Library"

Only work if you are using gcc-arm-none-eabi-4_7 or higher version. If you choose "Use nano C Library", it will provide two
more options "Printf float" and "Scanf float". Just like the following picture.

2) Linked Libraries area:


Add/remove library file.

Library is collection of a series of procedures, external function and variables. It is integrated into an application program by
the compiler and linker during compilation, and made into a target file and an executable file that can run independently.
The CoIDE library is the GCC library. The extended name of CoIDE Library is .a.

3) Memory Area
The memory area is only available when "Use Memory Layout from Memory Window") is checked.

a) Select: Debug in Flash(default), Debug in RAM

b) In "Memory Area", start address and size for IROM and IRAM can be customized:

IROM and IRAM start address and size is automatically changed according to your choice, or you can manually modify
these values.

c) In Start line, IROM and IRAM start address can be customized; in Size line, IROM and IRAM size can be customized.

4) Scatter File area


Scatter File area (available when unchecked "Use Memory Layout from Memory Window", at the same time system in
project file directory provides a default link file)

Project Configuration 36
CoIDE Manual V2.0

In the area user can specify a custom link file path.

5) Misc Controls area


Edit link command area, users can add custom link command.

6) Linker Control String area


Cannot be edited, display the link commands information.

Output configuration
The configuration area of output files after building project.

The files generated after building a project will be saved under a directory named with the formation of Executable+"/"+

Project Configuration 37
CoIDE Manual V2.0

Name of Executable.

1) Name of Executable: Specify the folder of the output files, the default is the configuration name of the current project
configuration;

2) Path of Executable: Specify the output file path

3) Create Executable(.elf): Generate. elf executable files, by check / uncheck decide whether to generate the HEX or BIN
file

4) Create Library(.a): Generate. a library file

User configuration
Customize IDE implementation program Before Build, After Build and Before Debug.

In Before Build/Rebuild area implementation program before Build/Rebuild can be customized; in After Build/Rebuild

Project Configuration 38
CoIDE Manual V2.0

area implementation program after Build/Rebuild can be customized.

You can directly enter commands, or import. bat or. exe files. After configuration, you need build or rebuild the project.

Note:If you enter command directly, you can use Buildin Variables, you can click "Buildin Variables" link to open the
reference document from C:\CooCox\CoIDE\CoIDEHelpFileDir\buildin variables.mht

In Before Debug, if "Auto Compile Before Debugging" is checked, CoIDE will automatically execute incremental compile
before debugging launched.

Debugger configuration

1) Hardware area
a) Adapter: CoIDE supports Colink, CoLinkEx, CMSIS-DAP, Nu-Link, ST-Link, J-Link and some FTDI-compatible adapter.

Project Configuration 39
CoIDE Manual V2.0

b) Port: CoIDE supports SWD and JTAG debug modes.

c) Max Clock (Hz): You can select the clock frequency from 2M, 1M, 500K, 300K and 100K.

2) Startup area
Select whether to run to main function when you start debug.

3) Advance area
a) Reset Mode: There are three reset modes: HW RESET, VECTRESET and SYSRESETREQ.

b) Semihosting Enable: Check to enable Semihosting function.

c) CacheRom Enable: Check to enable ROM cache.

4) TargetInfo area
Target Info area displays the host name and port number.

5) J-link Info area


In Adapter configuration items of the Hardware area, some special link such as J-Link Adapter has the particular
configuration items, as shown below. It displays J-link debugger configuration information.

Project Configuration 40
CoIDE Manual V2.0

Download configuration

Project Configuration 41
CoIDE Manual V2.0

1) Auto Download Before Debugging: automatically download programs before debugging.

2) Verify After Download: verify programs after download.

3) Erase Full Chip: erase the full chip before download.

4) Erase Effected: erasing the affected sectors before download.

5) Do not Erase: do not erase the chip before download.

6) Programming Algorithm Will display Programming Algorithm file.

7) Add..., Remove and Default are used to configure Flash algorithm file.

Note: If you select J-Link as adapter, Download configuration will be unavailable. J-Link do not use the parameter of
download configuration, that is different from other adapter.

Project Configuration 42
CoIDE Manual V2.0

Component Definition

What is a component?
In order to be better accustomed to faster development and to better leverage the module development, CooCox came up
with the idea of "component development".

Then what is a component? To make it simple, a component mainly consists of 4 parts:

Source code. It refers to reusable code, so we need to extract the variable part into component configuration.
Document, including comments within the source code, component homepage, even user manual.
Example (a project), to guarantee the ease of use of a component together with the document.
Test (a project), to guarantee the quality of the component.

Catalogue

A component is a git repository. Its basic catalogue is like this:

E:.
components
ahnniu
hd44780
. gitignore
cox.interface.lbr
LCD_HD44780_Driver_Test.coproj
README.md

assets
images
hd44780_commands.gif
hd44780_ddramaddress.gif
ldc1.gif

pdf

doxygen
build.xml
Doxyfile
makefile

assets
images
placeholder

search
mag_sel.png
search_l.jpg
search_m.jpg
search_r.jpg

include
footer.html
header.html

javascripts
resize.js

stylesheets
doxygen.css
navtree.css
style.css

search
search.css

Component Definition 43
CoIDE Manual V2.0


config
layout.xml

helloworld
putstring
hd44780_config.h
putstring.c
README.md
putstring.coproj

Output
doxygen
doxygen.tag

html
LCD_HD44780_Driver_Test
Debug

source
hd44780.c
hd44780.h
hd44780_config.h.example
hw_hd44780.h

test
main.c
hd44780_config.h

.gitignore contains files ignored by git repository


README.md, a document based on markdown syntax, for creating the homepage of the component.
assets, contains some images or PDF resources for users to add when needed
doxygen, contains resources to auto-generate the document, the resources can be used directly with no extra
modification.
helloworld, a simple example of the component, including documents, code and projects.
Output, the output path of projects and documents.
source, source code of the component, uneditable after being added to the project.
test, test code for the component.

Source code

Source code is the essential part of a component. For components with different functions and different sizes, the number
of code lines can vary a lot, from just a few lines to thousands and millions of lines.

However, no matter how many lines there are, the code can be divided into these parts:

Configuration
UI
Implementation

From the last section, we know that source code is uneditable after being added to the project, but the configuration must
be set by users. Therefore, a component should have a configuration template, e.g.:hd44780_config.h.example. Users can
copy the file to the application, rename it and modify the configuration.

Document

To make sure that the generated document is good-looking, we defined conventions for the component comments, mainly
conventions of comments grouping. The group structure is like this:

HD44780
API reference
Enumeration

Component Definition 44
CoIDE Manual V2.0

Hello World
Invoker Configuration
User Manual (optional)

The grouping can be implemented by Doxygen group command. The top-level group is usually the name of the component.

And then nest 4 groups in the top-level group:

API reference
Enumeration
Hello World
Invoker Configuration

Above are the names displayed in the output documents. Actually, you need to define the groups like this:

\addtogroup HD44780_Exported_APIs API Reference


\addtogroup HD44780_Enum Enumeration

Use the unique symbol followed by the name to be displayed in the document.

Generally speaking,

API reference and Enumeration groups are defined in the header files of user interface.
Invoker Configuration group is defined in the configuration file
Hello World group is defined in the example file.

The internal implementation of source code can further use grouping, or not. You can even use library files.

Component Definition 45
CoIDE Manual V2.0

Component Coding Conventions


To make it easier to read and maintain the code, the component library has unified coding conventions, and uses Doxygen
to generate the documents.

Below are what you need to pay attention to. For details, please refer to our code.

1. Type definitions
1.1 The program needs to be indented with 4 spaces.

1.2 Use spaces instead of TAB to align the code. Note: In different editors, a tab is defined as different numbers of
spaces, which will lead to code disalignment. Using spaces can avoid this issue.

1.3 Blank lines must be used to separate independent program blocks and follow variable declarations.

1.4 Statements with over 80 characters should be written in multiple lines; long expressions need to start a new line at
the low-priority command characters, and the command characters should be the beginning of the new line with
suitable indentation to keep the program neat.

1.5 Statements like if, for, do, while, case, switch, default, etc. should occupy a line, and be surrounded by {} no
matter how long the statement is.

1.6 In a program, the beginning of a function, the declaration of a structure, and a loop should be indented, and the
processing statements in a case command should be indented too.

1.7 The delimiter in a program like { and } should occupy one line, locate in the same column, and be left-aligned
with relative statements. In a program, the beginning of function body, the definition of class and enumeration, and
statements like if, for, do, while, switch, case need to be indented as mentioned above.

1.8 Spaces need to be added before or (and) after the instruction character when there are more than 2 keywords or
variables or constants in the equivalent operation. Closely related instruction characters (e.g. -> ) should have no
spaces in between when there is no equivalent operations.

2. Comments

2.1. File header

The file header should list the brief introduction, author, date and license of the file, like this:

//*****************************************************************************
//
//! \file xadc.h
//! \brief Defines and Macros for ADC API.
//! \version V2.0.0
//! \date 9/30/2011
//! \author CooCox
//! \copy
//!
//! Copyright (c) 2011, CooCox
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:

Component Coding Conventions 46


CoIDE Manual V2.0

//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************

Words start with \ are Doxygen commands, like file, \brief, and \date.

2.2. Function header

//*****************************************************************************
//
//! \brief Configures an ADC digital comparator.
//!
//! \param ulBase is the base address of the ADC module.
//! \param ulCompID is the ID of the comparator to configure.
//! \param ulConfig is the configuration of the comparator.
//!
//! This function will configure a comparator. The \e ulConfig parameter is
//! the result of xADC_COMP_INT_xxx value. Reference
//! \ref xADC_Comparator_Int_Condition.
//!
//! \note Here are some matters needing attention.
//!
//! \return None.
//
//*****************************************************************************

The sequence should be like this: \brief, \param(optional), details(optional), \note(optional), and \return.

2.3. Function comments

{
...

//
// Get the ADC_CMPRx register address
//
ulCompRegAddr = ulBase + ADC_CMPR0 + (4 * ulCompID);

...
}

2.4. Macro definition comments

//
//! Compare condition is greater or equal

Component Coding Conventions 47


CoIDE Manual V2.0

//
#define ADC_COMP_GREATER_EQUAL 0x00000004

2.5. Doxygen group

//*****************************************************************************
//
//! \addtogroup NUC1xx_ADC_Operation_Mode NUC1xx ADC Operation Mode
//! \brief ADC A/D Converter Operation Mode.
//! @{
//
//*****************************************************************************

...

//*****************************************************************************
//
//! @}
//
//*****************************************************************************

3. Identifiers naming
3.1 Variables are generally named as this: Type prefix + Noun with the first letter capitalized, e.g. egisterValue,
pucBuffer.

Type prefix example

unsigned long ul ulRegisterValue

unsigned long pointer pul pulBuffer

long l lValue

long pointer pl plValue

unsigned short us usValue

unsigned short pointer pus pusValue

short s sValue

short pointer ps psValue

unsigned char uc ucValue

unsigned char pointer puc pucValue

char c cChar

char pointer pc pcString

struct s sValue

struct pointer ps psValue

xBoolean b bResult

3.2. typedef definitions are generally named as: t + Noun with the first letter capitalized, e.g. tBoolean.

3.3. Functions are generally named as: Module + Verb with the first letter capitalized, e.g. SysCtlClockSet,
GPIOPinsRead.

3.4. Marco definitions are generally named as: Module + capitalized Noun separated with _ , e.g.

Component Coding Conventions 48


CoIDE Manual V2.0

xADC_EVENT_END_CONVERSION.

Coding notices
Try not to use the similar variable names such as ulTmp, ulTmp1.
All the variables need to be initialized.
To modify some bits of a register, you need to follow the standard process of "Reading - Modifying - Writing".

Note: Use bit-band if you can.

In functions, all return statements should be followed with parentheses, e.g. return (0);
All variables should use uinx_t type. Original data types like int are not recommended.
Tab is not allowed in code. Use spaces for indentation.
Extra spaces are NOT allowed at the end of the code.
All if, switch, and while statements, regardless of the length of the statements, must be followed with braces ( {} )
Use a space after #end, followed by comments of corresponding #if statement.
Generally a code line has about 80 characters, which can be increased to 120 characters according to actual
situations.
All type conversions need to be declared explicitly.
All Macro variables are in capital letters.
Use a space after #define, and then define the Macro's name, and write the definition in column 33. In special situation,
you can write the definitions in other column, but you need to make all the Macro code in the same file start from the
same column.
Peripherals are named as: Peripheral name + ID, e.g. DMA1, DMA2.
Registers are named as: Peripheral name+ _ + Register name, e.g. DMA_CCR1. The register name should be in
accordance with the Reference Manual.
Peripheral APIs are named as: Peripheral name + _ + API function, e.g. DMA_Enable, DMA_Disable.
To classify the peripheral APIs, the APIs should be written according to the orthogonal principle, to reduce the coupling
of different APIs.

e.g. DMA_IntEnable function should has 2 interface parameters (the peripheral base address and the interrupt flag).
Negative example: Functions over-coupled
extern void I2CDMAEnable(unsigned long ulBase, unsigned long ulDMALast);

goto statement can only be used in error handling section of the code
Bugs caused by priority errors: e.g. == has higher priority than & , so you need to add braces in the expression below:

while(xHWREG(DMA1_BASE + DMA_ISR) & DMA_ISR_TCIF7 == 0);


should be modified into
while((xHWREG(DMA1_BASE + DMA_ISR) & DMA_ISR_TCIF7) == 0);

Component Coding Conventions 49


CoIDE Manual V2.0

CoIDE component workflow

The local component library, Remote component library

The local component library

Repos
paulniu
sd.git
ahnniu
fatfs.git
lcd1602.git
usb.git
anonymous
stm32.git
...

The local component library, is a bunch of git bare warehouse,according to the user name,two layer catalogue of the
name of component to organize.

User name needs to be the only one, so is the component in each user name.

The local component library, no rights management,local user / computer users (no matter whether you log in coocox
or not )has the absolute right of control on the local component library in principle.

The source of the local component library: he is Remote warehouse's incomplete copy, or is downloaded from
Remote warehouse;component submitted to the local computer.

No local login / non network situation is regard as an anonymous user (anonymous)

Remote component library

As same as the local component library,it is also a bunch of git bare warehouse,according to the user name,two layer
catalogue of the name of component to organize.

The Remote library has a clear user authentication, and rights management system

+ permissions: can let people who need to access, but reading and writing Remote warehouse are unable to visit without a designat

Each user, has his own user space in the Remote end, and the absolute control rights in this space.

The Remote library, has the function of fork, equal to put a copy of someone else's warehouse in remote (no write
permission) in your space, and can continue to maintain, upgrade, such as paul/sd.git - > ahnniu/sd.git, ahnniu is
unable to operate paul's sd component but is able to operate ahnniu/sd.git.

Git's workflow

Centralized workflow

CoIDE Component Workflow 50


CoIDE Manual V2.0

Usually, centralized workflow uses single collaboration model. Warehouse's center server that stores code can accept
codes all the developers submitted. All developers are ordinary nodes, as the consumer of the central hub, the usual work
is synchronized date with the central warehouse.

Integrated manager workflow

Due to Git's allowance of using multiple remote warehouse, then developers can build their own public warehouse, write
data and share with others,at the same time, they also can extract others' updated date from their warehouse.Under this
situation, there is usually a blessed repository which represents the official. Developers thus cloned its own public
warehouse,and then pushed their own submission to ask upholder of official warehouse to pull, update, and merge it into
the main project. Upholder also has a clone warehouse in their local place, he can add in your public warehouse as a
remote warehouse, through testing without fault then merges it into the main branch, finally pushes it to the official
warehouse.

1. the project maintainer can push data to a public repository.


2. contributors clone the repository, revise or write new code.
3. contributors push data to their own public repository.
4. contributors e-mail the maintainers, request to pull the latest revision of its own.
5. maintainers in their own local integration manger repository, add the repository of contributors as remote repository,
then merge, update and test it.
6. maintainers push the merged update into the main repository.

This workflow uses most in GitHub web site. People can copy (i.e., clone fork) a project to their own lists, then let it be their
own public repository. Next, submit their own update to the repository, and everyone can see every time update of yours.
The main advantages is that you can continue to work at your own rhythm, without waiting for the maintainers to deal with
your submitted update. For the maintainers, they can also follow their own rhythm, and come to deal with or accept your
contribution at any time.

CoIDE Component Workflow 51


CoIDE Manual V2.0

Application of Git workflow in CooCox component


-Centralized workflow scenarios

+We are a team, we push code together

+ a component of my, joined a very positive contribution, I trust him, release authority, write for him directly

+ Wiki, everyone can write

-Integrated manager workflow

+ a component of others with some problems, does not update, I can do nothing but fork directly then,update and maintain

+ a component of people that the demand is not satisfied, needs to customized it as their own

+When want to contribute some of the code with no authority, this is pull request

component /IDE application norms

directory organization

The following is CoIDE application, a directory tissue sample of component class project

Application Project:

C:.
CoIDE Projects
Application Projects
SD_MSC
README.md
SD_MSC.proj

App
App.c
App2.c

Components
ahnniu
SDCard
stm32_cmsis
paulniu
FatFs
tom
SDFileSys
README.md

HelloWorld
HelloWorld2
SDFileSys_RW
SDFileSys_RW.c
SDFileSys_RW.proj

SourceCode
SDFileSys.c
SDFileSys.h

Test
Suit0
SDFileSys_Test0.c
SDFileSys_Test0.h

CoIDE Component Workflow 52


CoIDE Manual V2.0

Component Project

C:.
CoIDE Projects
Component Projects
SDFileSys
SDFileSys.Comp.Proj

Components
ahnniu
SDCard
stm32_cmsis
new
SDFileSys
README.md

Doc
Reference
image.jpg

HelloWorld
HelloWorld2
SDFileSys_RW
README.md
SDFileSys_RW.c
SDFileSys_RW.proj

SourceCode
SDFileSys.c
SDFileSys.h

Test
Suit0
SDFileSys_Test0.c
SDFileSys_Test0.h
| | SDFileSys.Comp.Proj

paulniu
FatFs

Several key points:

CoIDE sets the path of default storage project, divides into two categories:

component engineering:

new components also store under the Components directory, just user -- > New

HelloWorld is an independent project, the component file it used will be used multiplex by system

engineering, component and HelloWorld, all have README.md, exist under the corresponding root directory

testing norms

testing framework

testing framework transplants in different platform

using Git Ignore

Generated files of temporary, and so on, need to be neglected automatically

CoIDE Component Workflow 53


CoIDE Manual V2.0

Norm & IDE cooperation, automatic / semi-automatic

Only reach the semi automation or automation, can let norms be the fact, otherwise, it is difficult to ask everyone to follow
the paper.

component's life cycle

The reason to create component

When do you need to create a component? What is the influence of creating a component ? What is his results / the
output?

Motivation

+When you hope a reusable code can be turned into CoIDE components, and reused in other projects

results

+The results of creating a component is that there is other component in the list of components

Create a component engineering

-Input parameters

+ the component name

+ the path name, used to save the project in the file system

-Output parameters

+ in the specified path, create a git repository (not bare), and some necessary engineering documents

+ component engineering has norms(including directory components, and so on), IDE will be generated in accordance with the norms

Component engineering catalogue organization:

According to the directory norms above.

Create the entrance of component

Click from the menu and toolbar, the purpose is so direct

When browsering component library, one of components class will trigger creating

components writing

Writing may contain several parts:

add dependence

+ I am writing a high-level component, it needs to rely on some of the basements, or drive component

CoIDE Component Workflow 54


CoIDE Manual V2.0

* API calls

* through compiling, shakedown test

Add testing components automatically, and generate testing frame code

Subsequently gradual improvement


write your own reusable code

-Write their own documents, README.md

+ IDE generate README.md automatically

Special attention, when adding dependence:

add a dependence, is just adding, not modifying the dependent components, otherwise, a dependent object has
changed, the relationship of dependence is also not existing

+ IDE add dependent sequence

Clone, checkout (Master) components to the Components directory from the local component library,keep the user /
components'structure

add Src directory to the project compilation group

add the necessary include

Components' compilation, debugging

Components engineering, directly integrates automatic testing, through this process, the quality of components can be
ensured

Git Commit

When the project can be compiled, you can commit

Publish to the local

This process, is mainly for making the component place into the list of components, thus, the subsequent other projects,
can be imported to components through the way of importing directly.

The input parameters of Publish:

component's owner

+Currently login user name, if not login,you can prompt the user to login, otherwise anymous user will be used

Name of component

were specified, but the user can modify it


Component's Category

CoIDE Component Workflow 55


CoIDE Manual V2.0

peripheral Library

Driver

if it is Driver, entrance needs to be provided,

if it is Driver, entrance needs to be provided to choice what kind of Driver chip it support. Note: only an Driver
chip can be chose, Driver chip here is a general term and will be refined in the document of Driver chip

Middleware

From Publish to server

When Publish is completed to the local, there should have a further tips: whether to publish on the CooCox, several
benefits:

cloud storage, cloud synchronization

many people can collaborate

...

Add Hello World for components

entrance

In the components page, Hello World, users should specify the name of Hello World. Note: whether have the same name
with the previous Hello World or not

Process of IDE

when does Hardware platform specify?

Step 1 Clone component to a user directory, containing components that it dependents on, according to the directory
structure of Components

Step 2 Under the Hello World directory of component, create a project.

Step 3 README.md and a.C file automatically generate by the project are edited by the user

Step 4 compilation, debugging

Step 5 Git commit only when the compiling is passed can commit

Step 6 Push to the distal end (divide into local and server)

modification of component
The component's creation in the same group, just one point:

If the author of the component is the logged in user, then the position of this componen cloned is unchanged, copy remains:
(Componnets/tom/sd), if the author and the current user are not the same person, then clone it to the space of user who
currently logged in, it's similar to the fork, Publish (effects: create in the position of distal end )

CoIDE Component Workflow 56


CoIDE Manual V2.0

Modification of Hello World


To create, you should clone first, then open the Hello world project, finally, commit, push, and check whether the owner is
the current user

CoIDE Component Workflow 57


CoIDE Manual V2.0

1. The thought of component development


As an embedded developers (microcontroller direction), whether you have such confusion: we needed to use a chip for a
project before, because there was little information online, we had to read the data book to develop, it cost a lot of time and
energy to finish the driver of this chip. After a long time, this chip needed in our another project, when we found the driver of
this chip again, it turned out that we had to spend a lot of time to learn the the meaning of many parameters of this driven
and learn how to configure these parameters again, sometimes we even needed to rewrite the drive.

Had we ever thought whether the extra time we spent was necessary ? Can we spend less or even no time, to directly
found the drive we developed previously, and use it to our project ? Coocox can tell you that the answer is positive. In order
to help resolve the troubles above, coocox put forward the thinking of component development, and formulated a set of
corresponding norms. Only we follow this norm to develop drive, could we find that when we develop a driver, basically, we
can use it directly next time.

2. Arranging concerns of the new component


Although the method of component development has many advantages, but we can't avoid to worry: we had accumulated a
lot of function module of components, such as drive, algorithm before. If I follow this new thing to arrange, not only the
arranging process of component will cost a lot of time, but also it's losing more than gain if my previous projects function
unnormal after using the new component.

The new component norm here coocox proposed is fully considered that. If our previous file just used the source file and

header files, so the common reference relations are as follows:

The factors have been considered when Coocox is specified the component norms, the new component on its using
arranged according to the new component norms is downward compatible. That is, things in the application layer don't
need to modify. At the same time, the arranging of new component documentation does a lot to the component upgrade

Component-Development-Thought 58
CoIDE Manual V2.0

and maintenance.

3.The essence of component development thought


There are 4 core files in source file that defines the drive in our norms, they are:

Hw_component_driver.h

Component_driver.h

Component_driver.c

Component_driver_config.h.example (driver configuration files in good order are stored in template form)

Previously, the common drive is:

Component_driver.h

Component_driver.c

Why do we need four documents, what about the two more documents, following we will illustrate intensively the reasons
why we do it.

First,let's look at the important ideological of driven development summarized by CooCox.

3.1 The interface separation


This interface is not chip's "input interface"when we program, but the user's interface. When we finished a drive, we can
extract part of macro definitions and interface function that the users need to be concerned when they use, then, put them
in the following documents. component_driver.h

When in the practical use, separate the underlying implementation which is needlessis to care about, then, put it into the
following documents.

Hw_component_driver.h

Component_driver.c

Later, we just need to add component_driver.h when we use this component.

Component-Development-Thought 59
CoIDE Manual V2.0

3.2 The configuration separation


Now many chips are designed with many interfaces, such as ILI9325, which is the controller of a common driver TFT. It can
support 5 interfaces, they are :

I80-system 16-bit interface

I80-system 8-bit interface

Serial Peripheral interface (SPI)

I80-system 18-bit interface

I80-system 9-bit interface

And in a real project we generally only use one of the interface methods. We can put it's functions into reality, but in the
practical use, only need to configure it into one of working modes. In order to make it convenient when we use it next time.
When develop, we can extract all the useful configuration informations and put them underneath this file.

Component_driver_config.h.example

According to different circuit to select a different configuration template when you need to use it next time, then, you write a
new component_driver_config.h configuration file to join the project.

Component-Development-Thought 60
CoIDE Manual V2.0

Create a new component


How to create a new component? Below is an introduction of how to create a new project in CoIDE 2.0 Beta version, using
STM32F407 discovery board as an example.

Step1: Click "Browse in Repository".

Create Component Example 61


CoIDE Manual V2.0

Step2: Select the manufacturer, and here we select ST.

Step3: Select the chip, and here we select STM32F407VG.

Create Component Example 62


CoIDE Manual V2.0

Step4: Click the chip name and select "New Component


Project" to create a component project.

Create Component Example 63


CoIDE Manual V2.0

Step5: Input the name of the component project, configure the


location of the project, and click "Finish". Please note that the
project name is actually the name of the component, so we
recommend you to think a good component name for the
convenience of future use.

Create Component Example 64


CoIDE Manual V2.0

Step6: Add the library component of STM32F407. Find


component "STM32F407xx_cmsisboot", download it, and add
it to the project, CoIDE will generate a component project
template for us automatically.

Create Component Example 65


CoIDE Manual V2.0

Step7: Accomplish file Hw_Component.h.

Create Component Example 66


CoIDE Manual V2.0

Step8: Accomplish file Component_config.h.

Step9: Accomplish file Conponent.c.

Create Component Example 67


CoIDE Manual V2.0

Step10: Accomplish file Component.h.

Step11: Modify the name of auto-generated file helloword.c


and add it to the project, and then accomplish the example
code of the component.

Create Component Example 68


CoIDE Manual V2.0

Step12: Write the index document for the code component.

Step13: Generate component documents: click "Create a Doc"


button, then click "setting" button to view the component
document in CoIDE.

Create Component Example 69


CoIDE Manual V2.0

Step14: Click "Open Doc" button to view the code component


in web explorer.

Create Component Example 70


CoIDE Manual V2.0

Create a new component


How to create a new component? Below is an introduction of how to create a new project in CoIDE 2.0 Beta version, using
STM32F407 discovery board as an example.

Document filing of the component

the attainment of the necessary tools and component templates

needed software tool

To develop a high-quality component drive, the corresponding instruction documents is essential. Here we list all the
software tools that will be used.

1. Doxygen (to create a document automatically)


2. ant (to execute the batch file written by coocox)
3. COIDE (to compile the project )

the attainment of component templates

You can download component templates in our website website, or use the build-in component project templates from
updated CoIDE. Its very easy to create a component project, same way with creating a normal one. When you select an
IC, CoIDE will create a template for the user after he/she choose New Component Project.
Attention:the name of component project template is also the name of components.

For example,the name the engineer who create the component input is "ILI9325". Clock it, then we will see the documents
we need, what you should is too fulfill the documents.

Detailed Introduction 71
CoIDE Manual V2.0

Click the bottom"Create a Doc",then select "setting", you can check the basic parts of the component.

Detailed Introduction 72
CoIDE Manual V2.0

the documents organization of component template and the expecting effect

the documents organization of template

Among the catalogue of new project, we can find component project template made by CoIDE. Now, lets see the contents
of the template and the relations with catalogue.

Their functions are:

assets: they are used to store pictures or PDF quoted by file instruction.
doxygen: they are used to store configuration files and batching files that related to doxygen sorted by

Detailed Introduction 73
CoIDE Manual V2.0

coocox.
helloworld: they are used to store original file of the example project we wrote for components.
output: they are used to store website file formed by doxygen and procedure files formed by compiler.
test: they are used to store original file of the test project we wrote for components.
README md: this file is our introduction file in the component home page.

reach the expecting effect:

We can open index.html file under component_driver\output\doxygen\html in the example template to check sorted
document. Here are component pile homepage sorted by component_driver. We can check what we are interested in
through the right side navigation bar.

From this picture it is not hard to find that we divide component file into four parts:

API Reference: all the component API function.


Invoker Configuration:configuration information we need to focus on when using;
Enumeration:the enumeration we use when configuring, including Enum users care and Enum users dont
care.

concrete stops for creating a document and separating a interface.

Hw_Component.h write a file

We recommend following steps to carry out separation.

Detailed Introduction 74
CoIDE Manual V2.0

Original file and header file before revising are as shown in the picture below.

On the basic of the former file, we create two files : Hw_ILI9325.h and ILI9325_config.h

The driver we wrote


before almost has no register. The meaning of extracting register is that once we need to use one of the functions, we dont
need to check the register. We suggest that the registers should be divided into two types: the type we dont need to care
when using , another type we need to use when using.

We suggest you add annotation for each macro, the format is as follow:

#define ILI9325_GRAM_ADDR_SET_REG1 0x20 ///< GRAM horizontal Address


#define ILI9325_GRAM_ADDR_SET_REG2 0x21 ///< GRAM Vertical Address
#define ILI9325_GRAM_ACCESS_PORT_REG 0x22 ///< Write/Read Data to GRAM

We should emphasize that we use the doxygen annotation style in this place. So here comes a question ,shall we learn the
doxygen annotation style? Coocox tells us, from our experience, to forming pretty doxygen file, there are only four points
we should know.

The macro definition we mentioned is one of them. Easy, right? At the following introduction we will show you another three
points.

Write a Component_config.h.example

We mentioned that this file is used to save related templates of configuration information. But if this component has not
been finished, we suggest you adopt Component_config.h file format and let it be used in the compile of project.

The configuration we mentioned here means a microscopical definition of Macro in a functional way. Mostly ,we will put the
work model and interface information of device into this file. Here are some information about ILI9325.

write a Component.h

This file is a significant one. In order to keep the compatibility with the program we wrote before, we will define the macro
definition,which we may use in application program, in this place. We also have function declaration. We still suggest you
group the function declaration. If you have ever used the third party middleware, we suggest you divide them into three
groups: Downward transplantation related function, upward transplantation related function, the upper function when used
independently.

Below here is a brief introduction of how to group documents.

Detailed Introduction 75
CoIDE Manual V2.0

//*****************************************************************************
//
//! \addtogroup ILI9325_PORT_API Exported function
//! \brief Downward migration is a function of the need to care about the interface
//! @{
//
//*****************************************************************************
void LCD_Port_Configure(void);
void LCD_FSMC_Configure(void);
void ILI9325_WriteREG(u8 Reg, u16 Value);
u16 ILI9325_ReadREG(u8 Reg);
void ILI9325_WriteData(u16 RGB_Code);
u16 ILI9325_ReadData(void);
void Delay_ms(u32 nms);
//*****************************************************************************
//
//! @}
//
//*****************************************************************************

The code above is the second point we prepared for you to use doxygen document filing, that is grouping. Creating a new
group is similar with defining a variable quantity in C language.

"\addtogroup": key of grouping. It is similar to the key in C language, being recognized by doxygen.
"ILI9325_PORT_API": tag of grouping, it is similar to the name of variable quantity in C language.
"Exported function": name of grouping, it is similar to the value of variable quantity in C language.
"\brief": demonstrate parts of key. The instruction we add will be showed when formed a document.

The same with C language, we can only define it rather than valuing it . At this moment, doxygen will check all the original
files automatically and declare here. If they havent been named, doxygen will take group name as the value. And they will
be shown at the navigation bar.

writhe a Component.c document

This file is a difficult part. All our functions will be realized here, and we need to add instructions for each function.

//*****************************************************************************
//
//! \brief This function is used to value written in to register
//!
//! \param Reg : ILI9325 Register number
//! Value : The value will write to the register
//!
//! \ref ILI9325_Registers
//!
//! \note None
//!
//! \return None.
//
//*****************************************************************************
void ILI9325_WriteREG(u8 Reg, u16 Value)
{
#if(LCD_USE_DRIVE_MODE == LCD_FSMC_Mode)
{
LCD_REG = Reg;
LCD_RAM = Value;
}
#else
{
#if(LCD_USE_DATA_BUS_MODE == LCD_16_Bit_Mode)
{

}
#else
{

}
#endif

Detailed Introduction 76
CoIDE Manual V2.0

}
#endif
}

The function annotation we use here is the third point we conclude. It is recommended by coocox. One thing we need to
point out is that we explained "\ref ILI9325_Registers ". The advantage of using this is that the interlinkage can be
produced automatically to the related place when creating a document:

"\ref ":doxygen key, used to remind doxygen that you can create a linkage in this place.
"ILI9325_Registers": name of the group that need to be linked to.

With this ,we can easily get the information we want.

Until now, we almost finished documents filing. But we have only one layer for a group directory. Then what we should do is
adding an upper directory for each document. In this action,we must guarantee all the files are in the same group,
otherwise the directory would be in chaos. With the coocox standard for grouping upper layer ,the whole components have
been grouped as following:

ILI9325

API Reference
Exported API
...
Configuration
LCD Size
...
Enumeration
ILI9325 registers
...
Hello World
test example
...

write the component homepage

We put homepage to the root directory: README.md

We use the Markdown file at homepage. We use Markdown language to write this homepage.

When writing homepage documents, we should notice:use following statement to tell doxygen which directory should be
choose to put contents in.

@if (DOXYGEN_PROJECT)
@defgroup ILI9325_Component
@endif

Create an example project in COIDE

So far we almost finish creating a new component. Then lets talk about how to write example project and test project.

We will revise some files under the directory of helloworld. The revised directory files are as following:

helloworld

test_example
ILI9325_config.h ===================> example configure file

Detailed Introduction 77
CoIDE Manual V2.0

test_example.coproj ===================> test example project


test_example.c ===================> test example file
README.md ===================> This document is used for example simple instructions

When we write the example instruction document, we should change "@defgroup ILI9325_HelloWorld_HelloWorld_1
HelloWorld_1" to the real group tag and name.

@defgroup @defgroup ILI9325_HelloWorld_HelloWorld_1 HelloWorld_1

Otherwise, the instruction document can not add any component project.

produce and submit component documents.

use command line to produce a document and check it by browser

Open command line under doxygen and input "ant",then press the return button.

C:\Users\Sam\Desktop\New_component\ILI9325\doxygen>ant

Then, under the directory of C:\Users\Sam\Desktop\New_component\ILI9325\output\doxygen\html, we can find"index.html"


and check the component document we wrote.

Check it directly in COIDE

Click "create doc" button, then click "setting" button, we can check component document in COIDE.

Detailed Introduction 78
CoIDE Manual V2.0

how to maintain a component

how to maintain the component you write

Summary

When we finish the development of the components,we may only developed the functions we need because of time
limitation. However,once we find any bug that should be updated in the project, we must consider how to maintain the
component.

Then comes the introduction of the way we maintain components in the second 1,use the tool GIT; 2, use the COIDE This
two methods are different, if we retain the original project documents. When the program structure of components has a big
change and it related to things about compile, we suggest you use COIDE to maintain. If the things we modify have no
relation with compiling,like revising documents, we can use git to maintain component. If we couldnt find component
original file and it has been revised a lot, then we would use this two methods together.

use git to maintain a component

First, download component project document, find the specific component homepage under the option "component" in the
official website [http://www.coocox.org]

Use git to copy components in the pointed directory, notice to choose the address in http way.

Maintain-a-Component 79
CoIDE Manual V2.0

Revise component project documents: add a blank space in README.md. save after revise, we can see there is a little bit
change about the icon. That is the change of the file.

Upload component project file:

Maintain-a-Component 80
CoIDE Manual V2.0

Until now we finished a simple maintain about a component.

Maintain-a-Component 81
CoIDE Manual V2.0

use COIDE to maintain a component

Find the original project file, then click the button "setting "to enter submit interface. If you cant find it , please follow method
1 to download it in the official website.

Maintain-a-Component 82
CoIDE Manual V2.0

When you enter into the setting interface, it will show "component homepage", "code submit page" "component publish
page" automatically, once your mouse slides through the arrowhead. The homepage will be shown, when entering the page
of setting.

Maintain-a-Component 83
CoIDE Manual V2.0

Then click "code"to enter code submit page. First, choose files need to be submitted or click "file name" button to choose
all. After choosing files, click commit button, then the COIDE will show you a pop-up window to record modification
information. Input information and click sure, you can submit it.

Maintain-a-Component 84
CoIDE Manual V2.0

Check component you submit. Click "Repository", then choose "view component repository", you can find the component
you submit.

Maintain-a-Component 85
CoIDE Manual V2.0

**Notice: when you submit, you must guarantee the positions for logging in is in accordance with submitting, otherwise it
would not be capable to see.

Maintain-a-Component 86
CoIDE Manual V2.0

Log in

Maintain-a-Component 87
CoIDE Manual V2.0

Without logging in

After submitting codes, we can choose whether publish component or not. And we need to set basic information of
component before publishing.

Maintain-a-Component 88
CoIDE Manual V2.0

How to maintain others' component

It is almost the same with maintaining your own component. The only difference is that the start component is not the one
created by yourself, but the one downloaded from fork.

Maintain-a-Component 89
CoIDE Manual V2.0

Maintain-a-Component 90
CoIDE Manual V2.0

CoIDE Markdown Formatting Syntax

Comments: This is an introduction of the Markdown formatting syntax involved in CoIDE component document. CoIDE
Markdown editor supports all legal Markdown characters.

Note: If you are not familiar with the Markdown formatting Syntax, the materials below will be of some help.

1. Markdown Formatting Syntax Chinese edition | English edition


2. Markdown Online Editor
3. Markdown Quick Start Guide

FILE NAME
Doxygen will show the first first level header as the file name when parsing. To distinguish a file name from a header, we
recommend you to write your file name like this.

Your File Name


=========

HEADERS
Headers use 1-5 hash characters at the start of the line, corresponding to header levels 1-5.

For example:

# This is an H1
## This is an H2
### This is an H3
#### This is an H4
##### This is an H5

Note: Headers above level 5 are supported but not recommended.

will produce:

This is an H1

This is an H2

This is an H3

CoIDE Markdown Formatting Syntax 91


CoIDE Manual V2.0

This is an H4
This is an H5

EMPHASIS
To emphasize a text, wrap it with double asterisks.

For example:
**This is bold text**
*This is italic text*

will produce:

This is bold text


This is italic text

LINKS
[NAME](URL "TITLE")

NAME is the link text, URL is where you want the link to point, and TITLE is a prompt text for the link.

Note: TITLE is an optional item. When a cursor is stayed on the link, the TITLE text, if any, will prompt.

For example:
[CooCox](http://www.coocox.org/images/logo.jpg )
[CooCox](http://www.coocox.org/images/logo.jpg "CooCox")

will produce:

CooCox
CooCox

IMAGES
With the plain syntax of Doxygen and Markdown, you can easily insert images to your document. Below are detailed steps
of how to insert an image and some operation suggestions.

There are two styles of images: inline and reference.


Reference-style images are located on web server, while inline-style images are located locally or quoted by relative paths.
They use the same syntax as below:

![NAME](URL "TITLE")

Among which:

1. NAME is an image ID to help recognize the image


2. URL is the link to the image, which can be a relative or absolute path
3. TITLE is a prompt text for the image. When a cursor is stayed on the image, the TITLE text, if any, will prompt.

CoIDE Markdown Formatting Syntax 92


CoIDE Manual V2.0

Here comes an example of how to insert an image.

Insert a reference-style image with an URL:

Insert a reference-style image with an URL: http://www.coocox.org/images/logo.jpg

It looks like this:

![CooCox](http://www.coocox.org/images/logo.jpg )

and will produce:

Insert an inline-style image

Use the image name as the relative path directly.

Assume that there is already an image named CooCox_CooCox_Logo_0000 in the Component Doc directory, you can use
the local image directly like this:

![CooCox](CooCox_CooCox_Logo_0000.gif "CooCox")

Notes:

When inserting inline-style images, Doxygen will first copy the images from different sub-directories to the HTML output
directory, and the HTML will quote one level relative paths. When there are too many image resources, image name conflict
may happen. To avoid such kind of problem, we set a rule as below to name the images:

Author+Component name+Functionality+Index number

An index number is a decimal double figure specified by users, ranging from 0 to 99.

LISTS
Markdown supports ordered (numbered) and unordered (bulleted) lists.

Ordered lists use numbers followed by periods and list items with a space in between:
[Number][.][Space][List item]

Unordered lists use asterisks followed by a space and then list items: [*][Space][List item]

Note: A blank line should be used to separate lists in different paragraphs

For example:

An ordered list:

1. Item A

CoIDE Markdown Formatting Syntax 93


CoIDE Manual V2.0

2. Item B
3. Item C

A disordered list:

* Item A
* Item B
* Item C

A mix with ordered and disordered list:

1. Item A
* Item 1A
* Item 1B
* Item 1C
2. Item B
* Item 2A
* Item 2B
* Item 2C
3. Item C
* Item 3A
* Item 3B
* Item 3C

Will produce:

An ordered list:

1. Item A
2. Item B
3. Item C

A disordered list:

Item A
Item B
Item C

A mix with ordered and disordered list:

1. Item A
Item 1A
Item 1B
Item 1C
2. Item B
Item 2A
Item 2B
Item 2C
3. Item C
Item 3A
Item 3B
Item 3C

Note: In a nested list, each subsequent item should be indented by 4 spaces

BLOCKQUOTES
Put the > followed by a space before the first line of a paragraph.
Note: Blockquotes can be nested (i.e. a blockquote-in-a-blockquote), and can contain other Markdown elements, including
headers, lists, and code blocks

CoIDE Markdown Formatting Syntax 94


CoIDE Manual V2.0

For example:

> Email-style angle brackets


> are used for blockquotes.

> > And, they can be nested.

> #### Headers in blockquotes


>
> * You can quote a list.
> * Etc.

Will produce:

Email-style angle brackets


are used for blockquotes.

And, they can be nested.

Headers in blockquotes

You can quote a list.


Etc.

CODE BLOCKS
1. Insert at least 3 wave lines in a row in the line below the code block.
2. followed by the programming language type, {.programming language type}
3. followed by the code block
4. followed by a blank line and then the line of as many wave lines as the first line.

Cautions:

1. The number of wave lines in the first and last line should be the same
2. The programming language type is an optional item
3. All comments in the code block should be marked by "//" characteristic due to Doxygen syntax

If there are lots of comments for the code, you can consider putting them in a separate file, and quote the file in
Readme.md file.

For example:

~~~~~~~~~~{.c}
// Hello, this is a function
printf("Hello world");
~~~~~~~~~~

is used to insert the code printf ("Hello world") written in C and highlight it.

Will produce:

printf("Hello world");

CoIDE Markdown Formatting Syntax 95


CoIDE Manual V2.0

TEXT-FORMATTING
Note: It's used to display some mark or code in a text format

Wrap the mark or code with ', and wrap them with spaces.

For example:

Example: '<pre>' is a plain word

Will produce:

Example: <pre> is a plain word

HORIZONTAL RULES
Use three or more underscores, and wrap them with blank lines.

For example:
Press ENTER
---
Press ENTER

Will produce:

FORCED LINE FEED


Markdown syntax forces line feed via adding over two spaces at the end of line. But Doxygen will remove the spaces in
preprocessing stage, and turn Markdown tags to internal tags, and then complie them together with source code and
generate a document . Therefore, the standard Markdown way won't take effect, we can only force the line feed by the
following inelegent ways:

1. <br>
2. \n

Note: You can force line feed at any place you want, including within a table.

INLINE HTML
Markdown supports inline HTML, which allows you to create documents in any style you want. Here is one thing you need
to pay special attention to:

The only restrictions Markdown syntax has for inserting HTML are:

Block-level HTML elements e.g. <div> , <table> , <pre> , <p> , etc. must be separated from surrounding
content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces.

Good news is that there is no such restriction as above in Doxygen. You can even insert Markdown formatted content in

CoIDE Markdown Formatting Syntax 96


CoIDE Manual V2.0

HTML blocks.

Doxygen won't process corresponding block contents in below conditions:

1. Block wrapped by <pre>


2. Block wrapped by \verbatim
3. Code block

Note:Although Doxygen won't process content in code block , it will remove the indented spaces and make the code look
disordered. If you need to insert preformatted code in comment or Markdown, it's best to use the <pre> tag or directly
insert a code block.

INSERT A PREFORMATTED TEXT


You can insert a preformatted text to Markdown syntax by 4 spaces indentation.

REFERENCE
markdown tables generator

CoIDE Markdown Formatting Syntax 97


CoIDE Manual V2.0

Open source fans and official API libraries often use Doxygen to add code comments, which can generate documents out
of code. That means, users only need to maintain one code file, and the situation where documents don't match the code at
all can be effectively avoided.

The shortcoming of Doxygen is also very apparent though. The comment syntax is too complex to understand, thus is not
suitable for professional documents.

For many times, we wished to generate documents both good-looking and easy to understand for common people without
complex syntax. Is it possible?

Yes! We have Markdown! Users can focus on the content of the documents and don't need to worry about the form, which
the Markdown editor will take care of.

Here is an official description of Markdown:

PHILOSOPHY

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as
plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has
been influenced by several existing text-to-HTML filters including Setext, atx, Textile, reStructuredText, Grutatext,
and EtText the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have
been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like emphasis.
Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used
email.

Looks great! Right? In fact, many documents in github are written in Markdown syntax.

Since Markdown is so useful, it would be even better if it can be used in Doxygen, so we can not only comment the code
conveniently but also write a large professional document without code. We can also use other Markdown editor instead of
Doxygen.

Let's see how to use Markdown in Doxygen then.

Note: Please make sure you are familiar with basic operation and frequently-used syntax of Doxygen before you read
further. If you have never known anything about Doxygen before, please read the Getting started guide of Doxygen first.

THE FIRST TRY


Create a new folder named, let's say, Markdown , and create a new file named readme.md in the folder, with following
content:

Description {#mainpage}
=======================

## INTRODUCTION

This is the firt Markdown file we write.

## What to do next?

Let's learn in detail the Markdown syntax and the cautions in Doxygen introduction.

Use Markdown in Doxygen 98


CoIDE Manual V2.0

Configure the file with Doxygen settings by default, compile it in current directory, and open the corresponding HTML file, as
shown in the figure below:

This is how we create the first Markdown file in doxygen:

1. Create a new *.md file


2. Write text obedient to Markdown syntax in it
3. Compile and output an HTML file

It's easy, isn't it?

Note: Please make sure that the encoding format of the readme.md file is UTF-8

STANDARD MARKDOWN
Now that we know how to use Markdown in Doxygen, let's learn in detail the basic syntax of Markdown.

1. Headers
Markdown supports two types of headers, Setext-type and Atx-type.

Setext-type uses a line under the header containing only ='s (for level 1 header) or -'s (for level 2 header). For example:

Example 1

This is an H1
=============

This is an H2
-------------

Note that the exact amount of ='s or -'s is not important.

Atx-type use one to six #'s at the start of a line to make a header from level 1 to level 6. For example:

Use Markdown in Doxygen 99


CoIDE Manual V2.0

Example 2

# This is an H1

## This is an H2

###### This is an H6

You can end a header by any number of #'s, just to make it look good.

Example 3

# This is an H1 #

## This is an H2 ##

### This is an H3 ######

Will produce

Example 1

This is an H1

This is an H2
Example 2

This is an H1

This is an H2
This is an H6

Example 3

This is an H1

This is an H2

This is an H3

Cautions

1. For the exact amount of ='s or -'s under Setext-type headers, standard Markdown requires at least one, while Doxygen
requires at least two

2. Doxygen has a special requirement for level 1 headers, please refer to Markdown Extensions for the details.

Use Markdown in Doxygen 100


CoIDE Manual V2.0

2. Paragraphs and Line Breaks


A Markdown paragraph consists of one or more consecutive lines of text, wrapped by at least one blank line.

Note: A line containing nothing but spaces, tabs or carriage returns is considered blank.

There are two ways for a line break:

1) Insert <br/> in any place of the paragraph 2) Insert more than two spaces at the end of the line

For example

Original Markdown text

This is a paragraph

This is also a paragraph

This is a paragraph
This is a sentence among the paragraph

This is a paragraph line-broken via spaces


This is a paragraph line-broken via spaces
This is a paragraph line-broken via spaces
This is a paragraph line-broken via spaces

This is a paragraph with no line breaks,


This is a paragraph with no line breaks,
This is a paragraph with no line breaks,
This is a paragraph with no line breaks,
This is a paragraph with no line breaks

Output HTML

This is a paragraph

This is also a paragraph

This is a paragraph This is a sentence among the paragraph

This is a paragraph line-broken via spaces


This is a paragraph line-broken via spaces
This is a paragraph line-broken via spaces
This is a paragraph line-broken via spaces

This is a paragraph with no line breaks, This is a paragraph with no line breaks, This is a paragraph with no line breaks,
This is a paragraph with no line breaks, This is a paragraph with no line breaks

Cautions

1. Common paragraphs should not be indented by spaces or tabs, or it will be treated as "pre-formatted text" by compiler.

2. Doxygen doesn't support breaking a line by ending a line with two or more spaces. When you do need to break a line
in the middle of a paragraph, you can insert a <br/> .

3. Blockquotes

Use Markdown in Doxygen 101


CoIDE Manual V2.0

Markdown uses email-style > characters for blockquoting. If you're familiar with quoting passages of text in an email
message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a >
before every line:

Example 1
> A Thai satellite has detected some 300 objects in an area of
> the southern Indian Ocean being searched for missing Malaysia
> Airlines flight MH370.
>
> The image was taken by the Thaichote satellite on 24 March,
> a day after images from a French satellite purported to show
> 122 floating objects.
>
> Flight MH370 disappeared on 8 March with 239 people on board.
> No debris has been recovered from the ocean so far.

Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph:

Example 2
> A Thai satellite has detected some 300 objects in an area of
the southern Indian Ocean being searched for missing Malaysia
Airlines flight MH370.

> The image was taken by the Thaichote satellite on 24 March,


a day after images from a French satellite purported to show
122 floating objects.

> Flight MH370 disappeared on 8 March with 239 people on board.


No debris has been recovered from the ocean so far.

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of > :

Example 3
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.

Blockquotes can contain other Markdown elements, including headers, lists, and code blocks:

Example 4
> ## This is a header
>
> 1. This is first item
> 2. This is second item
>
> Here, Show code snippet for you:
> return shell_exec("echo $input | $markdown_script");

Will produce

Example 1

A Thai satellite has detected some 300 objects in an area of the southern Indian Ocean being searched for missing
Malaysia Airlines flight MH370.

The image was taken by the Thaichote satellite on 24 March, a day after images from a French satellite purported to
show 122 floating objects.

Use Markdown in Doxygen 102


CoIDE Manual V2.0

Flight MH370 disappeared on 8 March with 239 people on board. No debris has been recovered from the ocean so
far.

Example 2

A Thai satellite has detected some 300 objects in an area of the southern Indian Ocean being searched for missing
Malaysia Airlines flight MH370.

The image was taken by the Thaichote satellite on 24 March, a day after images from a French satellite purported to
show 122 floating objects.

Flight MH370 disappeared on 8 March with 239 people on board. No debris has been recovered from the ocean so
far.

Example 3

This is the first level of quoting.

This is nested blockquote.

Back to the first level.

Example 4

This is a header
1. This is first item
2. This is second item

Here, Show code snippet for you:

return shell_exec("echo $input | $markdown_script");

Cautions

1. Doxygen doesn't support omitting > as in Example 2, you need to make sure that each line of the blockquote is started
with a > .

2. In Doxygen, if you want to insert a Markdown code block in a blockquote, you need to guarantee at least one blank line
between the blocks. The code below won't take effect in Doxygen due to lack of blank lines:

> Here, Show code snippet for you:


> return shell_exec("echo $input | $markdown_script");

4. Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks (*), pluses (+), and hyphens (-) interchangeably as list markers:

Example 1

* Red

Use Markdown in Doxygen 103


CoIDE Manual V2.0

* Green
* Blue
OR
+ Red
+ Green
+ Blue
OR
- Red
- Green
- Blue

Ordered lists use numbers followed by periods:

Example 2

1. Bird
2. McHale
3. Parish

It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown
produces. The HTML Markdown produces from the above list is:

<ol>
<li>Bird</li>
<li>McHale</li>
<li>Parish</li>
</ol>

If you instead wrote the list in Markdown like this:

Example 3

1. Bird
1. McHale
1. Parish

or even:

Example 4

3. Bird
1. McHale
8. Parish

you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown
lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't
have to.

If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future,
Markdown may support starting ordered lists at an arbitrary number.

List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by
one or more spaces or a tab.

To make lists look nice, you can wrap items with hanging indents:

Use Markdown in Doxygen 104


CoIDE Manual V2.0

Example 5

* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.


Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.

But if you want to be lazy, you don't have to:

Example 6

* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.


Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.

If list items are separated by blank lines, Markdown will wrap the items in <p> tags in the HTML output. For example, this
input:

Example 7

* Bird
* Magic

will turn into:

<ul>
<li>Bird</li>
<li>Magic</li>
</ul>

But this:

Example 8

* Bird

* Magic

will turn into:

<ul>
<li><p>Bird</p></li>
<li><p>Magic</p></li>
</ul>

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4
spaces or one tab:

Example 9

1. This is a list item with two paragraphs. Lorem ipsum dolor


sit amet, consectetuer adipiscing elit. Aliquam hendrerit

Use Markdown in Doxygen 105


CoIDE Manual V2.0

mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet


vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.

2. Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

Example 10

* This is a list item with two paragraphs.

This is the second paragraph in the list item. You're


only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

* Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

Example 11

* A list item with a blockquote:

> This is a blockquote


> inside a list item.

To put a code block within a list item, the code block needs to be indented twice 8 spaces or two tabs:

Example 12

* A list item with a code block:

extern int main(void);

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the
period:

1986\. What a great season.

Will produce

Example 1

Red
Green
Blue

Example 2, 3, and 4

Use Markdown in Doxygen 106


CoIDE Manual V2.0

1. Bird
2. McHale
3. Parish

Example 5 and 6

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

Example 7

Bird
Magic

Example 8

Bird

Magic

Example 9

1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi
posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet
velit.

2. Suspendisse id sem consectetuer libero luctus adipiscing.

Example 11

A list item with a blockquote:

This is a blockquote inside a list item.

Example 12

A list item with a code block:

extern int main(void);

Cautions

In Doxygen, things are different:

Doxygen will treat two list items separated by a blank line as one list item
For an ordered list, Doxygen will handle it in strict accordance with an ascending order. Any same sequence or
descending order will start a new ordered list.
The actual numbers you use to mark the list have no effect on the HTML output Markdown produces.

5. CODE BLOCKS

Use Markdown in Doxygen 107


CoIDE Manual V2.0

Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal
paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both <pre> and <code>
tags.

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example,
given this input:

This is a normal paragraph:

This is a code block.

Markdown will generate:

<p>This is a normal paragraph:</p>

<pre><code>This is a code block.


</code></pre>

One level of indentation 4 spaces or 1 tab is removed from each line of the code block. For example, this:

Here is an example of AppleScript:

tell application "Foo"


beep
end tell

will turn into:

<p>Here is an example of AppleScript:</p>

<pre><code>tell application "Foo"


beep
end tell
</code></pre>

A code block continues until it reaches a line that is not indented (or the end of the article).

Within a code block, ampersands ( & ) and angle brackets ( < and > ) are automatically converted into HTML entities. This
makes it very easy to include example HTML source code using Markdown just paste it and indent it, and Markdown will
handle the hassle of encoding the ampersands and angle brackets. For example, this:

<div class="footer">
&copy; 2004 Foo Corporation
</div>

will turn into:

<pre><code>&lt;div class="footer"&gt;
&amp;copy; 2004 Foo Corporation
&lt;/div&gt;
</code></pre>

Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block.

Use Markdown in Doxygen 108


CoIDE Manual V2.0

This means it's also easy to use Markdown to write about Markdown's own syntax.

Cautions

"To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab."

Note 2 points:

1. Take care when using tabs

Doxygen and some Markdown editor will replace a tab with a certain number of spaces before processing it, at that time
only spaces stand for an indentation.

In this case, it's really important how many spaces a tab equals to (TAB = N Space). When N equals 4, everything is
normal, and the result matches the expectation; When N is more than 4, the editor will remove 4 spaces, and handle the
rest spaces as part of the code; When N is less than 4, the editor will remove all the spaces first and handle the rest part as
common text.

Note: You can set the number of spaces in a tab by modifying the value of TAB_SIZE in Doxygen project configuration file.

# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.

TAB_SIZE = 4

Suggestion: Don't use TAB in your document, and set a tab as 4 spaces in your editor, in this way many potential
problems can be avoided.

2. What is the indentation of 4 spaces relative to?

The standard Markdown syntax only states that a code block should be indented by 4 spaces, but does not say what the
indentation is relative to. It's relative to the leftmost row of the document by default. We call the indentation relative to the
leftmost row, in spaces, as absolute offset.

Generally the threshold value of absolute offset is 4. If the absolute offset of a paragraph is no more than 4, it will be
handled as a common paragragh. When the absolute offset is over 8, check first if the paragraph is in a list. If yes, treat the
part as a code block in a list, if not, treat the part as a common code block.

We can see that the absolute offset plays a very important role in standard Markdown editors.

Is it the same in Doxygen? No. Because Doxygen handles not only pure Markdown text, but also some Markdown text
inserted in code comment, and comment can has any indentation, which can lead to a problem if there is no special
treatment. Therefore, Doxygen uses relative offset instead of absolute offset, re:

The offset of current paragraph is relative to last paragraph

Note: The relative offset in a list does not include the list symbols.

Generally the Doxygen method won't cause any mistake to the text written in Markdown, unless you write it as below:

text indented by 0 space relative to the last paragraph; indented by 0 space relative to the leftmost row.

text indented by 1 space relative to the last paragraph; indented by 1 space relative to the leftmost row.

text indented by 1 space relative to the last paragraph; indented by 2 spaces relative to the leftmost row.

Use Markdown in Doxygen 109


CoIDE Manual V2.0

code indented by 2 spaces relative to the last paragraph; indented by 4 spaces relative to the leftmost row.

In this condition, Markdown editors will treat the code line as code while Doxygen won't, because there is only 2 spaces'
relative indentation.

6. HORIZONTAL RULES

You can produce a horizontal rule tag by placing three or more hyphens, asterisks, or underscores on a line by
themselves.

Example 1

***

---
___

Spaces are allowed to insert between hyphens or asterisks like this:

Example 2

* * *
- - -

Will produce

Example 1:Below are 3 horizontal rule tags.

Example 2:Below are 2 horizontal rule tags.

[Caution]

1. Standard Markdown Editors support all above standards, but Doxygen requires a horizontal rule tag to be in a single line
wrapped by blank lines. Other editors also have this requirement.

Therefore, we recommend you to use the horizontal rule tag in a single line and wrap it with blank lines, like this:

This is a paragraph

***

This is also a paragraph, followed by 3 horizontal rule tags

---

***

___

instead of this (please pay special attention to the last 3 horizontal rule tags):

Use Markdown in Doxygen 110


CoIDE Manual V2.0

This is a paragraph

***

This is also a paragraph, followed by 3 horizontal rule tags

---
***
___

2. For Doxygen, horizontal rule tags will only work in Markdown files. They won't work in code comments.

For example:

/** A list:
* * item1
* *******
* * item2
*/

There will be no horizontal rule tag between item1 and item2

7. LINKS

Markdown supports two style of links: inline and reference.

In both styles, the link text is delimited by [square brackets].

To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the
parentheses, put the URL where you want the link to point, along with an optional title for the link, surrounded in quotes. For
example:

Example 1

This is [an example](http://example.com/ "Title") inline link.

[This link](http://example.net/) has no title attribute.

Will produce:

<p>This is <a href="http://example.com/" title="Title">


an example</a> inline link.</p>

<p><a href="http://example.net/">This link</a> has no


title attribute.</p>

If you're referring to a local resource on the same server, you can use relative paths:

See my [About](/about/) page for details.

Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the
link:

Example 2

Use Markdown in Doxygen 111


CoIDE Manual V2.0

This is [an example][id] reference-style link.

You can optionally use a space to separate the sets of brackets:

This is [an example] [id] reference-style link.

Then, anywhere in the document, you define your link label like this, on a line by itself:

[id]: http://example.com/ "Optional Title Here"

That is:

Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces);
followed by a colon;
followed by one or more spaces (or tabs);
followed by the URL for the link;
optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses.

The following three link definitions are equivalent:

[foo]: http://example.com/ "Optional Title Here"


[foo]: http://example.com/ 'Optional Title Here'
[foo]: http://example.com/ (Optional Title Here)

NOTE: There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles.

The link URL may, optionally, be surrounded by angle brackets:

[id]: <http://example.com/> "Optional Title Here"

You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with
longer URLs:

[id]: http://example.com/longish/path/to/resource/here
"Optional Title Here"

Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the
HTML output.

Link definition names may consist of letters, numbers, spaces, and punctuation but they are not case sensitive. E.g.
these two links:

[link text][a]
[link text][A]

are equivalent.

The implicit link name shortcut allows you to omit the name of the link, in which case the link text itself is used as the name.

Use Markdown in Doxygen 112


CoIDE Manual V2.0

Just use an empty set of square brackets e.g., to link the word "Google" to the google.com web site, you could simply
write:

[Google][]

And then define the link:

[Google]: http://google.com/

Because link names may contain spaces, this shortcut even works for multiple words in the link text:

Visit [Daring Fireball][] for more information.

And then define the link:

[Daring Fireball]: http://daringfireball.net/

Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph
in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes.

Here's an example of reference links in action:

I get 10 times more traffic from [Google] [1] than from


[Yahoo] [2] or [MSN] [3].

[1]: http://google.com/ "Google"


[2]: http://search.yahoo.com/ "Yahoo Search"
[3]: http://search.msn.com/ "MSN Search"

Using the implicit link name shortcut, you could instead write:

I get 10 times more traffic from [Google][] than from


[Yahoo][] or [MSN][].

[google]: http://google.com/ "Google"


[yahoo]: http://search.yahoo.com/ "Yahoo Search"
[msn]: http://search.msn.com/ "MSN Search"

Both of the above examples Will produce the following HTML output:

<p>I get 10 times more traffic from <a href="http://google.com/"


title="Google">Google</a> than from
<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>

For comparison, here is the same paragraph written using Markdown's inline link style:

I get 10 times more traffic from [Google](http://google.com/ "Google")


than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
[MSN](http://search.msn.com/ "MSN Search").

Use Markdown in Doxygen 113


CoIDE Manual V2.0

The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your
document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is
only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML,
there's more markup than there is text.

With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a
browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting
the narrative flow of your prose.

[The examples Will produce]

Example 1

This is an example inline link.

This link has no title attribute.

Example 2

This is an example reference-style link.

[Caution]

1. Reference-style links can be used to create links in a document, like this:

* [Overview](#overview)
* [Installation](#installation)

<h2 id="overview">Overview</h2>
<h2 id="philosophy">Installation</h2>

2. The URL must contain http:// forehead in the link, or the link redirection will fail.

3. Some Markdown editors doesn't support a title enclosed in single quotes, please use enclose the title with double
quotes.

8. EMPHASIS

Markdown treats asterisks ( * ) and underscores ( _ ) as indicators of emphasis. Text wrapped with one * or _ will be
wrapped with an HTML <em> tag; double * 's or _ 's will be wrapped with an HTML <strong> tag. E.g., this input:

Example 1

*single asterisks*

_single underscores_

**double asterisks**

__double underscores__

Will produce:

<em>single asterisks</em>

Use Markdown in Doxygen 114


CoIDE Manual V2.0

<em>single underscores</em>

<strong>double asterisks</strong>

<strong>double underscores</strong>

You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an
emphasis span.

Emphasis can be used in the middle of a word:

Example 2

un*frigging*believable

But if you surround an * or _ with spaces, it'll be treated as a literal asterisk or underscore.

Example 3

This is a single asterisk * .

To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you
can backslash escape it:

Example 4

\*this text is surrounded by literal asterisks\*

[The examples Will produce]

Example 1

single asterisks

single underscores

double asterisks

double underscores

Example 2

unfriggingbelievable

Example 3

This is a single asterisk * .

Example 4

*this text is surrounded by literal asterisks*

Cautions

Use Markdown in Doxygen 115


CoIDE Manual V2.0

1. Some editors may not support the Markdown syntax in Example 2

Example 2

un*frigging*believable

To use * for emphasis, please ensure a space before the opening asterisk and after the closing asterisk, like this:

Example 2 revised version

un *frigging* believable

un *frigging believable* Flag

un **frigging** believable

un **frigging believable** Flag

To emphasize a word within a word, please directly use <em> or <strong> , like this:

un<em>frigging</em>believable

un<strong>frigging</strong>believable

2. Doxygen can't use * to emphasize Chinese characters, please directly use <em> or <strong> instead.

3. Some Markdown editors allow line breaks in text, as shown below:

Some Markdown editors allow line breaks

**Line1
Line2
Line3**

While many compilers don't. In the meantime, almost all editors don't support line breaks.

Asterisks can't be used to emphasize multiple paragraphs.

**Line1

Line2

Line3**

4. In Doxygen, headers are emphasized by default, no extra * 's are needed.

5. In Doxygen, only text enclosed in the * 's which meet following conditions would be processed as emphasis:

Opening asterisk:

Followed by: a letter or a number


Follows: a space, a blank line, or any of the characters < { ( [ , : ;

Closing asterisk:

Followed by: neither a letter nor a number

Use Markdown in Doxygen 116


CoIDE Manual V2.0

Follows: neither a space, a blank line, nor any of the characters ( { [ < = + - \ @

6. In Doxygen, * and _ only work within a normal paragraph.

9. CODE

To indicate a span of code, wrap it with backtick quotes (`).

Note: The backtick character is located on left side of the number 1 and on top of Tab on the keyboard. Don't mix it up with
the single quote.

For example:

Example 1

Use the `printf()` function.

Will produce:

<p>Use the <code>printf()</code> function.</p>

To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing
delimiters:

Example 2

``There is a literal backtick (`) here.``

which Will produce this:

<p><code>There is a literal backtick (`) here.</code></p>

The backtick delimiters surrounding a code span may include spaces one after the opening, one before the closing. This
allows you to place literal backtick characters at the beginning or end of a code span:

Example 3

A single backtick in a code span: `` ` ``

A backtick-delimited string in a code span: `` `foo` ``

Will produce:

<p>A single backtick in a code span: <code>`</code></p>

<p>A backtick-delimited string in a code span: <code>`foo`</code></p>

With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to
include example HTML tags. Markdown will turn this:

Use Markdown in Doxygen 117


CoIDE Manual V2.0

Example 4

Please don't use any `<pre>` tags.

into:

<p>Please don't use any <code>&lt;pre&gt;</code> tags.</p>

[The examples Will produce]

Example 1

Use the printf() function.

Example 2

There is a literal backtick (`) here.

Example 3

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

Example 4

Please don't use any <pre> tags.

Cautions

1. Code span is suitable for inserting a small amount of code.

2. Editors provide extra processing methods to insert a big amount of code. Below are some common methods:

A. Insert 3 literal backtick characters

```

Here is your code

```

Note: GFM (GitHub Flavored Markdown) adopts this method. And you can use some indicators after ``` to highlight the
code.

B. Insert more than 3 wave lines

~~~

Here is your code

~~~

3. Doxygen has special commends for code blocks, please refer to Markdown Extensions for the details.

Use Markdown in Doxygen 118


CoIDE Manual V2.0

4. Doxygen can't handle code which includes single quotes like this:

A `cool' word in a `nice' sentence.

Please use code block instead.

10. IMAGES

Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and
reference.

Inline image syntax looks like this:

![Alt text](/path/to/img.jpg)

![Alt text](/path/to/img.jpg "Optional title")

That is:

An exclamation mark: ! ;
followed by a set of square brackets, containing the alt attribute text for the image;
followed by a set of parentheses, containing the URL or path to the image, and an optional title attribute enclosed in
double or single quotes.

Note: The path can be a relative path or an absolute URL

Reference-style image syntax looks like this:

![Alt text][id]

Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link
references:

[id]: url/to/image "Optional title attribute"

For example

Example 1:Image from website

![CooCox Logo](http://www.coocox.org/images/logo.jpg "CooCox Logo")

Will produce:

Example 2:Local image

Use Markdown in Doxygen 119


CoIDE Manual V2.0

![Beautiful Girl](/images/CH7/LocalPic.jpg "Beautiful Girl")

Will produce

Cautions

1. Markdown only provide image link mechanism rather than image management. In Doxygen, if the document includes
any link to the local image, you must copy the image to HTML output folder manually to make the image show normally.

2. Please make sure the characters, alt text, and URL are in the same line, otherwise it won't be recognized by Markdown
analyzer.

Use Markdown in Doxygen 120


CoIDE Manual V2.0

11. AUTOMATIC LINKS

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL
or email address with angle brackets.

The code below

Example 1

<http://www.google.com.cn>

<xxx@gmail.com>

Will produce HTML like this:

<p><a href="http://www.google.com">http://www.google.com</a></p>

<p><a href="mailto:xxx@gmail.com">xxx@gmail.com</a></p>

[The example Will produce]

Example 1

http://www.google.com.cn

xxx@gmail.com

Cautions

The website must be complete and valid, including http:// or https:// . The code below won't generate correct links:

<www.google.com.cn>
<google.com.cn>

12. INLINE HTML

If you are familiar with HTML, simply use HTML itself. There's no need to preface it or delimit it to indicate that you're
switching from Markdown to HTML; you just use the tags.

The only restrictions are that block-level HTML elements e.g. <div> , <table> , <pre> , <p> , etc. must be separated
from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces.
Markdown is smart enough not to add extra (unwanted) <p> tags around HTML block-level tags.

For example, to add an HTML table to a Markdown article:

Example 1:Add an HTML table to a Markdown article

This is a regular paragraph.

<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>

Use Markdown in Doxygen 121


CoIDE Manual V2.0

</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
</tr>
</table>

This is another regular paragraph.

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style
*emphasis* inside an HTML block.

Span-level HTML tags e.g. <span> , <cite> , or <del> can be used anywhere in a Markdown paragraph, list item, or
header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML <a> or
<img> tags instead of Markdown's link or image syntax, go right ahead.

Example 2:Color a word with HTML to emphasize it

This is <strong>in bold</strong>This is <font color="red">in red</font>

Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.

[The examples Will produce]

Example 1:Add an HTML table to a Markdown article

This is a regular paragraph.

1 2 3

4 5 6

7 8 9

This is a regular paragraph.

Example 2:Color a word with HTML to emphasize it

This is in boldThis is in red

Cautions

1. Doxygen doesn't have such limitation,

The only restrictions are that block-level HTML elements e.g. <div> , <table> , <pre> , <p> , etc. must be
separated from surrounding content by blank lines, and the start and end tags of the block should not be indented
with tabs or spaces.

you can place the block-level HTML elements as you like.

2. Doxygen doesn't translate the content within <code> and </code> , but eliminate the lead spaces of the code and make
the typesetting a mess. If you want to insert formatted code in comments or Markdown, use <pre>``</pre> tags or indent
the code with 4 spaces.

Use Markdown in Doxygen 122


CoIDE Manual V2.0

3. Doxygen only support a few common tags, it processes JavaScript code or other tags like button as pure text, and
escape all special JavaScript characters, therefore invalidate the inserted code.

For example, if we insert a button in Markdown:

<button type="input" title="Test Button">Button</button>

Doxygen will translate it into:

&lt;button type="input" title="Test Button"&gt;Button&lt;/button&gt;

To reach what we expect, we need to add JavaScript to avoid escape. Replace the code with this:

<script type="text/javascript" src="jquery.js"></script>

<script>
$(document).ready(function(e) {
$('p').each(function(index, element) {
var text = $(this).html();
text = text.replace('$BEGIN$','');
text = text.replace('$END$','');
text = text.replace('&lt;','<');
text = text.replace('&gt;','>');
$(this).html(text);
});
});
</script>

We need to rewrite the HTML code like this for sure:

$BEGIN$
<button type="input" title="Test Button">Button</button>
$END$

Doxygen--Markdown Extensions

Tables

Doxygen supports simple tables in PHP style, like this:

First Header | Second Header


------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell

The seperator lines of the table consist of - and | , used to separate the columns and rows. The first line is called a
header line. Each table has only one header line, and each other line is a separate row, in which different items are
separated by | . The table above Will produce:

Use Markdown in Doxygen 123


CoIDE Manual V2.0

Here is a bit more complex example:

First Header | Second Header | Third Header


------------- | ------------- | ------------
Content Cell | Content Cell | Content Cell
Content Cell | Content Cell | Content Cell
Content Cell | Content Cell | Content Cell

Will produce:

To make it look good, you can add | before the first and after the last column, and the output will stay the same:

| First Header | Second Header | Third Header |


| ------------- | ------------- | ------------ |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |

Column alignment can be controlled via one or two colons at the header separator line:

Align left Align center Align right

| First Header | Second Header | Third Header |


| :------------ | :------------:| -----------: |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |

It will output this:

Use Markdown in Doxygen 124


CoIDE Manual V2.0

The syntax is easy to understand and the explanation will be saved.

Cautions

1: Doxygen only supports simple tables. If you want to use complex tables, do as follows:

Create and edit a table in word, transfer it into HTML code, and copy the code to Markdown article.

or other methods.

Fenced Code Blocks

Besides using backtick quotes to insert code, common Markdown editors also provide extra commands to support inserting
a whole code block, and a common command is like this:

```

Here Is Your Code

```

Differently, Doxygen supports code blocks by surrounding the code with a pair of "fence lines". Such a line consists of 3 or
more tilde ( ~ ) characters on a line. Here is an example:

Example 1

~~~

Here Is Your Code

~~~

Note that the end of the block should have the same number of tildes. For example, the command below is wrong:

~~~ There are tildes

You Code is here

~~~~~~ There are 5 tildes

Meanwhile, you can also make the code block appear with syntax highlighting. For example:

Use Markdown in Doxygen 125


CoIDE Manual V2.0

~~~{.programming language}

You Code is here

~~~

Or

~~~programming language

You Code is here

~~~

The code below is used to highlight a code block in C:

Example 2

~~~{.c}

int func(int a,int b)


{
return a*b;
}

~~~

For programming language supported by Doxygen, please refer here

[The examples Will produce]

Example 1: A normal code block

Example 2: Highlight the C code

Header Id Attributes

Standard Markdown has no support for labeling headers, which is a problem if you want to link to a section.

Generally, we use HTML syntax to create an ID for the header, like this:

* [Overview](#overview)
* [Installation](#installation)

<h1 id="overview">Overview</h1>
<h2 id="install">Installation</h2>

But it isn't obedient to Markdown philosophy, so PHP Markdown Extra allows you to label a header by adding the following
to the header:

Overview {#overview}

Use Markdown in Doxygen 126


CoIDE Manual V2.0

========

## Installation ## {#installation}

Having the header ID, we can link the header to corresponding section in the artible, like this:

Example 1

* [Overview](#overview)
* [Installation](#installation)

Overview {#overview}
========

## Installation ## {#install}

Doxygen supports a special link marker [TOC] which can be placed in a page to produce a table of contents at the start of
the page, listing all sections. For details, please refer to next section.

[The example Will produce]

Cautions

1. Note the header ID only works for the headers of level 1 to 4.

2. When using # , the header must be surrounded by the pound signs, e.g. the following command is wrong:

## Installation {#installation}

3. To link to a section in the same article or comment block you can use [Link text](#labelid) . To link to a section in
general, use # instead of @ like this:

[Link text](@labelid)

4. To put a Markdown article on the main page of the output file, please set the configuration of the first header in the
Markdown article as index or mainpage .

Table of Contents

Doxygen supports a special link marker [TOC] which can be placed in a page to produce a table of contents at the start of
the page, listing all sections. For example:

Example 1

* [Overview](#overview)
* [Installation](#installation)

Use Markdown in Doxygen 127


CoIDE Manual V2.0

Overview {#overview}
========

## Installation ## {#installation}

Will produce

Example 1: Create a catalog

Cautions

0. [TOC] must be put at the start of the article.

Below is a wrong usage:

Overview {#Overview}
========

## Installation ## {#Installation}

[TOC]

1. Markdown headers must have ID attributes, otherwise Doxygen doesn't generate a catalog.

Below is a wrong usage:

[TOC]

Overview
========

## Installation ##

Link to external Markdown file


Many times, we need to link to another Markdown file in a Markdown file. There are 2 ways:

1Link to the Markdown file name directly


2Link to the Markdown file name ID

To be specific:

Link to the Markdown file name directly

Doxygen allows using a complete Markdown path (file name included) in a normal link to link to external Markdown file, like
this:

Use Markdown in Doxygen 128


CoIDE Manual V2.0

[Link text](The complete path to the Markdown file)

The complete path here can be a relative path or a absolute path.

Note: If the file and the file to be linked are in the same directory, use the file name directly, like this:

[This ](The complete path to the Markdown file)

Link to the Markdown file name ID

By default, Doxygen uses the linked Markdown file name as the name shown in the document. Meanwhile, Doxygen allows
users to define the shown name of the file:

This is shown name of the file.


==========================

Interact with the code in Markdown


In Markdown, we can also interact with the code. For example, if we call a function, the page will automatically jump to the
document page of the function when clicking on it.

Here is how to do it:

\ref The function to be called

For example, if we want to call function SystemInit , we can write like this:

\ref SystemInit

Ending
That's all for how to use Markdown in Doxygen. There are a lot of traps, and special attention is needed to the cautions.

Many materials were referred to when writing this document. Many thanks! If you find any mistake or any paragraph hard to
understand, please let us know, we will fix it any soon as possible.

References
1. Doxygen Manual main page
2. Doxygen Manual main page--Markdown support
3. Markdown standard syntax--Chinese version
4. Markdown standard syntax--English version
5. Markdown standard syntax--Quickstart Chinese version

Common Markdown editors


Use Markdown in Doxygen 129
CoIDE Manual V2.0

Windows platform
MarkdownPad
MarkPad
Linux platform
ReText
Mac platform
Mou
Online editors
stackedit.io
Markable.in
Dillinger.io
Browser plugin
MaDe (Chrome)
Advanced application
Sublime Text 2
MarkdownEditing
SublineMarkdown Manual

Use Markdown in Doxygen 130


CoIDE Manual V2.0

Compiler Setting
Before you use CoIDE to start your project, you need to configure the GCC compiler and debugger at first.

CooCox suggest you to choose ARM GCC as the compiler since it is from ARM official. If you want to know more details
about ARM GCC, please click here. In additional, you can also choose the other GCC compiler such as CodeSourcery
GCC.

ARM GCC 4.9 Features:

All GCC 4.9 features, plus latest mainline features


Cortex-M7 support
Small multiply support with options:
-mcpu=cortex-m1.small-multiply
-mcpu=cortex-m0.small-multiply
-mcpu=cortex-m0plus.small-multiply
Define aeabi_memcpy and aeabi_memcpy4 routines in newlib.
Thumb-1 library optimizations.
Additional code size optimizations
Add gdb python build (arm-none-eabi-gdb-py).
Object file without attribute section can be linked with any others.

Learn more ARM GCC 4.9 function

Download: GCC ARM Embedded

Note:

As CoIDE support different GCC compiler, you need to pay attention to the following point when you switch between the
compilers:

The different compilers have different C libraries, for example: ARM GCC have a base C Library and Semihosting
Library, Retarget Library. However, Code Sourcery GCC only have the base C Library. See: Project Configuration
Different GCC tools use different link.ld when they compile the same project. When you click the Build button, CoIDE
will generate the link.ld file according to the project configuration before the build start.
If you want to compile the project that created under other GCC tools in CoIDE, you may need to select that tool as the
GCC toolchain, and don't forget to select the .ld files , you need to delete the Build.xml, link.ld, memory.ld. Then
check a component and reconfigure the project after setting the GCC.

Then you need to do the following operations.

After launching CooCox CoIDE, Click "Select Toolchain path" under the Project menu.

Click the browse button, select the folder which contains the arm-none-eabi-gcc.exe and the other gcc execute files.

For example, select the bin folder.

Click OK button to save the setting.

After set the GCC Toolchain, you can use the CoIDE to create a project and try the other function. See: CoIDE QuickStart.

Select GCC path 131


CoIDE Manual V2.0

If you want to compile the project that created under other GCC tools in CoIDE, you may need to select that tool as the
GCC toolchain, and don't forget to select the .ld files , you need to delete the Build.xml, link.ld, memory.ld. Then
check a component and reconfigure the project after setting the GCC.

Compile Output 132

S-ar putea să vă placă și