3 This document is automatically processed by Doxygen (http://www.doxygen.org/).
4 Don't remove special formatting tags.
5 This section won't be processed unless enabled.
7 See STATUS for further information and tips about Doxygen tags.
9 \page oop Object Oriented Programming
11 BeRTOS uses object oriented programming concepts for the base interfaces.
12 If used in the right way, OOP elegantly solves a broad range of problems
13 linked with the creation of common and reusable interfaces that allow
14 you to save development time and precious memory space.
15 Have a look at <a href="http://www.bertos.org/use/tutorial-front-page/drivers-kfile-interface/">
16 KFile tutorial</a> on BeRTOS web site for
17 a more complete introduction to object oriented programming.
20 Object oriented programming in C requires a context struct and a few interface
21 functions that operate on that context.
22 The base class is implemented with a struct with a few function pointers
23 that point to the implementation specific for the context.
25 Inherited classes are created by defining a struct with the following
27 \li a base class member
28 \li context specific members
30 Then you can call interface functions by simply using the base class member
31 as the context of the function.
32 Note that base classes usually don't have an init function, because they are
33 not meant to be used directly and it wouldn't make sense anyway, since they
34 provide no functionality, only the interface.
35 The usage pattern requires you to declare a context (eg. Flash), initialize
36 the context with a specific function call (eg. flash_init()) then use the
37 interface funtions to access the context.
39 To make an example, in BeRTOS the Serial driver is a derived class of the
41 The KFile interface defines a few interface functions, which can be used to
42 extract data from the Serial context.
44 // declare the serial context
51 // initialize the serial driver
52 ser_init(&ser, SER_UART0);
53 ser_setbaudrate(115200);
54 // now access using the interface functions
56 kfile_read(&ser.fd, buf, 20);
58 kfile_printf(&ser.fd, "Writing to serial using KFile interface...\n");
69 \page short_introduction A 5 minute introduction to BeRTOS
71 \section installation Installing BeRTOS on your system
73 What do you need when developing an embedded project with BeRTOS?
74 \li a toolchain for your CPU
75 \li BeRTOS source code :)
76 \li supporting binaries for BeRTOS build system
77 \li supporting tools for BeRTOS Wizard
79 See the <a href="http://www.bertos.org/use/tutorial-front-page/installation-instructions/">
80 installation instructions page</a> online for help on installing BeRTOS on your system.
82 Strictly speaking, BeRTOS doesn't need to be 'installed', you can just
83 take .c files and compile them in your project.
85 However, BeRTOS is a complex system with many dependencies between modules.
86 It's not easy to track the dependencies for each module, so we have developed
87 a set of tools to make dependency tracking automatic.
89 Contact the <a href="http://forum.bertos.org">support forum</a> and look at
90 the section \ref coding if you want
91 help on using BeRTOS without the supporting tools. Be warned, though, that
92 this method is not supported and we can only point you in the right direction.
94 \section organization Project's organization
96 Each project has its own full BeRTOS sources, configuration and HAL files.
97 Why? Because we think that each project has its own life and it must not
98 interfere with any other project.
99 Let's say you use a shared BeRTOS version for all of your projects. Each
100 time you update, you need to check that each and every project still works
101 correctly. We don't want to do this (and I bet you don't want either).
102 However, it's still easy to update a single project if you want to.
104 A project named Foo is organized as follows:
105 \li bertos/ - BeRTOS source directory
106 \li Makefile - BeRTOS build system Makefile
107 \li project.bertos - Wizard's configuration file
108 \li foo/ - your project's main directory
109 \li foo/hw/ - low level HAL files
110 \li foo/cfg/ - configuration directory
111 \li foo/foo_user.mk - makefile fragment that you can edit
112 \li foo/foo.mk - makefile fragment changed by the Wizard, don't edit
114 See <a href="http://www.bertos.org/use/tutorial-front-page/basic-hal/">BeRTOS HAL system</a>
115 for more information on HAL files.
117 \section coding Coding guidelines
119 BeRTOS assumes that the BeRTOS source directory and the project's root directory
120 (as indicated above) are in the include path.
121 This means that you should include configuration files using "..." rather than
122 <...> style, otherwise you will use default configuration values instead of
123 your project's values.
125 Also, you should change configuration settings using the Wizard. This is because
126 sometimes there are more actions to be done than simply changing a define
134 * \defgroup drivers BeRTOS peripherals drivers
136 * This section includes all BeRTOS drivers. They may be internal CPU drivers
137 * or CPU independent drivers
142 * \defgroup core BeRTOS core functionality
144 * This section includes BeRTOS core functionalities and interfaces.
149 * \defgroup kern Kernel facilities
151 * This section describes the kernel facilities and the synchronization
152 * primitives available in BeRTOS.
156 * \defgroup mware Middleware facilities
158 * This section describes various algorithms and standalone code
159 * useful in day to day programming.
163 * \defgroup graphics General purpose graphical routines
168 * \defgroup gui BeRTOS GUI toolkit
173 * \defgroup struct Embedded optimized general purpose data types