Creating and Building a CCSv4 Project for DSP/BIOS Applications
2-8
2.1.2
How hello.c Uses DSP/BIOS
The hello.c program uses DSP/BIOS’s LOG module to send a message to
the host.
The first few lines include the header files for DSP/BIOS modules used in this
file. In DSP/BIOS programs, always include the std.h file first, then include the
module header files. This example uses the LOG module, so that header file
is also included.
#include <std.h>
#include <log.h>
The program must also include the header file that will be generated from the
.tcf configuration file. This file has the filename <tcf_file>cfg.h. For example,
if the .tcf file for a project is hello.tcf, the #include statement would be as
follows:
#include "hellocfg.h"
The main() function simply prints a message to a log using the LOG_printf
API. This API is very efficient. To reduce execution time, LOG_printf just
passes raw data to the host PC; formatting is done on the PC.
/* ======== main ======== */
Void main()
{
LOG_printf(&trace, "hello world!");
After the main() function is complete, it returns. In more complicated
applications, the return statement has the effect of turning control over to
DSP/BIOS scheduling to run hardware interrupts (HWI), software interrupts
(SWI), tasks (TSK), and idle functions (IDL) as needed.
/* fall into DSP/BIOS idle loop */
return;
Summary of Contents for TMS320 Series
Page 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Page 16: ...xvi ...
Page 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Page 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Page 202: ...5 20 ...
Page 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Page 288: ...Index 10 Index ...