6cc948eef8
git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@113 9fe90eed-be63-e94b-8204-d34ff4c2ff93
167 lines
5.6 KiB
C
167 lines
5.6 KiB
C
/* ---------------------------------------------------------------------------
|
|
* FILENAME.h (c) 2008 Micro-key bv
|
|
* ---------------------------------------------------------------------------
|
|
* Micro-key bv
|
|
* Industrieweg 28, 9804 TG Noordhorn
|
|
* Postbus 92, 9800 AB Zuidhorn
|
|
* The Netherlands
|
|
* Tel: +31 594 503020
|
|
* Fax: +31 594 505825
|
|
* Email: support@microkey.nl
|
|
* Web: www.microkey.nl
|
|
* ---------------------------------------------------------------------------
|
|
* Description:
|
|
* Headerfile for SerOut.c
|
|
* ---------------------------------------------------------------------------
|
|
* Version(s): 0.1, Feb 11, 2008, MMi
|
|
* Creation.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#ifndef SEROUT_H_
|
|
#define SEROUT_H_
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* System include files.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#include "lpc23xx.h"
|
|
#include "types.h"
|
|
|
|
|
|
/* FreeRTOS includes */
|
|
#include "FreeRTOS.h"
|
|
#include "Task.h"
|
|
/* ---------------------------------------------------------------------------
|
|
* Application include files.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
#include "serial.h"
|
|
/* ---------------------------------------------------------------------------
|
|
* Constant and macro definitions.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
/*predefines for sendString Function */
|
|
#define StartMessage "\nBegin Test: "
|
|
#define EndMessage "End Test: "
|
|
#define NewLine "\n\r"
|
|
#define f_tab "\t"
|
|
#define s_tab "\t\t"
|
|
#define f_lines "\t---- "
|
|
#define s_lines "\t\t---- "
|
|
#define tabdevider "\t/\t"
|
|
#define devider " / "
|
|
#define Dummy ""
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Type definitions.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
typedef enum _Messagetype_t
|
|
{
|
|
importantMessage = 0,
|
|
headerMessage,
|
|
resultMessage,
|
|
noteMessage,
|
|
testMessage,
|
|
menuMessage
|
|
} Messagetype_t;
|
|
/* ---------------------------------------------------------------------------
|
|
* Variable declarations.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
BOOLEAN block_ImportantMessage;
|
|
BOOLEAN block_HeaderMessage;
|
|
BOOLEAN block_ResultMessage;
|
|
BOOLEAN block_NoteMessage;
|
|
BOOLEAN block_TestMessage;
|
|
BOOLEAN block_MenuMessage;
|
|
BOOLEAN block_SpinningWheel;
|
|
BOOLEAN GotoNewLine;
|
|
|
|
/* Message in- and output */
|
|
t_serial_devices SerOutPort; /* General used COM-Port */
|
|
t_serial_devices MenuPort; /* Port for the Prompt-menu */
|
|
|
|
// \note help
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function declarations.
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function: sendString
|
|
*
|
|
* Function to send a String on COM1 or COM2
|
|
*
|
|
* Parameters: t_serial_devices ComPort, - defines the COM-Port to use
|
|
* BOOLEAN newline, - write to a newline or not
|
|
* char * DefMessage, - First Message to send
|
|
* char * Devider, - second Message to send
|
|
* char * CstmMessage - third Message to send
|
|
* Return: void
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
void sendString (t_serial_devices ComPort,
|
|
BOOLEAN newline,
|
|
Messagetype_t urgency,
|
|
char * DefMessage,
|
|
char * Devider,
|
|
char * CstmMessage);
|
|
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function: debugPrint
|
|
*
|
|
* Function for a fast and easy stringOut method
|
|
*
|
|
* Parameters: char * Message - Message to send
|
|
* Return: void
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
void debugPrint (char * Message);
|
|
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function: BooltoStr / BoolRestoStr
|
|
*
|
|
* Functions to convert a certain BOOLEAN-Value wether to "high" / "passed" or
|
|
* "low" / "failed" String.
|
|
*
|
|
* Parameters: BOOLEAN Result - the Value to be converted
|
|
*
|
|
* Return: char * - converted String
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
char * BooltoStr (BOOLEAN var);
|
|
char * BoolRestoStr (BOOLEAN Result);
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function: ItoDStr
|
|
*
|
|
* Function to convert a certain INT-Value to a dezimal formated String
|
|
*
|
|
* Parameters: UINT16 IntValue - the Value to be converted
|
|
*
|
|
* Return: char * - converted String
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
char * ItoDStr (UINT32 IntValue);
|
|
char * FtoDStr (float IntValue);
|
|
|
|
/* ---------------------------------------------------------------------------
|
|
* Function: ItoHStr
|
|
*
|
|
* Function to convert a certain INT-Value to a hexadezimal formated String
|
|
*
|
|
* Parameters: UINT16 IntValue - the Value to be converted
|
|
*
|
|
* Return: char * - converted String
|
|
* ---------------------------------------------------------------------------
|
|
*/
|
|
char * ItoHStr (UINT32 IntValue);
|
|
|
|
|
|
|
|
#endif /*SEROUT_H_*/
|