This is a driver for the segment LCD found on the Silicon Labs EF32 Giant, Leopard and Wonder Gecko platforms. NOTE: This driver will not work with other platforms, because it contains EFM32-specific code.

Dependents:   EFM32 RDA5807M RDS Radio EMF32-Segment-Touch-Demo EMF32_ShowKey blinky_EFM32_Giant ... more

Embed: (wiki syntax)

« Back to documentation index

EFM32_SegmentLCD Class Reference

EFM32_SegmentLCD Class Reference

A driver for the Segment LCD present on some EFM32 starter kits. More...

#include <EFM32_SegmentLCD.h>

Public Member Functions

 EFM32_SegmentLCD ()
 Constructor.
 ~EFM32_SegmentLCD ()
 Destructor.
void AllOff (void)
 Switch off all elements.
void AllOn (void)
 Switch on all elements.
void AlphaNumberOff (void)
 Switch off (clear) the alphanumeric portion of the display.
void ARing (int anum, bool on)
 Switch specified segment on the ring on/off.
void Battery (int batteryLevel)
 Display a battery level on the LCD.
void EnergyMode (int em, bool on)
 Display an energy mode ring on the LCD.
void LowerHex (uint32_t num)
 Display an unsigned integer on the alphanumeric portion of the display as a hex value.
void LowerNumber (int num)
 Display a signed integer as decimal number on the alphanumeric part of the display.
void Number (int value)
 Display a signed integer on the numeric part of the display (clock area).
void NumberOff (void)
 Clear the numeric part of the display.
void Symbol (lcdSymbol s, bool on)
 Turn a predefined symbol on or off.
void UnsignedHex (uint16_t value)
 Display an unsigned short integer as a hex value on the numeric part of the display.
void Write (char *string)
 Display a 7-character string on the alphanumeric portion of the display.

Detailed Description

A driver for the Segment LCD present on some EFM32 starter kits.

Supports Giant, Leopard and Wonder Gecko STKs

 #include "mbed.h"
 #include "EFM32_SegmentLCD.h"
 
 EFM32_SegmentLCD segmentDisplay;

 int main() {
     segmentDisplay.Write("Hello");
     while(1);
 }

Definition at line 62 of file EFM32_SegmentLCD.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 42 of file EFM32_SegmentLCD.cpp.

Destructor.

Definition at line 56 of file EFM32_SegmentLCD.cpp.


Member Function Documentation

void AllOff ( void   )

Switch off all elements.

Definition at line 64 of file EFM32_SegmentLCD.cpp.

void AllOn ( void   )

Switch on all elements.

Definition at line 68 of file EFM32_SegmentLCD.cpp.

void AlphaNumberOff ( void   )

Switch off (clear) the alphanumeric portion of the display.

Definition at line 75 of file EFM32_SegmentLCD.cpp.

void ARing ( int  anum,
bool  on 
)

Switch specified segment on the ring on/off.

Parameters:
anumring segment index
ontrue to turn on, false to turn off

Definition at line 84 of file EFM32_SegmentLCD.cpp.

void Battery ( int  batteryLevel )

Display a battery level on the LCD.

0 = off 1 = lowest block 2 = lowest + second-to-lowest ...

Parameters:
batteryLevelLevel to show

Definition at line 95 of file EFM32_SegmentLCD.cpp.

void EnergyMode ( int  em,
bool  on 
)

Display an energy mode ring on the LCD.

Parameters:
emenergy mode number to display
ontrue to turn on, false to turn off.

Definition at line 104 of file EFM32_SegmentLCD.cpp.

void LowerHex ( uint32_t  num )

Display an unsigned integer on the alphanumeric portion of the display as a hex value.

Parameters:
numnumber to display

Definition at line 114 of file EFM32_SegmentLCD.cpp.

void LowerNumber ( int  num )

Display a signed integer as decimal number on the alphanumeric part of the display.

Parameters:
numnumber to display

Definition at line 122 of file EFM32_SegmentLCD.cpp.

void Number ( int  value )

Display a signed integer on the numeric part of the display (clock area).

max = 9999, min = -9999

Definition at line 131 of file EFM32_SegmentLCD.cpp.

void NumberOff ( void   )

Clear the numeric part of the display.

Definition at line 138 of file EFM32_SegmentLCD.cpp.

void Symbol ( lcdSymbol  s,
bool  on 
)

Turn a predefined symbol on or off.

Parameters:
lcdSymbolpredefined symbol in segmentlcdconfig_*.h
ontrue to turn on, false to turn off.

Definition at line 147 of file EFM32_SegmentLCD.cpp.

void UnsignedHex ( uint16_t  value )

Display an unsigned short integer as a hex value on the numeric part of the display.

max = FFFF, min = 0

Parameters:
valueValue to show

Definition at line 156 of file EFM32_SegmentLCD.cpp.

void Write ( char *  string )

Display a 7-character string on the alphanumeric portion of the display.

Parameters:
stringString to show (only the first 7 characters will be shown)

Definition at line 164 of file EFM32_SegmentLCD.cpp.