Fork for Seoul Hackathon

Dependents:   TextLCD_FC113 Kviz

Committer:
wim
Date:
Sat Sep 27 12:38:27 2014 +0000
Revision:
34:e5a0dcb43ecc
Child:
37:ce348c002929
Added support for PT6314 (VFD), added setOrient() method for supported devices (eg SSD1803, US2066), added Double Height lines and 16 UDCs for supported devices. Added separate files for UDC defines and feature/footprint configuration.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 34:e5a0dcb43ecc 1 /* mbed TextLCD Library, for a 4-bit LCD based on HD44780
wim 34:e5a0dcb43ecc 2 * Copyright (c) 2014, WH
wim 34:e5a0dcb43ecc 3 * 2014, v01: WH, Extracted from TextLCD.cpp as of v14
wim 34:e5a0dcb43ecc 4 *
wim 34:e5a0dcb43ecc 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 34:e5a0dcb43ecc 6 * of this software and associated documentation files (the "Software"), to deal
wim 34:e5a0dcb43ecc 7 * in the Software without restriction, including without limitation the rights
wim 34:e5a0dcb43ecc 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 34:e5a0dcb43ecc 9 * copies of the Software, and to permit persons to whom the Software is
wim 34:e5a0dcb43ecc 10 * furnished to do so, subject to the following conditions:
wim 34:e5a0dcb43ecc 11 *
wim 34:e5a0dcb43ecc 12 * The above copyright notice and this permission notice shall be included in
wim 34:e5a0dcb43ecc 13 * all copies or substantial portions of the Software.
wim 34:e5a0dcb43ecc 14 *
wim 34:e5a0dcb43ecc 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 34:e5a0dcb43ecc 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 34:e5a0dcb43ecc 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 34:e5a0dcb43ecc 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 34:e5a0dcb43ecc 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 34:e5a0dcb43ecc 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 34:e5a0dcb43ecc 21 * THE SOFTWARE.
wim 34:e5a0dcb43ecc 22 */
wim 34:e5a0dcb43ecc 23 #include "TextLCD_Config.h"
wim 34:e5a0dcb43ecc 24
wim 34:e5a0dcb43ecc 25 #if(LCD_UDC == 1)
wim 34:e5a0dcb43ecc 26 // User Defined Characters (UDCs) are defined by an 8 byte bitpattern. The P0..P5 form the character pattern.
wim 34:e5a0dcb43ecc 27 // P7 P6 P5 P4 P3 P2 P1 P0
wim 34:e5a0dcb43ecc 28 // 0 B1 B0 x 0 1 1 1 0
wim 34:e5a0dcb43ecc 29 // 1 B1 B0 x 1 0 0 0 1
wim 34:e5a0dcb43ecc 30 // . .............
wim 34:e5a0dcb43ecc 31 // 7 B1 B0 x 1 0 0 0 1
wim 34:e5a0dcb43ecc 32 //
wim 34:e5a0dcb43ecc 33 // Blinking UDCs are enabled when a specific controlbit (BE) is set.
wim 34:e5a0dcb43ecc 34 // The blinking pixels in the UDC can be controlled by setting additional bits in the UDC bitpattern.
wim 34:e5a0dcb43ecc 35 // Bit 6 and Bit 7 in the pattern will control the blinking mode when Blink is enabled through BE.
wim 34:e5a0dcb43ecc 36 // B1 B0 Mode
wim 34:e5a0dcb43ecc 37 // 0 0 No Blinking in this row of the UDC
wim 34:e5a0dcb43ecc 38 // 0 1 Enabled pixels in P4 will blink
wim 34:e5a0dcb43ecc 39 // 1 x Enabled pixels in P0..P4 will blink
wim 34:e5a0dcb43ecc 40
wim 34:e5a0dcb43ecc 41 /** Some sample User Defined Chars 5x7 dots */
wim 34:e5a0dcb43ecc 42 //const char udc_ae[] = {0x00, 0x00, 0x1B, 0x05, 0x1F, 0x14, 0x1F, 0x00}; //æ
wim 34:e5a0dcb43ecc 43 //const char udc_0e[] = {0x00, 0x00, 0x0E, 0x13, 0x15, 0x19, 0x0E, 0x00}; //ø
wim 34:e5a0dcb43ecc 44 //const char udc_ao[] = {0x0E, 0x0A, 0x0E, 0x01, 0x0F, 0x11, 0x0F, 0x00}; //å
wim 34:e5a0dcb43ecc 45 //const char udc_AE[] = {0x0F, 0x14, 0x14, 0x1F, 0x14, 0x14, 0x17, 0x00}; //Æ
wim 34:e5a0dcb43ecc 46 //const char udc_0E[] = {0x0E, 0x13, 0x15, 0x15, 0x15, 0x19, 0x0E, 0x00}; //Ø
wim 34:e5a0dcb43ecc 47 //const char udc_Ao[] = {0x0E, 0x0A, 0x0E, 0x11, 0x1F, 0x11, 0x11, 0x00}; //Å
wim 34:e5a0dcb43ecc 48 //const char udc_PO[] = {0x04, 0x0A, 0x0A, 0x1F, 0x1B, 0x1B, 0x1F, 0x00}; //Padlock Open
wim 34:e5a0dcb43ecc 49 //const char udc_PC[] = {0x1C, 0x10, 0x08, 0x1F, 0x1B, 0x1B, 0x1F, 0x00}; //Padlock Closed
wim 34:e5a0dcb43ecc 50
wim 34:e5a0dcb43ecc 51 //const char udc_alpha[] = {0x00, 0x00, 0x0D, 0x12, 0x12, 0x12, 0x0D, 0x00}; //alpha
wim 34:e5a0dcb43ecc 52 //const char udc_ohm[] = {0x0E, 0x11, 0x11, 0x11, 0x0A, 0x0A, 0x1B, 0x00}; //ohm
wim 34:e5a0dcb43ecc 53 //const char udc_sigma[] = {0x1F, 0x08, 0x04, 0x02, 0x04, 0x08, 0x1F, 0x00}; //sigma
wim 34:e5a0dcb43ecc 54 //const char udc_pi[] = {0x1F, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x00}; //pi
wim 34:e5a0dcb43ecc 55 //const char udc_root[] = {0x07, 0x04, 0x04, 0x04, 0x14, 0x0C, 0x04, 0x00}; //root
wim 34:e5a0dcb43ecc 56
wim 34:e5a0dcb43ecc 57 const char udc_0[] = {0x18, 0x14, 0x12, 0x11, 0x12, 0x14, 0x18, 0x00}; // |>
wim 34:e5a0dcb43ecc 58 const char udc_1[] = {0x03, 0x05, 0x09, 0x11, 0x09, 0x05, 0x03, 0x00}; // <|
wim 34:e5a0dcb43ecc 59 const char udc_2[] = {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00}; // |
wim 34:e5a0dcb43ecc 60 const char udc_3[] = {0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00}; // ||
wim 34:e5a0dcb43ecc 61 const char udc_4[] = {0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x00}; // |||
wim 34:e5a0dcb43ecc 62 const char udc_5[] = {0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00}; // =
wim 34:e5a0dcb43ecc 63 const char udc_6[] = {0x15, 0x0a, 0x15, 0x0a, 0x15, 0x0a, 0x15, 0x00}; // checkerboard
wim 34:e5a0dcb43ecc 64 const char udc_7[] = {0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x10, 0x00}; // \
wim 34:e5a0dcb43ecc 65
wim 34:e5a0dcb43ecc 66 const char udc_degr[] = {0x06, 0x09, 0x09, 0x06, 0x00, 0x00, 0x00, 0x00}; // Degree symbol
wim 34:e5a0dcb43ecc 67
wim 34:e5a0dcb43ecc 68 const char udc_TM_T[] = {0x1F, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00}; // Trademark T
wim 34:e5a0dcb43ecc 69 const char udc_TM_M[] = {0x11, 0x1B, 0x15, 0x11, 0x00, 0x00, 0x00, 0x00}; // Trademark M
wim 34:e5a0dcb43ecc 70
wim 34:e5a0dcb43ecc 71 //const char udc_Bat_Hi[] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00}; // Battery Full
wim 34:e5a0dcb43ecc 72 //const char udc_Bat_Ha[] = {0x0E, 0x11, 0x13, 0x17, 0x1F, 0x1F, 0x1F, 0x00}; // Battery Half
wim 34:e5a0dcb43ecc 73 //const char udc_Bat_Lo[] = {0x0E, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x00}; // Battery Low
wim 34:e5a0dcb43ecc 74 //const char udc_Bat_Hi[] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00}; // Battery Full
wim 34:e5a0dcb43ecc 75 //const char udc_Bat_Ha[] = {0x0E, 0x11, 0x11, 0x1F, 0x1F, 0x1F, 0x1F, 0x00}; // Battery Half
wim 34:e5a0dcb43ecc 76 //const char udc_Bat_Lo[] = {0x0E, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x1F, 0x00}; // Battery Low
wim 34:e5a0dcb43ecc 77 const char udc_Bat_Hi[] = {0x8E, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x00}; // Battery Full, Blink
wim 34:e5a0dcb43ecc 78 const char udc_Bat_Ha[] = {0x8E, 0x91, 0x91, 0x9F, 0x9F, 0x9F, 0x9F, 0x00}; // Battery Half, Blink
wim 34:e5a0dcb43ecc 79 const char udc_Bat_Lo[] = {0x8E, 0x91, 0x91, 0x91, 0x91, 0x9F, 0x9F, 0x00}; // Battery Low, Blink
wim 34:e5a0dcb43ecc 80 const char udc_AC[] = {0x0A, 0x0A, 0x1F, 0x11, 0x0E, 0x04, 0x04, 0x00}; // AC Power
wim 34:e5a0dcb43ecc 81
wim 34:e5a0dcb43ecc 82 const char udc_smiley[] = {0x00, 0x0A, 0x00, 0x04, 0x11, 0x0E, 0x00, 0x00}; // Smiley
wim 34:e5a0dcb43ecc 83 //const char udc_droopy[] = {0x00, 0x0A, 0x00, 0x04, 0x00, 0x0E, 0x11, 0x00}; // Droopey
wim 34:e5a0dcb43ecc 84 //const char udc_note[] = {0x01, 0x03, 0x05, 0x09, 0x0B, 0x1B, 0x18, 0x00}; // Note
wim 34:e5a0dcb43ecc 85
wim 34:e5a0dcb43ecc 86 //const char udc_bar_1[] = {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00}; // Bar 1
wim 34:e5a0dcb43ecc 87 //const char udc_bar_2[] = {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00}; // Bar 11
wim 34:e5a0dcb43ecc 88 //const char udc_bar_3[] = {0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x00}; // Bar 111
wim 34:e5a0dcb43ecc 89 //const char udc_bar_4[] = {0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x00}; // Bar 1111
wim 34:e5a0dcb43ecc 90 //const char udc_bar_5[] = {0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00}; // Bar 11111
wim 34:e5a0dcb43ecc 91
wim 34:e5a0dcb43ecc 92 //const char udc_ch_1[] = {0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00}; // Hor bars 4
wim 34:e5a0dcb43ecc 93 //const char udc_ch_2[] = {0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f}; // Hor bars 4 (inverted)
wim 34:e5a0dcb43ecc 94 //const char udc_ch_3[] = {0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15}; // Ver bars 3
wim 34:e5a0dcb43ecc 95 //const char udc_ch_4[] = {0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a}; // Ver bars 3 (inverted)
wim 34:e5a0dcb43ecc 96 //const char udc_ch_yr[] = {0x08, 0x0f, 0x12, 0x0f, 0x0a, 0x1f, 0x02, 0x02}; // Year (kana)
wim 34:e5a0dcb43ecc 97 //const char udc_ch_mo[] = {0x0f, 0x09, 0x0f, 0x09, 0x0f, 0x09, 0x09, 0x13}; // Month (kana)
wim 34:e5a0dcb43ecc 98 //const char udc_ch_dy[] = {0x1f, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, 0x1F}; // Day (kana)
wim 34:e5a0dcb43ecc 99 //const char udc_ch_mi[] = {0x0C, 0x0a, 0x11, 0x1f, 0x09, 0x09, 0x09, 0x13}; // minute (kana)
wim 34:e5a0dcb43ecc 100
wim 34:e5a0dcb43ecc 101 //const char udc_bell[] = {0x04,0x0E,0x0E,0x0E,0x1F,0x00,0x04};
wim 34:e5a0dcb43ecc 102 //const char udc_note[] = {0x02,0x03,0x02,0x0E,0x1E,0x0C,0x00};
wim 34:e5a0dcb43ecc 103 //const char udc_clock[] = {0x00,0x0E,0x15,0x17,0x11,0x0E,0x00};
wim 34:e5a0dcb43ecc 104 //const char udc_heart[] = {0x00,0x0a,0x1F,0x1F,0x0E,0x04,0x00};
wim 34:e5a0dcb43ecc 105 //const char udc_duck[] = {0x00,0x0c,0x1D,0x0F,0x0F,0x06,0x00};
wim 34:e5a0dcb43ecc 106 //const char udc_check[] = {0x00,0x01,0x03,0x16,0x1C,0x08,0x00};
wim 34:e5a0dcb43ecc 107 //const char udc_cross[] = {0x00,0x1B,0x0E,0x04,0x0E,0x1B,0x00};
wim 34:e5a0dcb43ecc 108 //const char udc_retarrow[] = {0x01,0x01,0x05,0x09,0x1f,0x08,0x04};
wim 34:e5a0dcb43ecc 109
wim 34:e5a0dcb43ecc 110 const char udc_None[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
wim 34:e5a0dcb43ecc 111 const char udc_All[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
wim 34:e5a0dcb43ecc 112 #endif /* UDC_EXAMPLES */