aula 25

Dependents:   Aula25 Onda_lcd

Committer:
ligeiro13
Date:
Mon May 20 22:06:39 2019 +0000
Revision:
0:7b0da2d7a4e4
aps 4

Who changed what in which revision?

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