Hardware manual

65
7. Testing and documentation of the code.
7.1. Introduction.
The testing and debugging of the code were not easy tasks. This was mostly due to the lack of
good debugger and debugging functions for brushless motor. Fortunately there was one
solution to this problem. Namely, it is possible to send commands and get responses from the
microcontroller using serial line and tools like: gtkterm. The use of serial line is described in the
next subsection.
Another task was to write and generate the documentation. In this case, the descriptions of the
all functions and the code were made iernel Doc, which is used
for documentation of Linux Kernel Sources. Thanks that it was possible to use standard tools to
generate documentation in HTML format. Please see the 7.3 subsection to get little bit more
details about it.
7.2. Command processor (CMD_Proc) and serial line.
To use serial line RS-232 we need to include this file:
periph/sci_rs232.h
It contains definitions of functions which allow the serial line communication on H8S/2638. For
example to initialize serial port we need to write such line in our program:
sci_rs232_setmode(19200, 0, 0, sci_rs232_chan_default);
Now, to use command processor, we need to include the following two files:
cmd_proc.h
cmd_pxmc.h
First one is system file, which describes all structures uses by CMD and is just a general
command processor file. Second file contains the definitions of several standard PXMC
commands.
create some function
done in very easy way. Here is some example: