tracedump.h File Reference


Detailed Description

Control Panel trace dump module.

This file defines a set of functions to dump trace.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file tracedump.h.

#include <avr32/io.h>
#include "FreeRTOS.h"

Go to the source code of this file.

Defines

#define DUMP_FAILURE   -1
#define DUMP_SUCCESS   0
#define NAKED_TRACE_COM2(...)
#define TRACE_COM2(...)

Functions

int itracedump_Init (void)
int printk (const char *format,...)
unsigned portSHORT ustracedump_Print (const signed portCHAR *const pcString)
void v_tracedump_stopResources (void)
 Stop the tracedump module resources.
void vtracedump_PrintBlocking (const signed portCHAR *const pcString)
void vtracedump_Putchar (signed portCHAR cByte)
 Put a char to the dump port.
void vtracedump_Putchar_Block (signed portCHAR cByte)
 Put a char to the dump port.


Define Documentation

#define DUMP_FAILURE   -1

Value returned by function when it was unable to complete successfully for some unspecified reason

Definition at line 58 of file tracedump.h.

Referenced by itracedump_Init().

#define DUMP_SUCCESS   0

Value returned by function when it completed successfully

Definition at line 54 of file tracedump.h.

Referenced by itracedump_Init().

#define NAKED_TRACE_COM2 ( ...   ) 

#define TRACE_COM2 ( ...   ) 


Function Documentation

int itracedump_Init ( void   ) 

This function initializes a dump port.

Returns:
DUMP_SUCCESS or DUMP_FAILURE
Warning:
FreeRTOS must already be up & running when calling this function.
This function initializes the dump port.
Returns:
DUMP_SUCCESS or DUMP_FAILURE
Warning:
FreeRTOS must already be up & running when calling this function.

Definition at line 76 of file tracedump.c.

References DUMP_FAILURE, DUMP_SUCCESS, dumpCOM2_BAUDRATE, dumpCOM2_BUFFER_LEN, serCOM2, TRACE_MSG_BANNER, vtracedump_PrintBlocking(), xComPort2Hndl, and xUsartInit().

Referenced by portTASK_FUNCTION().

00077 {
00078   int iStatus = DUMP_SUCCESS;
00079 
00080   //**
00081   //** Init the port.
00082   //**
00083   // Init the COM Port2.
00084   xComPort2Hndl = xUsartInit(serCOM2, dumpCOM2_BAUDRATE, 0, dumpCOM2_BUFFER_LEN);
00085   if(xComPort2Hndl == 0)
00086     return(DUMP_FAILURE);
00087 
00088   //**
00089   //** Dump a banner to the port.
00090   //**
00091   vtracedump_PrintBlocking((const signed portCHAR * const)TRACE_MSG_BANNER);
00092 
00093   return(iStatus);
00094 }

int printk ( const char *  format,
  ... 
)

Definition at line 285 of file printf-stdarg.c.

References print().

00286 {
00287         va_list args;
00288         
00289         va_start( args, format );
00290         return print( 0, format, args );
00291 }

unsigned portSHORT ustracedump_Print ( const signed portCHAR *const   pcString  ) 

Send a string of characters to the dump port.

Parameters:
pcString The string to dump
Returns:
The number of characters that could not be sent.
Warning:
FreeRTOS must already be up & running when calling this function.

Definition at line 110 of file tracedump.c.

References usUsartPutString(), and xComPort2Hndl.

00111 {
00112   return( usUsartPutString( xComPort2Hndl, pcString, strlen( (const portCHAR * )pcString ) ) );
00113 }

void v_tracedump_stopResources ( void   ) 

Stop the tracedump module resources.

Definition at line 99 of file tracedump.c.

References vSerialClose(), and xComPort2Hndl.

Referenced by e_syscmds_reboot().

00100 {
00101   vSerialClose( xComPort2Hndl );
00102 }

void vtracedump_PrintBlocking ( const signed portCHAR *const   pcString  ) 

Send a string of characters to the dump port.

Parameters:
pcString The string to dump
Warning:
FreeRTOS must already be up & running when calling this function.

Definition at line 121 of file tracedump.c.

References usUsartPutString(), and xComPort2Hndl.

Referenced by itracedump_Init().

00122 {
00123    unsigned portSHORT usRemainChar = 0;
00124    unsigned portSHORT usMsgLen = strlen((const portCHAR * )pcString);
00125 
00126    usRemainChar = usMsgLen;
00127    do{
00128       usRemainChar = usUsartPutString( xComPort2Hndl,
00129                                        (const signed portCHAR * const)(pcString + usMsgLen - usRemainChar),
00130                                        usRemainChar );
00131    }while( usRemainChar );
00132 }

void vtracedump_Putchar ( signed portCHAR  cByte  ) 

Put a char to the dump port.

Parameters:
cByte The character to put

Definition at line 140 of file tracedump.c.

References DUMPCOM2_NO_BLOCK, xComPort2Hndl, and xUsartPutChar().

00141 {
00142    xUsartPutChar( xComPort2Hndl, cByte, DUMPCOM2_NO_BLOCK );
00143 }

void vtracedump_Putchar_Block ( signed portCHAR  cByte  ) 

Put a char to the dump port.

Parameters:
cByte The character to put

Definition at line 150 of file tracedump.c.

References xComPort2Hndl, and xUsartPutChar().

00151 {
00152    xUsartPutChar( xComPort2Hndl, cByte, -1 );
00153 }


Generated on Fri Feb 19 02:22:48 2010 for AVR32 - Control Panel demonstration. by  doxygen 1.5.5