309 static const uint16_t signIndex =
sizeof(
EFM_Numbers)/
sizeof(uint16_t) - 1 ;
321 LCD_ALL_SEGMENTS_OFF();
330 LCD_ALL_SEGMENTS_ON();
339 LCD_ALPHA_NUMBER_OFF();
376 for (i = 0; i < 4; i++)
378 if (i < batteryLevel)
410 void SegmentLCD_Block(
494 LCD_DISPLAY_ENABLE();
503 LCD_SEGMENTS_ENABLE();
534 for ( i=6; i>=0; i-- )
539 str[i] = nibble +
'0';
540 else if ( nibble == 11 )
542 else if ( nibble == 13 )
545 str[i] = (nibble - 10) +
'A';
564 if ( ( num > 9999999 ) || ( num < -9999999 ) )
576 for ( i=6; i>=0; i-- )
578 if ( ( i < 6 ) && ( num == 0 ) )
584 str[i] = (num % 10) +
'0';
599 int i, com, bit, digit, div, neg;
633 for (digit = 0; digit < 4; digit++)
635 num = (value / div) % 10;
636 if ((neg == 1) && (digit == 3)) num = signIndex;
639 for (i = 0; i < 7; i++)
643 if (bitpattern & (1 << i))
678 case LCD_SYMBOL_GECKO:
679 com = LCD_SYMBOL_GECKO_COM;
680 bit = LCD_SYMBOL_GECKO_SEG;
683 com = LCD_SYMBOL_ANT_COM;
684 bit = LCD_SYMBOL_ANT_SEG;
686 case LCD_SYMBOL_PAD0:
687 com = LCD_SYMBOL_PAD0_COM;
688 bit = LCD_SYMBOL_PAD0_SEG;
690 case LCD_SYMBOL_PAD1:
691 com = LCD_SYMBOL_PAD1_COM;
692 bit = LCD_SYMBOL_PAD1_SEG;
694 case LCD_SYMBOL_EFM32:
695 com = LCD_SYMBOL_EFM32_COM;
696 bit = LCD_SYMBOL_EFM32_SEG;
698 case LCD_SYMBOL_MINUS:
699 com = LCD_SYMBOL_MINUS_COM;
700 bit = LCD_SYMBOL_MINUS_SEG;
702 case LCD_SYMBOL_COL3:
703 com = LCD_SYMBOL_COL3_COM;
704 bit = LCD_SYMBOL_COL3_SEG;
706 case LCD_SYMBOL_COL5:
707 com = LCD_SYMBOL_COL5_COM;
708 bit = LCD_SYMBOL_COL5_SEG;
710 case LCD_SYMBOL_COL10:
711 com = LCD_SYMBOL_COL10_COM;
712 bit = LCD_SYMBOL_COL10_SEG;
714 #ifdef LCD_SYMBOL_DEGC_SEG
715 case LCD_SYMBOL_DEGC:
716 com = LCD_SYMBOL_DEGC_COM;
717 bit = LCD_SYMBOL_DEGC_SEG;
720 #ifdef LCD_SYMBOL_DEGF_SEG
721 case LCD_SYMBOL_DEGF:
722 com = LCD_SYMBOL_DEGF_COM;
723 bit = LCD_SYMBOL_DEGF_SEG;
726 #ifdef LCD_SYMBOL_DP2_SEG
728 com = LCD_SYMBOL_DP2_COM;
729 bit = LCD_SYMBOL_DP2_SEG;
732 #ifdef LCD_SYMBOL_DP3_SEG
734 com = LCD_SYMBOL_DP3_COM;
735 bit = LCD_SYMBOL_DP3_SEG;
738 #ifdef LCD_SYMBOL_DP4_SEG
740 com = LCD_SYMBOL_DP4_COM;
741 bit = LCD_SYMBOL_DP4_SEG;
744 #ifdef LCD_SYMBOL_DP5_SEG
746 com = LCD_SYMBOL_DP5_COM;
747 bit = LCD_SYMBOL_DP5_SEG;
751 com = LCD_SYMBOL_DP6_COM;
752 bit = LCD_SYMBOL_DP6_SEG;
754 case LCD_SYMBOL_DP10:
755 com = LCD_SYMBOL_DP10_COM;
756 bit = LCD_SYMBOL_DP10_SEG;
758 #ifdef LCD_SYMBOL_AM_SEG
760 com = LCD_SYMBOL_AM_COM;
761 bit = LCD_SYMBOL_AM_SEG;
764 #ifdef LCD_SYMBOL_PM_SEG
766 com = LCD_SYMBOL_PM_COM;
767 bit = LCD_SYMBOL_PM_SEG;
770 #ifdef LCD_SYMBOL_MICROAMP_SEG
771 case LCD_SYMBOL_MICROAMP:
772 com = LCD_SYMBOL_MICROAMP_COM;
773 bit = LCD_SYMBOL_MICROAMP_SEG;
776 #ifdef LCD_SYMBOL_MILLIAMP_SEG
777 case LCD_SYMBOL_MILLIAMP:
778 com = LCD_SYMBOL_MILLIAMP_COM;
779 bit = LCD_SYMBOL_MILLIAMP_SEG;
801 int num, i, com, bit, digit;
819 for (digit = 0; digit < 4; digit++)
821 num = (value >> (4 * digit)) & 0x0f;
823 for (i = 0; i < 7; i++)
827 if (bitpattern & (1 << i))
845 int data, length, index;
850 length = strlen(
string);
863 for (index = 0; index < 7; index++)
867 data = (int) *
string;
878 for (i = 0; i < 14; i++)
880 bit = EFM_Display.
Text[index].
bit[i];
881 com = EFM_Display.
Text[index].
com[i];
883 if (bitfield & (1 << i))
915 for (index = 0; index < SEGMENT_LCD_NUM_BLOCK_COLUMNS; index++)
917 mode = topMode[index];
922 for (i = 0; i < 8; i++)
924 if (bitfield & (1 << i))
935 for (index = 0; index < SEGMENT_LCD_NUM_BLOCK_COLUMNS; index++)
937 mode = botMode[index];
942 for (i = 0; i < 8; i++)
944 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...
static const uint16_t Blocks[]
Defines highlighted segments for the block display.
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...
#define LCD_SYNCBUSY_CTRL
void SegmentLCD_Write(const char *string)
Write text on LCD display.
SegmentLCD_BlockMode_TypeDef
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.
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.
#define CMU_LCDCTRL_VBOOSTEN
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.
Defines segment COM and BIT fields for top and bottom row blocks. The bit pattern shown above for cha...
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 Battery (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.
Block_TypeDef BotBlocks[7]
void SegmentLCD_Init(bool useBoost)
Segment LCD Initialization routine for EFM32 STK display.
Block_TypeDef TopBlocks[7]
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.
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_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)