EFR32 Blue Gecko 13 Software Documentation  efr32bg13-doc-5.1.2
segmentlcd.c File Reference

Detailed Description

EFM32 Segment LCD Display driver.

Version
5.1.1

License

Copyright 2015 Silicon Labs, Inc. http://www.silabs.com

This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file segmentlcd.c.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "em_device.h"
#include "em_cmu.h"
#include "em_gpio.h"
#include "segmentlcd.h"

Go to the source code of this file.

Data Structures

struct  ARING_TypeDef
 Defines segment COM and BIT fields for A-wheel (suited for Anim) More...
 
struct  BATTERY_TypeDef
 Defines segment COM and BIT fields for Battery (suited for Anim) More...
 
struct  Block_TypeDef
 Defines segment COM and BIT fields for top and bottom row blocks. The bit pattern shown above for characters can be split into upper and lower portions for animation purposes. There are separate COM and BIT numbers which together represent a set of stacked blocks which can be shown on two rows in the segmented LCD screen. More...
 
struct  CHAR_TypeDef
 Defines each text symbol's segment in terms of COM and BIT numbers, in a way that we can enumerate each bit for each text segment in the following bit pattern: More...
 
struct  EM_TypeDef
 Defines segment COM and BIT fields for Energy Modes on display. More...
 
struct  MCU_DISPLAY
 Defines prototype for all segments in display. More...
 
struct  NUMBER_TypeDef
 Defines segment COM and BIT fields numeric display. More...
 

Functions

static void displayBlock (SegmentLCD_BlockMode_TypeDef topMode[SEGMENT_LCD_NUM_BLOCK_COLUMNS], SegmentLCD_BlockMode_TypeDef botMode[SEGMENT_LCD_NUM_BLOCK_COLUMNS])
 Working instance of LCD display.
 
void SegmentLCD_AllOff (void)
 Disable all segments.
 
void SegmentLCD_AllOn (void)
 Enable all segments.
 
void SegmentLCD_AlphaNumberOff (void)
 Turn all segments on alpha characters in display off.
 
void SegmentLCD_ARing (int anum, int on)
 Light up or shut off Ring of Indicators. More...
 
void SegmentLCD_Battery (int batteryLevel)
 Light up or shut off Battery Indicator. More...
 
void SegmentLCD_Block (SegmentLCD_BlockMode_TypeDef topMode[SEGMENT_LCD_NUM_BLOCK_COLUMNS], SegmentLCD_BlockMode_TypeDef botMode[SEGMENT_LCD_NUM_BLOCK_COLUMNS])
 
void SegmentLCD_Disable (void)
 Disables LCD controller.
 
void SegmentLCD_EnergyMode (int em, int on)
 Light up or shut off Energy Mode indicator. More...
 
void SegmentLCD_Init (bool useBoost)
 Segment LCD Initialization routine for EFM32 STK display. More...
 
void SegmentLCD_LowerHex (uint32_t num)
 Write a hexadecimal number on lower alphanumeric part of Segment LCD display. More...
 
void SegmentLCD_LowerNumber (int num)
 Write number on lower alphanumeric part of Segment LCD display. More...
 
void SegmentLCD_Number (int value)
 Write number on numeric part on Segment LCD display. More...
 
void SegmentLCD_NumberOff (void)
 Turn all segments on numeric digits in display off.
 
void SegmentLCD_Symbol (lcdSymbol s, int on)
 Light up or shut off various symbols on Segment LCD. More...
 
void SegmentLCD_UnsignedHex (uint16_t value)
 Write hexadecimal number on numeric part on Segment LCD display. More...
 
void SegmentLCD_Write (const char *string)
 Write text on LCD display. More...
 

Variables

static const uint16_t Blocks []
 Defines highlighted segments for the block display. More...
 
static const uint16_t EFM_Alphabet []
 Defines higlighted segments for the alphabet, starting from "blank" (SPACE) Uses bit pattern as defined for text segments above. E.g. a capital O, would have bits 0 1 2 3 4 5 => 0x003f defined.
 
static const MCU_DISPLAY EFM_Display = EFM_DISPLAY_DEF
 Working instance of LCD display.
 
static const uint16_t EFM_Numbers []
 Defines higlighted segments for the numeric display. More...
 

Variable Documentation

const uint16_t Blocks[]
static
Initial value:
= {
0x0000,
0x00E0,
0x001F,
0x00FF
}

Defines highlighted segments for the block display.

Definition at line 300 of file segmentlcd.c.

Referenced by displayBlock().

const uint16_t EFM_Numbers[]
static
Initial value:
= {
0x003f,
0x0006,
0x005b,
0x004f,
0x0066,
0x006d,
0x007d,
0x0007,
0x007f,
0x006f,
0x0077,
0x007c,
0x0039,
0x005e,
0x0079,
0x0071,
0x0040
}

Defines higlighted segments for the numeric display.

Definition at line 276 of file segmentlcd.c.

Referenced by SegmentLCD_Number(), and SegmentLCD_UnsignedHex().