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

Information

All examples in this repo are considered EXPERIMENTAL QUALITY, meaning this code has been created as one-off proof-of-concept and is suitable as a demonstration for experimental purposes only. This code will not be regularly maintained by Silicon Labs and there is no guarantee that these projects will work across all environments, SDK versions and hardware.

/media/uploads/stevew817/screenshot_2015-03-17_11.17.52.png

Files at this revision

API Documentation at this revision

Comitter:
Steven Cooreman
Date:
Wed Mar 18 16:06:15 2015 -0500
Parent:
2:ee5ef7bb4fb0
Child:
4:b00dd7d93faf
Commit message:
Add destructor to segmentLCD driver, block correct sleep mode.

Changed in this revision

EFM32_SegmentLCD.cpp Show annotated file Show diff for this revision Revisions of this file
EFM32_SegmentLCD.h Show annotated file Show diff for this revision Revisions of this file
--- a/EFM32_SegmentLCD.cpp	Tue Mar 17 12:02:41 2015 -0500
+++ b/EFM32_SegmentLCD.cpp	Wed Mar 18 16:06:15 2015 -0500
@@ -33,6 +33,7 @@
 #include "pinmap.h"
 #include "EFM32_SegmentLCD.h"
 #include "segmentlcd.h"
+#include "sleep_api.h"
 
 namespace silabs {
 /*
@@ -47,6 +48,17 @@
 
 	/* Initialize the LCD without voltage booster */
 	SegmentLCD_Init(false);
+    
+    /* Block sleep mode */
+    blockSleepMode(EM2);
+}
+
+~EFM32_SegmentLCD::EFM32_SegmentLCD() {
+    /* Shut off LCD peripheral */
+    SegmentLCD_Disable();
+    
+    /* Unblock sleep mode */
+    unblockSleepMode(EM2);
 }
 
 void EFM32_SegmentLCD::AllOff( void ) {
--- a/EFM32_SegmentLCD.h	Tue Mar 17 12:02:41 2015 -0500
+++ b/EFM32_SegmentLCD.h	Wed Mar 18 16:06:15 2015 -0500
@@ -67,6 +67,11 @@
 	 * Constructor.
 	 */
 	EFM32_SegmentLCD();
+    
+    /**
+     * Destructor.
+     */
+    ~EFM32_SegmentLCD();
 
 	/**
 	 * Switch off all elements