Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: seg_LCD.h
- Revision:
- 0:702e0e56ae11
diff -r 000000000000 -r 702e0e56ae11 seg_LCD.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/seg_LCD.h Sat Apr 13 20:42:47 2019 +0000 @@ -0,0 +1,54 @@ +#ifndef SEG_LCD_H +#define SEG_LCD_H + +#include "mbed.h" +#include "stdint.h" + +//Function Declarations +void SegLCD_Init(void); +void SegLCD_Set(uint8_t Value,uint8_t Digit); +void SegLCD_DisplayDecimal(uint16_t Value); +void SegLCD_DisplayHex(uint16_t Value); +void SegLCD_DisplayTime(uint8_t Value1, uint8_t Value2); +void SegLCD_DisplayError(uint8_t ErrorNum); + +//Define Number of Front and Back plane pins +#define LCD_NUM_FRONTPLANE_PINS 8 +#define LCD_NUM_BACKPLANE_PINS 4 + +//Create macros for segments +#define LCD_SEG_D 0x11 +#define LCD_SEG_E 0x22 +#define LCD_SEG_G 0x44 +#define LCD_SEG_F 0x88 +#define LCD_SEG_DECIMAL 0x11 +#define LCD_SEG_C 0x22 +#define LCD_SEG_B 0x44 +#define LCD_SEG_A 0x88 +#define LCD_CLEAR 0x00 + +//Create Macros for each pin +#define LCD_FRONTPLANE0 37u +#define LCD_FRONTPLANE1 17u +#define LCD_FRONTPLANE2 7u +#define LCD_FRONTPLANE3 8u +#define LCD_FRONTPLANE4 53u +#define LCD_FRONTPLANE5 38u +#define LCD_FRONTPLANE6 10u +#define LCD_FRONTPLANE7 11u +#define LCD_BACKPLANE0 40u +#define LCD_BACKPLANE1 52u +#define LCD_BACKPLANE2 19u +#define LCD_BACKPLANE3 18u + +//Macros for turning decimal points and colon on and off +#define SegLCD_DP1_On() LCD->WF8B[LCD_FRONTPLANE1] |= LCD_SEG_DECIMAL; +#define SegLCD_DP1_Off() LCD->WF8B[LCD_FRONTPLANE1] &= ~LCD_SEG_DECIMAL; +#define SegLCD_DP2_On() LCD->WF8B[LCD_FRONTPLANE3] |= LCD_SEG_DECIMAL; +#define SegLCD_DP2_Off() LCD->WF8B[LCD_FRONTPLANE3] &= ~LCD_SEG_DECIMAL; +#define SegLCD_DP3_On() LCD->WF8B[LCD_FRONTPLANE5] |= LCD_SEG_DECIMAL; +#define SegLCD_DP3_Off() LCD->WF8B[LCD_FRONTPLANE5] &= ~LCD_SEG_DECIMAL; +#define SegLCD_Col_On() LCD->WF8B[LCD_FRONTPLANE7] |= LCD_SEG_DECIMAL; +#define SegLCD_Col_Off() LCD->WF8B[LCD_FRONTPLANE7] &= ~LCD_SEG_DECIMAL; + +#endif \ No newline at end of file