dispdrv.h

来自「《OSEK/VDX汽车电子嵌入式软件编程技术》中光盘的资料」· C头文件 代码 · 共 85 行

H
85
字号
/************************************************
*
*	$Copyright    2001 Joseph J. Lemieux  ALL RIGHTS RESERVED. $
*
*	$Filename: C:\OSEKBook\src\CH11\inc\dispdrv.h $
*
*	Description:	Display Driver Header Files
*
************************************************/
#ifndef DISPDRVH
#define DISPDRVH

#include "typedefs.h"
/***
*
* Global Macros
*
***/
#define DISPLAY_CONTROL_LOCATION (UINT8 *)0x02000000
#define DISPLAY_BUFFER_LOCATION (UINT8 *)0x02000001
#define MAX_DISPLAY_ROWS 4
#define MAX_DISPLAY_LINE_LENGTH 20
#define ROW_TRANSLATION 0,2,1,3
#define DISPLAY_BUFFER_SIZE ((UINT8)16)

typedef struct DISPLAY_MESSAGE_TYPEtag {
   char message[MAX_DISPLAY_ROWS*MAX_DISPLAY_LINE_LENGTH];
   }DISPLAY_MESSAGE_TYPE;

/************************************************
*
*   Function:     InitDisplay
*
*   Inputs:       type - type of initialization occurring.
*
*   Outputs:      none
*
*   Returns:      none
*
*   Description:  Initializes the display and prepares for 
*                 output. Sends startup message InitMessage.
*
************************************************/
void InitDisplay(InitType);
/************************************************
*
*   Function:     WriteDisplayAt
*
*   Inputs:       row, column - row/column to which to
*                 begin writing the text.
*                 text - reference to null terminated
*                 string of text to be output.
*
*   Outputs:      Adds text string to buffer.
*
*   Returns:      TRUE if successful, FALSE otherwise
*
*   Description:  Checks buffer for room for message.
*                 If room exists, copies row and column
*                 to buffer, increments buffer, and
*                 activates task OutputDisplay to actually
*                 output the data to the display.
*
************************************************/
BOOLEAN WriteDisplayAt(UINT8 row, UINT8 column, const char * text);
/************************************************
*
*   Function:     WriteDisplay
*
*   Inputs:       text - reference to null terminated
*                 string of text to be output.
*
*   Outputs:      Adds text string to buffer.
*
*   Returns:      TRUE if successful, FALSE otherwise
*
*   Description:  Calls WriteDisplayAt with row and
*                 column set to 0xFF, which indicates
*                 current row.
*
************************************************/
BOOLEAN WriteDisplay(const char * text);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?