LED and LCD routines


Detailed Description

The routines of this module provide basic access to the eWicht display (2-row text display) and the indicator LEDs of the F1-F4, FL, PWR, ACC and SEL buttons.

Todo:
Place a graphic here for showing the buttons and display.
Todo:
Define a command interface for the LCD as a function. Centralize and internationalize the displayed strings.


Files

file  output.c
 Display and LED routines for output status of eWicht.
file  output.h
 Output module defines and global function prototypes for eWicht.

Modules

 Display commands
 Display commands which can be sent to the LCD via the lcd_status variable.
 LED masks
 Masks for LED access.

Defines

#define LCD_CHARS_IN_A_ROW   16
 Defines the count of maximum characters per display row.
#define LED_BLINK_INTERVAL   1u
 The time of the blinking interval of an LED in LED_BLINK mode in seconds.

Enumerations

enum  eLED_Modes { LED_ON = 0, LED_OFF, LED_BLINK, LED_TOGGLE }
 Modes for LED access. More...

Functions

void OutInit (void)
 Initializes the display and LEDs.
void OutMain (void)
 Handles the display access and LED blinking if enabled.
void OutDebugOut (BYTE u8Value)
 The function displays the given value at the LEDs.
void OutSwitchOffLCD (void)
 The function turns off the backlight of the LCD and the LCD itself.
void OutSwitchLCDBacklight (BOOL On)
 The function turns the backlight of the LCD on or off.
BOOL OutIsLCDBusy (void)
 The function determines, if all commands are handled by the display and the appropriate actions are done.
void OutEnableCursor (BOOL On)
 The function enables the cursor in the display.
void OutSetCursor (BYTE Column, BYTE Row)
 The function sets the position of the cursor independently of the visibility of the cursor.
void OutSwitchOffAllLEDs (void)
 All button LEDs will be turned off.
void OutSetLED (BYTE LedMask, eLED_Modes Mode)
 Gives access to the LEDs.
void OutSetLEDMask (BYTE LedMask, BYTE LedSwitchMask)
 Gives boolean access to the LEDs via a switch mask.
void OutTriggerDisplay (void)
 Retriggers the time the LCD backlight stays on.
eLED_Modes OutGetLEDMode (BYTE Led)
 Obtain the mode of the specified LED.
void OutConvertNameForDisplay (BYTE *pString)
 Converts a string from the website to the display encoding.

Variables

BYTE lcd_status
 This byte is the global access to send commands to the display and get knowledge about the state of the LCD.


Define Documentation

#define LCD_CHARS_IN_A_ROW   16

Defines the count of maximum characters per display row.

Definition at line 67 of file output.h.


Enumeration Type Documentation

enum eLED_Modes

Modes for LED access.

Enumerator:
LED_ON  Turns the LED on.
LED_OFF  Turns the LED off.
LED_BLINK  Starts blinkink the LED in a LED_BLINK_INTERVAL interval.
LED_TOGGLE  Toggles the LED.

Definition at line 48 of file output.h.


Function Documentation

void OutConvertNameForDisplay ( BYTE *  pString  ) 

Converts a string from the website to the display encoding.

Precondition:
None
Parameters:
pString The string to convert.
Remarks:
None

Definition at line 717 of file output.c.

void OutDebugOut ( BYTE  u8Value  ) 

The function displays the given value at the LEDs.

The appropriate digits can be taken from LED masks.

Precondition:
The LEDs are initialized by a OutInit call.
Parameters:
u8Value The value to display on the LEDs.
Returns:
None
Remarks:
This function is only available in the Extended Debug mode (The macro DEBEXT_MODE must be defined).

void OutEnableCursor ( BOOL  On  ) 

The function enables the cursor in the display.

The cursor occurs as a underscore at the current cursor position.

Precondition:
The LCD must be initialized by a call of OutInit.
Parameters:
On If TRUE the cursor will be enabled and therefore visible. If FALSE the cursor will be disabled and not visible anymore.

