lcd.c File Reference

LCD handling functions. More...

#include <msp430x44x.h>
#include <msp430/basic_clock.h>
#include <msp430/system_clock.h>
#include <sys/types.h>
#include <signal.h>
#include "lcd.h"
#include "uart.h"

Include dependency graph for lcd.c:

Go to the source code of this file.

Defines

#define __DEBUG__   1
#define CA   (16)
#define CB   (1)
#define CC   (4)
#define CD   (8)
#define CE   (64)
#define CF   (32)
#define CG   (2)
#define CA   (1)
#define CB   (2)
#define CC   (4)
#define CD   (128)
#define CE   (64)
#define CF   (16)
#define CG   (32)
#define a   (0x80)
#define b   (0x40)
#define c   (0x20)
#define d   (0x01)
#define e   (0x02)
#define f   (0x08)
#define g   (0x04)
#define h   (0x10)

Functions

void LCD_init ()
 Initializes LCD driver.
void LCD_clear ()
 Clear all segment of LCD.
void LCD_all ()
 Shows all segment of LCD.
void LCD_clearClock ()
 Clear segments of clock on LCD (four digit at top-right).
void LCD_writeClockInt (uint16_t value, bool_t paddingZeroes)
 Write an integer variable to clock part of LCD (four digit at top-right).
void LCD_setClockColon (bool_t on)
 Shows or hides colon on clock part of LCD (four digit at top-right).
void LCD_setClockDot (uint8_t position, bool_t on)
 Shows or hides dots on clock part of LCD (four digit at top-right).
void LCD_writeClockDigit (uint8_t position, uint8_t digit)
 Write a digit to clock part of LCD (four digit at top-right).
void LCD_writeInt (int number)
 Write an integer variable to LCD.
void LCD_printf (const char *fmt,...)
 Write a formatted string to LCD.
void LCD_write (const char *buf, uint8_t length)
 Write a character buffer to LCD.
void LCD_showArrows (uint8_t arrows)
 Shows arrows.
void LCD_clearArrows (uint8_t arrows)
 Clear arrows.
void LCD_showBatteryLevel (uint8_t level)
 Shows battery level.
void LCD_setColon (uint8_t position, bool_t on)
 Shows or hides colon.
void LCD_writeLetter (uint8_t position, char letter)
 Write an alphanumeric character to LCD.

Variables

char * LCD = LCDMEM
 Pointer to access LCD memory.


Detailed Description

LCD handling functions.

Author:
Peter Ivanov, Muneem Shahriar

Definition in file lcd.c.


Define Documentation

#define __DEBUG__   1

Definition at line 25 of file lcd.c.

#define a   (0x80)

Definition at line 444 of file lcd.c.

#define b   (0x40)

Definition at line 445 of file lcd.c.

#define c   (0x20)

Definition at line 446 of file lcd.c.

#define CA   (1)

#define CA   (16)

#define CB   (2)

#define CB   (1)

#define CC   (4)

#define CC   (4)

#define CD   (128)

#define CD   (8)

#define CE   (64)

#define CE   (64)

#define CF   (16)

#define CF   (32)

#define CG   (32)

#define CG   (2)

#define d   (0x01)

Definition at line 447 of file lcd.c.

#define e   (0x02)

Definition at line 448 of file lcd.c.

#define f   (0x08)

Definition at line 449 of file lcd.c.

#define g   (0x04)

Definition at line 450 of file lcd.c.

#define h   (0x10)

Definition at line 451 of file lcd.c.


Function Documentation

void LCD_all (  ) 

Shows all segment of LCD.

Useful for testing the LCD.

Author:
Peter Ivanov, Muneem Shahriar

Definition at line 50 of file lcd.c.

void LCD_clear (  ) 

Clear all segment of LCD.

Author:
Peter Ivanov, Muneem Shahriar

Definition at line 41 of file lcd.c.

void LCD_clearArrows ( uint8_t  arrows  ) 

Clear arrows.

Author:
Peter Ivanov
Input:
Parameters:
arrows Which arrow has to clear: LCD_ARROW_UP | LCD_ARROW_DOWN | LCD_ARROW_RIGHT | LCD_ARROW_LEFT | LCD_ARROW_ALL.

