Atmel Software Framework

tracedump.c File Reference
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "serial.h"
#include "tracedump.h"

Macros

#define dumpCOM2_BAUDRATE   ( ( unsigned portLONG ) 57600 )
 Baud rate used by the serial port 2. More...
 
#define dumpCOM2_BUFFER_LEN   ( ( unsigned portLONG ) 64 )
 COM Port2 buffer length. More...
 
#define DUMPCOM2_NO_BLOCK   ( ( portTickType ) 0 )
 
#define TRACE_MSG_BANNER   "\x0C\r\n---------- Traces Dump \r\n"
 Banner printed on the dump port. More...
 

Functions

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

Variables

static xComPortHandle xComPort2Hndl = (xComPortHandle)NULL
 COM Port2 handle. More...
 

#define dumpCOM2_BAUDRATE   ( ( unsigned portLONG ) 57600 )

Baud rate used by the serial port 2.

Referenced by itracedump_Init().

#define dumpCOM2_BUFFER_LEN   ( ( unsigned portLONG ) 64 )

COM Port2 buffer length.

Referenced by itracedump_Init().

#define DUMPCOM2_NO_BLOCK   ( ( portTickType ) 0 )

Referenced by vtracedump_Putchar().

#define TRACE_MSG_BANNER   "\x0C\r\n---------- Traces Dump \r\n"

Banner printed on the dump port.

Referenced by itracedump_Init().

int itracedump_Init ( void  )

This function initializes the dump port.

Returns
DUMP_SUCCESS or DUMP_FAILURE
Warning
FreeRTOS must already be up & running when calling this function.

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

Referenced by portTASK_FUNCTION().

unsigned portSHORT ustracedump_Print ( const signed portCHAR *const  pcString)

Send a string of characters to the dump port.

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

References usUsartPutString(), and xComPort2Hndl.

void v_tracedump_stopResources ( void  )

Stop the tracedump module resources.

References vSerialClose(), and xComPort2Hndl.

Referenced by e_syscmds_reboot().

void vtracedump_PrintBlocking ( const signed portCHAR *const  pcString)

Send a string of characters to the dump port.

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

References usUsartPutString(), and xComPort2Hndl.

Referenced by itracedump_Init().

void vtracedump_Putchar ( signed portCHAR  cByte)

Put a char to the dump port.

Parameters
cByteThe character to put

References DUMPCOM2_NO_BLOCK, xComPort2Hndl, and xUsartPutChar().

void vtracedump_Putchar_Block ( signed portCHAR  cByte)

Put a char to the dump port.

Parameters
cByteThe character to put

References xComPort2Hndl, and xUsartPutChar().