TextLCD library for controlling various LCD panels based on the HD44780 4-bit interface

Dependents:   STM32_Button_Interrupt_dla_taty

Committer:
fcalzadas
Date:
Wed Nov 13 21:28:23 2019 +0000
Revision:
9:2db641efba7e
proyecto de LCD

Who changed what in which revision?

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