Definition at line 458 of file lcd.c.

void LCD_clearClock (  ) 

Clear segments of clock on LCD (four digit at top-right).

Author:
Peter Ivanov

Definition at line 59 of file lcd.c.

void LCD_init (  ) 

Initializes LCD driver.

Author:
Peter Ivanov, Muneem Shahriar

Definition at line 29 of file lcd.c.

void LCD_printf ( const char *  fmt,
  ... 
)

Write a formatted string to LCD.

Example:

LCD_printf ("I %02i", i);

Author:
Peter Ivanov
Input:
Parameters:
fmt Printf format string. e.g.: "I %02i"

Definition at line 422 of file lcd.c.

void LCD_setClockColon ( bool_t  on  ) 

Shows or hides colon on clock part of LCD (four digit at top-right).

Author:
Peter Ivanov
Input:
Parameters:
on TRUE: switch on colon, FALSE: switch off colon.

Definition at line 102 of file lcd.c.

void LCD_setClockDot ( uint8_t  position,
bool_t  on 
)

Shows or hides dots on clock part of LCD (four digit at top-right).

Author:
Peter Ivanov
Input:
Parameters:
position 0..2: 0 is the dot at most right digit.
on TRUE: switch on dot, FALSE: switch off dot.

Definition at line 114 of file lcd.c.

void LCD_setColon ( uint8_t  position,
bool_t  on 
)

Shows or hides colon.

Author:
Peter Ivanov
Input:
Parameters:
position 0..5: 0 is the dot at most right digit.
on TRUE: switch on colon, FALSE: switch off colon.

Definition at line 474 of file lcd.c.

void LCD_showArrows ( uint8_t  arrows  ) 

Shows arrows.

Author:
Peter Ivanov
Input:
Parameters:
arrows Which arrow has to display: LCD_ARROW_UP | LCD_ARROW_DOWN | LCD_ARROW_RIGHT | LCD_ARROW_LEFT | LCD_ARROW_ALL.

Definition at line 453 of file lcd.c.

void LCD_showBatteryLevel ( uint8_t  level  ) 

Shows battery level.

Author:
Peter Ivanov
Input:
Parameters:
level Valid values are 0..3: 0: Zero battery, 1: Low battery, 2: Medium battery, 3: Full battery.

Definition at line 463 of file lcd.c.

void LCD_write ( const char *  buf,
uint8_t  length 
)

Write a character buffer to LCD.

Author:
Peter Ivanov
Input:
Parameters:
buf Pointer to buffer.
length Length of buffer.

Definition at line 433 of file lcd.c.

void LCD_writeClockDigit ( uint8_t  position,
uint8_t  digit 
)

Write a digit to clock part of LCD (four digit at top-right).

Author:
Peter Ivanov
Input:
Parameters:
position 0..3: 0 is the most right digit.
digit 0..9: digit to display. -1: clear digit.

Definition at line 163 of file lcd.c.

void LCD_writeClockInt ( uint16_t  value,
bool_t  paddingZeroes 
)

Write an integer variable to clock part of LCD (four digit at top-right).

Author:
Peter Ivanov
Input:
Parameters:
value Integer value to display: 0..9999.
paddingZeroes Display zeroes if number of digits are less than four.

Definition at line 68 of file lcd.c.

void LCD_writeInt ( int  number  ) 

Write an integer variable to LCD.

Author:
Peter Ivanov, Muneem Shahriar
Input:
Parameters:
number Integer value to display: 0..9999999.

Definition at line 390 of file lcd.c.

void LCD_writeLetter ( uint8_t  position,
char  letter 
)

Write an alphanumeric character to LCD.

Author:
Peter Ivanov, Muneem Shahriar
Input:
Parameters:
position 0..5: 0 the most right digit.
letter Implemented characters: A-Z 0-9 . : , / \

Definition at line 500 of file lcd.c.


Variable Documentation

char* LCD = LCDMEM

Pointer to access LCD memory.

Definition at line 27 of file lcd.c.


Generated on Thu Dec 27 14:21:52 2007 for Sample MSP430-449STK2 project by  doxygen 1.5.1