244 static const uint16_t signIndex =
sizeof(
EFM_Numbers)/
sizeof(uint16_t) - 1 ;
256 LCD_ALL_SEGMENTS_OFF();
265 LCD_ALL_SEGMENTS_ON();
274 LCD_ALPHA_NUMBER_OFF();
311 for (i = 0; i < 4; i++)
313 if (i < batteryLevel)
400 LCD_DISPLAY_ENABLE();
409 LCD_SEGMENTS_ENABLE();
440 for ( i=6; i>=0; i-- )
445 str[i] = nibble +
'0';
446 else if ( nibble == 11 )
448 else if ( nibble == 13 )
451 str[i] = (nibble - 10) +
'A';
470 if ( ( num > 9999999 ) || ( num < -9999999 ) )
482 for ( i=6; i>=0; i-- )
484 if ( ( i < 6 ) && ( num == 0 ) )
490 str[i] = (num % 10) +
'0';
505 int i, com, bit, digit, div, neg;
539 for (digit = 0; digit < 4; digit++)
541 num = (value / div) % 10;
542 if ((neg == 1) && (digit == 3)) num = signIndex;
545 for (i = 0; i < 7; i++)
549 if (bitpattern & (1 << i))
584 case LCD_SYMBOL_GECKO:
585 com = LCD_SYMBOL_GECKO_COM;
586 bit = LCD_SYMBOL_GECKO_SEG;
589 com = LCD_SYMBOL_ANT_COM;
590 bit = LCD_SYMBOL_ANT_SEG;
592 case LCD_SYMBOL_PAD0:
593 com = LCD_SYMBOL_PAD0_COM;
594 bit = LCD_SYMBOL_PAD0_SEG;
596 case LCD_SYMBOL_PAD1:
597 com = LCD_SYMBOL_PAD1_COM;
598 bit = LCD_SYMBOL_PAD1_SEG;
600 case LCD_SYMBOL_EFM32:
601 com = LCD_SYMBOL_EFM32_COM;
602 bit = LCD_SYMBOL_EFM32_SEG;
604 case LCD_SYMBOL_MINUS:
605 com = LCD_SYMBOL_MINUS_COM;
606 bit = LCD_SYMBOL_MINUS_SEG;
608 case LCD_SYMBOL_COL3:
609 com = LCD_SYMBOL_COL3_COM;
610 bit = LCD_SYMBOL_COL3_SEG;
612 case LCD_SYMBOL_COL5:
613 com = LCD_SYMBOL_COL5_COM;
614 bit = LCD_SYMBOL_COL5_SEG;
616 case LCD_SYMBOL_COL10:
617 com = LCD_SYMBOL_COL10_COM;
618 bit = LCD_SYMBOL_COL10_SEG;
620 #ifdef LCD_SYMBOL_DEGC_SEG
621 case LCD_SYMBOL_DEGC:
622 com = LCD_SYMBOL_DEGC_COM;
623 bit = LCD_SYMBOL_DEGC_SEG;
626 #ifdef LCD_SYMBOL_DEGF_SEG
627 case LCD_SYMBOL_DEGF:
628 com = LCD_SYMBOL_DEGF_COM;
629 bit = LCD_SYMBOL_DEGF_SEG;
632 #ifdef LCD_SYMBOL_DP2_SEG
634 com = LCD_SYMBOL_DP2_COM;
635 bit = LCD_SYMBOL_DP2_SEG;
638 #ifdef LCD_SYMBOL_DP3_SEG
640 com = LCD_SYMBOL_DP3_COM;
641 bit = LCD_SYMBOL_DP3_SEG;
644 #ifdef LCD_SYMBOL_DP4_SEG
646 com = LCD_SYMBOL_DP4_COM;
647 bit = LCD_SYMBOL_DP4_SEG;
650 #ifdef LCD_SYMBOL_DP5_SEG
652 com = LCD_SYMBOL_DP5_COM;
653 bit = LCD_SYMBOL_DP5_SEG;
657 com = LCD_SYMBOL_DP6_COM;
658 bit = LCD_SYMBOL_DP6_SEG;
660 case LCD_SYMBOL_DP10:
661 com = LCD_SYMBOL_DP10_COM;
662 bit = LCD_SYMBOL_DP10_SEG;
664 #ifdef LCD_SYMBOL_AM_SEG
666 com = LCD_SYMBOL_AM_COM;
667 bit = LCD_SYMBOL_AM_SEG;
670 #ifdef LCD_SYMBOL_PM_SEG
672 com = LCD_SYMBOL_PM_COM;
673 bit = LCD_SYMBOL_PM_SEG;
676 #ifdef LCD_SYMBOL_MICROAMP_SEG
677 case LCD_SYMBOL_MICROAMP:
678 com = LCD_SYMBOL_MICROAMP_COM;
679 bit = LCD_SYMBOL_MICROAMP_SEG;
682 #ifdef LCD_SYMBOL_MILLIAMP_SEG
683 case LCD_SYMBOL_MILLIAMP:
684 com = LCD_SYMBOL_MILLIAMP_COM;
685 bit = LCD_SYMBOL_MILLIAMP_SEG;
707 int num, i, com, bit, digit;
725 for (digit = 0; digit < 4; digit++)
727 num = (value >> (4 * digit)) & 0x0f;
729 for (i = 0; i < 7; i++)
733 if (bitpattern & (1 << i))
751 int data, length, index;
756 length = strlen(
string);
769 for (index = 0; index < 7; index++)
773 data = (int) *
string;
784 for (i = 0; i < 14; i++)
786 bit = EFM_Display.
Text[index].
bit[i];
787 com = EFM_Display.
Text[index].
com[i];
789 if (bitfield & (1 << i))
Clock management unit (CMU) API.
void CMU_ClockSelectSet(CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
Select reference clock/oscillator used for a clock branch.
Defines prototype for all segments in display.
static const uint16_t EFM_Alphabet[]
Defines higlighted segments for the alphabet, starting from "blank" (SPACE) Uses bit pattern as defin...
#define LCD_SYNCBUSY_CTRL
void SegmentLCD_LowerNumber(int num)
Write number on lower alphanumeric part of Segment LCD display.
void LCD_VBoostSet(LCD_VBoostLevel_TypeDef vboost)
Configure voltage booster.
Defines segment COM and BIT fields numeric display.
Defines segment COM and BIT fields for Energy Modes on display.
static const MCU_DISPLAY EFM_Display
Working instance of LCD display.
Defines each text symbol's segment in terms of COM and BIT numbers, in a way that we can enumerate ea...
void SegmentLCD_Write(char *string)
Write text on LCD display.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
void SegmentLCD_Symbol(lcdSymbol s, int on)
Light up or shut off various symbols on Segment LCD.
#define CMU_LCDCTRL_VBOOSTEN
void SegmentLCD_NumberOff(void)
Turn all segments on numeric digits in display off.
void LCD_SegmentSet(int com, int bit, bool enable)
Turn on or clear a segment.
void LCD_VLCDSelect(LCD_VLCDSel_TypeDef vlcd)
Select source for VLCD.
void SegmentLCD_AllOff(void)
Disable all segments.
EFM32 Segment LCD Display driver, header file.
void SegmentLCD_AllOn(void)
Enable all segments.
void SegmentLCD_EnergyMode(int em, int on)
Light up or shut off Energy Mode indicator.
General Purpose IO (GPIO) peripheral API.
void SegmentLCD_ARing(int anum, int on)
Light up or shut off Ring of Indicators.
void SegmentLCD_AlphaNumberOff(void)
Turn all segments on alpha characters in display off.
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
void CMU_LCDClkFDIVSet(uint32_t div)
Set the LCD framerate divisor (FDIV) setting.
void SegmentLCD_LowerHex(uint32_t num)
Write a hexadecimal number on lower alphanumeric part of Segment LCD display.
static const uint16_t EFM_Numbers[]
Defines higlighted segments for the numeric display.
__STATIC_INLINE void LCD_FreezeEnable(bool enable)
When set, LCD registers will not be updated until cleared,.
Defines segment COM and BIT fields for A-wheel (suited for Anim)
void SegmentLCD_Battery(int batteryLevel)
Light up or shut off Battery Indicator.
void SegmentLCD_Number(int value)
Write number on numeric part on Segment LCD display.
void SegmentLCD_Init(bool useBoost)
Segment LCD Initialization routine for EFM32 STK display.
void SegmentLCD_UnsignedHex(uint16_t value)
Write hexadecimal number on numeric part on Segment LCD display.
__STATIC_INLINE void LCD_SyncBusyDelay(uint32_t flags)
Polls LCD SYNCBUSY flags, until flag has been cleared.
__STATIC_INLINE void LCD_IntDisable(uint32_t flags)
Disable LCD interrupts.
void SegmentLCD_Disable(void)
Disables LCD controller.
__STATIC_INLINE void LCD_Enable(bool enable)
Enable or disable LCD controller.
void LCD_Init(const LCD_Init_TypeDef *lcdInit)
Initalize Liquid Crystal Display (LCD) controller.
void CMU_ClockDivSet(CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div)
Set clock divisor/prescaler.
Defines segment COM and BIT fields for A-wheel (suited for Anim)