Definition at line 391 of file output.c.

eLED_Modes OutGetLEDMode ( BYTE  Led  ) 

Obtain the mode of the specified LED.

Precondition:
None
Parameters:
Led A bit mask which specifies the LED to access. See LED masks for possible mask values. Only the mask value for one LED is possible.
Returns:
This enumerator gives the actual mode of the LED. The state LED_TOGGLE will never be returned by this function.
Remarks:
None

Definition at line 529 of file output.c.

void OutInit ( void   ) 

Initializes the display and LEDs.

Precondition:
The timer module is accessable.
Returns:
None
Remarks:
None

Todo:
Which symbols: document?

Definition at line 51 of file output.c.

BOOL OutIsLCDBusy ( void   ) 

The function determines, if all commands are handled by the display and the appropriate actions are done.

Precondition:
None.
Return values:
TRUE The display is busy with running operations.
FALSE The display is ready.

Definition at line 376 of file output.c.

void OutMain ( void   ) 

Handles the display access and LED blinking if enabled.

The application must call this routine periodically.

Precondition:
The output devices are initialized by a OutInit call.
Returns:
None
Remarks:
None

Definition at line 214 of file output.c.

void OutSetCursor ( BYTE  Column,
BYTE  Row 
)

The function sets the position of the cursor independently of the visibility of the cursor.

Precondition:
The LCD must be initialized by a call of OutInit.
Parameters:
Column Specify the column of the position. For the eWicht display that must be a value inbetween 0 and 15 (including).
Row Specify the row of the position. For the eWicht display that must be a value inbetween 0 and 1 (including).

Definition at line 406 of file output.c.

void OutSetLED ( BYTE  LedMask,
eLED_Modes  Mode 
)

Gives access to the LEDs.

Precondition:
None
Parameters:
LedMask A bit mask which specifies the LEDs to access. See LED masks for possible mask values.
Mode This enumerator gives the access mode.
Returns:
None
Remarks:
None

Definition at line 438 of file output.c.

void OutSetLEDMask ( BYTE  LedMask,
BYTE  LedSwitchMask 
)

Gives boolean access to the LEDs via a switch mask.

Precondition:
None
Parameters:
LedMask A bit mask which specifies the LEDs to access. See LED masks for possible mask values.
LedSwitchMask A '1' in this mask means LED on, a '0' means LED off. Each set bit in the u8LedMask parameter leads to a LED change. All other LEDs remain unchanged.
Returns:
None
Remarks:
None

Definition at line 427 of file output.c.

void OutSwitchLCDBacklight ( BOOL  On  ) 

The function turns the backlight of the LCD on or off.

Precondition:
None.
Parameters:
On If TRUE the display will be switched on. If FALSE the display will be switched off.
Returns:
None.
Remarks:

Definition at line 361 of file output.c.

void OutSwitchOffAllLEDs ( void   ) 

All button LEDs will be turned off.

Precondition:
The LEDs are initialized by a OutInit call.
Returns:
None
Remarks:
None

Definition at line 414 of file output.c.

void OutSwitchOffLCD ( void   ) 

The function turns off the backlight of the LCD and the LCD itself.

Precondition:
None.
Returns:
None.
Remarks:
After calling the function, the application must call OutInit before it can use the LCD again.

Definition at line 353 of file output.c.

void OutTriggerDisplay ( void   ) 

Retriggers the time the LCD backlight stays on.

If the backlight is already switched off it is turned on again. See LCD_IDLE_TIME for more details.

Precondition:
None
Returns:
None
Remarks:
None

Definition at line 192 of file output.c.


Variable Documentation

BYTE lcd_status

This byte is the global access to send commands to the display and get knowledge about the state of the LCD.

See Display commands for a detailed description of the supported commands.

Definition at line 153 of file output.h.


Generated on Sun Nov 27 20:02:40 2011 for eWicht by  doxygen 1.5.5