This code has Pulse sensor and lcd16x2 code

Dependents:   PulseSense

Committer:
EDISON_NGUNJIRI
Date:
Tue Feb 22 19:51:10 2022 +0000
Revision:
0:2ebc137f8f55
PULSE_SENSOR_AND LCD16X2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
EDISON_NGUNJIRI 0:2ebc137f8f55 1 /* mbed TextLCD Library, for LCDs based on HD44780 controllers
EDISON_NGUNJIRI 0:2ebc137f8f55 2 * Copyright (c) 2015, WH
EDISON_NGUNJIRI 0:2ebc137f8f55 3 * 2015, v01: WH, AR. Added UTF8 decode tables for Cyrilic font (by Andriy Ribalko).
EDISON_NGUNJIRI 0:2ebc137f8f55 4 *
EDISON_NGUNJIRI 0:2ebc137f8f55 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
EDISON_NGUNJIRI 0:2ebc137f8f55 6 * of this software and associated documentation files (the "Software"), to deal
EDISON_NGUNJIRI 0:2ebc137f8f55 7 * in the Software without restriction, including without limitation the rights
EDISON_NGUNJIRI 0:2ebc137f8f55 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
EDISON_NGUNJIRI 0:2ebc137f8f55 9 * copies of the Software, and to permit persons to whom the Software is
EDISON_NGUNJIRI 0:2ebc137f8f55 10 * furnished to do so, subject to the following conditions:
EDISON_NGUNJIRI 0:2ebc137f8f55 11 *
EDISON_NGUNJIRI 0:2ebc137f8f55 12 * The above copyright notice and this permission notice shall be included in
EDISON_NGUNJIRI 0:2ebc137f8f55 13 * all copies or substantial portions of the Software.
EDISON_NGUNJIRI 0:2ebc137f8f55 14 *
EDISON_NGUNJIRI 0:2ebc137f8f55 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
EDISON_NGUNJIRI 0:2ebc137f8f55 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
EDISON_NGUNJIRI 0:2ebc137f8f55 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
EDISON_NGUNJIRI 0:2ebc137f8f55 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
EDISON_NGUNJIRI 0:2ebc137f8f55 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
EDISON_NGUNJIRI 0:2ebc137f8f55 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
EDISON_NGUNJIRI 0:2ebc137f8f55 21 * THE SOFTWARE.
EDISON_NGUNJIRI 0:2ebc137f8f55 22 */
EDISON_NGUNJIRI 0:2ebc137f8f55 23 #ifndef MBED_TEXTLCDUTF8_INC
EDISON_NGUNJIRI 0:2ebc137f8f55 24 #define MBED_TEXTLCDUTF8_INC
EDISON_NGUNJIRI 0:2ebc137f8f55 25
EDISON_NGUNJIRI 0:2ebc137f8f55 26 #include "TextLCD_Config.h"
EDISON_NGUNJIRI 0:2ebc137f8f55 27
EDISON_NGUNJIRI 0:2ebc137f8f55 28 #if(LCD_UTF8_FONT == 1)
EDISON_NGUNJIRI 0:2ebc137f8f55 29 // Code by Andriy Ribalko
EDISON_NGUNJIRI 0:2ebc137f8f55 30 // UTF8 conversion, please add other tables for your language
EDISON_NGUNJIRI 0:2ebc137f8f55 31 // See wikipedia.org/wiki/UTF-8 and www.utf8-chartable.de
EDISON_NGUNJIRI 0:2ebc137f8f55 32
EDISON_NGUNJIRI 0:2ebc137f8f55 33 //The two tables below are used to map UTF8 codes onto character codes for an LCD controller that
EDISON_NGUNJIRI 0:2ebc137f8f55 34 //supports a specific fonttable. The UTF codes for a specific language like Cyrilic are between 0x0400 and 0x04FF.
EDISON_NGUNJIRI 0:2ebc137f8f55 35
EDISON_NGUNJIRI 0:2ebc137f8f55 36 //Select one table for a specific controller and language
EDISON_NGUNJIRI 0:2ebc137f8f55 37
EDISON_NGUNJIRI 0:2ebc137f8f55 38 #if(0)
EDISON_NGUNJIRI 0:2ebc137f8f55 39 //Table for controller xxxx
EDISON_NGUNJIRI 0:2ebc137f8f55 40 //The two tables below are used to map Cyrilic/Russian UTF8 codes onto character codes for an LCD controller that
EDISON_NGUNJIRI 0:2ebc137f8f55 41 //supports a Cyrilic fonttable. The UTF codes for Cyrilic are between 0x0400 and 0x04FF
EDISON_NGUNJIRI 0:2ebc137f8f55 42
EDISON_NGUNJIRI 0:2ebc137f8f55 43 #define UTF_FIRST 0x0400
EDISON_NGUNJIRI 0:2ebc137f8f55 44 #define UTF_LAST 0x04FF
EDISON_NGUNJIRI 0:2ebc137f8f55 45 #define UTF_SEQ_REC_FIRST utf_seq_rec_first_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 46 #define UTF_SEQ_REC_LAST utf_seq_rec_last_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 47 #define UTF_SEQ_RECODE utf_seq_recode_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 48 #define UTF_RND_RECODE utf_rnd_recode_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 49
EDISON_NGUNJIRI 0:2ebc137f8f55 50 #define utf_seq_rec_first_cyr 0x0410 //UTF code of first symbol in sequential table UTF_recode
EDISON_NGUNJIRI 0:2ebc137f8f55 51 #define utf_seq_rec_last_cyr 0x044F //UTF code of last symbol in sequential table UTF_recode
EDISON_NGUNJIRI 0:2ebc137f8f55 52
EDISON_NGUNJIRI 0:2ebc137f8f55 53 const char utf_seq_recode_cyr[] = {
EDISON_NGUNJIRI 0:2ebc137f8f55 54 0x41,0xa0,0x42,0xa1, 0xe0,0x45,0xa3,0xa4, 0xa5,0xa6,0x4b,0xa7, 0x4d,0x48,0x4f,0xa8, //Upper case Cyrillic
EDISON_NGUNJIRI 0:2ebc137f8f55 55 0x50,0x43,0x54,0xa9, 0xaa,0x58,0xe1,0xab, 0xac,0xe2,0xad,0xae, 0x62,0xaf,0xb0,0xb1,
EDISON_NGUNJIRI 0:2ebc137f8f55 56 0x61,0xb2,0xb3,0xb4, 0xe3,0x65,0xb6,0xb7, 0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0x6f,0xbe, //Lower case Cyrillic
EDISON_NGUNJIRI 0:2ebc137f8f55 57 0x70,0x63,0xbf,0x79, 0xe4,0x78,0xe5,0xc0, 0xc1,0xe6,0xc2,0xc3, 0xc4,0xc5,0xc6,0xc7
EDISON_NGUNJIRI 0:2ebc137f8f55 58 };
EDISON_NGUNJIRI 0:2ebc137f8f55 59
EDISON_NGUNJIRI 0:2ebc137f8f55 60 //Two dimensional table for some non-sequential symbol decoding (RUS/UKR)
EDISON_NGUNJIRI 0:2ebc137f8f55 61 //U+0401 --> 0xa2 (Ё), U+0451 --> 0xb5 (ё), U+0406 --> 0x49 (І), U+0456 --> 0x69 (і)
EDISON_NGUNJIRI 0:2ebc137f8f55 62 const short int utf_rnd_recode_cyr [5][2]= {
EDISON_NGUNJIRI 0:2ebc137f8f55 63 {0x0401, 0xa2},
EDISON_NGUNJIRI 0:2ebc137f8f55 64 {0x0451, 0xb5},
EDISON_NGUNJIRI 0:2ebc137f8f55 65 {0x0406, 0x49},
EDISON_NGUNJIRI 0:2ebc137f8f55 66 {0x0456, 0x69},
EDISON_NGUNJIRI 0:2ebc137f8f55 67 {0} //Last element table zero
EDISON_NGUNJIRI 0:2ebc137f8f55 68 };
EDISON_NGUNJIRI 0:2ebc137f8f55 69 #endif
EDISON_NGUNJIRI 0:2ebc137f8f55 70
EDISON_NGUNJIRI 0:2ebc137f8f55 71 #if(LCD_UTF8_CYR_B == 1)
EDISON_NGUNJIRI 0:2ebc137f8f55 72 //ROM_B Table for controller SSD1803 and US2066
EDISON_NGUNJIRI 0:2ebc137f8f55 73 //The two tables below are used to map Cyrilic/Russian UTF8 codes onto character codes for an LCD controller that
EDISON_NGUNJIRI 0:2ebc137f8f55 74 //supports a Cyrilic fonttable. The UTF codes for Cyrilic are between 0x0400 and 0x04FF
EDISON_NGUNJIRI 0:2ebc137f8f55 75
EDISON_NGUNJIRI 0:2ebc137f8f55 76 #define UTF_FIRST 0x0400
EDISON_NGUNJIRI 0:2ebc137f8f55 77 #define UTF_LAST 0x04FF
EDISON_NGUNJIRI 0:2ebc137f8f55 78 #define UTF_SEQ_REC_FIRST utf_seq_rec_first_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 79 #define UTF_SEQ_REC_LAST utf_seq_rec_last_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 80 #define UTF_SEQ_RECODE utf_seq_recode_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 81 #define UTF_RND_RECODE utf_rnd_recode_cyr
EDISON_NGUNJIRI 0:2ebc137f8f55 82
EDISON_NGUNJIRI 0:2ebc137f8f55 83 #define utf_seq_rec_first_cyr 0x0410 //UTF code of first symbol in sequential table UTF_recode
EDISON_NGUNJIRI 0:2ebc137f8f55 84 #define utf_seq_rec_last_cyr 0x044F //UTF code of last symbol in sequential table UTF_recode
EDISON_NGUNJIRI 0:2ebc137f8f55 85 const char utf_seq_recode_cyr[] = {
EDISON_NGUNJIRI 0:2ebc137f8f55 86 0x80,0x81,0x82,0x83, 0x84,0x85,0x86,0x87, 0x88,0x89,0x8A,0x8B, 0x8C,0x8D,0x8E,0x8F, //Upper case Cyrillic
EDISON_NGUNJIRI 0:2ebc137f8f55 87 0x90,0x91,0x92,0x93, 0x94,0x95,0x96,0x97, 0x98,0x99,0x9A,0x9B, 0x9C,0x9D,0x9E,0x9F,
EDISON_NGUNJIRI 0:2ebc137f8f55 88 0x61,0x81,0x62,0x83, 0x84,0x65,0x86,0x87, 0x88,0x89,0x6B,0x8B, 0x6D,0x69,0x6F,0x8F, //Lower case Cyrillic (~Upper)
EDISON_NGUNJIRI 0:2ebc137f8f55 89 0x70,0x63,0x92,0x79, 0x94,0x95,0x96,0x97, 0x98,0x99,0x9A,0x9B, 0x9C,0x9D,0x9E,0x9F
EDISON_NGUNJIRI 0:2ebc137f8f55 90 };
EDISON_NGUNJIRI 0:2ebc137f8f55 91
EDISON_NGUNJIRI 0:2ebc137f8f55 92 //Two dimensional table for some non-sequential symbol decoding (RUS/UKR)
EDISON_NGUNJIRI 0:2ebc137f8f55 93 //U+0400 --> 0xC8 (E)
EDISON_NGUNJIRI 0:2ebc137f8f55 94 //U+0401 --> 0xCB (Ё)
EDISON_NGUNJIRI 0:2ebc137f8f55 95 //U+0405 --> 0x53 (S)
EDISON_NGUNJIRI 0:2ebc137f8f55 96 //U+0406 --> 0x49 (І)
EDISON_NGUNJIRI 0:2ebc137f8f55 97 //U+0407 --> 0xCF (І)
EDISON_NGUNJIRI 0:2ebc137f8f55 98 //U+0408 --> 0x4A (J)
EDISON_NGUNJIRI 0:2ebc137f8f55 99 //U+0450 --> 0xE8 ( )
EDISON_NGUNJIRI 0:2ebc137f8f55 100 //U+0451 --> 0xEB (ё)
EDISON_NGUNJIRI 0:2ebc137f8f55 101 //U+0456 --> 0x69 (і)
EDISON_NGUNJIRI 0:2ebc137f8f55 102 //U+0457 --> 0xCF (і)
EDISON_NGUNJIRI 0:2ebc137f8f55 103 //U+0458 --> 0x6A (j)
EDISON_NGUNJIRI 0:2ebc137f8f55 104 const short int utf_rnd_recode_cyr [][2]= {
EDISON_NGUNJIRI 0:2ebc137f8f55 105 {0x0400, 0xC8},
EDISON_NGUNJIRI 0:2ebc137f8f55 106 {0x0401, 0xCB},
EDISON_NGUNJIRI 0:2ebc137f8f55 107 {0x0405, 0x53},
EDISON_NGUNJIRI 0:2ebc137f8f55 108 {0x0406, 0x49},
EDISON_NGUNJIRI 0:2ebc137f8f55 109 {0x0407, 0xCF},
EDISON_NGUNJIRI 0:2ebc137f8f55 110 {0x0408, 0x4A},
EDISON_NGUNJIRI 0:2ebc137f8f55 111 {0x0450, 0xE8},
EDISON_NGUNJIRI 0:2ebc137f8f55 112 {0x0451, 0xEB},
EDISON_NGUNJIRI 0:2ebc137f8f55 113 {0x0456, 0x69},
EDISON_NGUNJIRI 0:2ebc137f8f55 114 {0x0457, 0xCF},
EDISON_NGUNJIRI 0:2ebc137f8f55 115 {0x0458, 0x6A},
EDISON_NGUNJIRI 0:2ebc137f8f55 116 {0 , 0} //Last element table zero
EDISON_NGUNJIRI 0:2ebc137f8f55 117 };
EDISON_NGUNJIRI 0:2ebc137f8f55 118 #endif
EDISON_NGUNJIRI 0:2ebc137f8f55 119
EDISON_NGUNJIRI 0:2ebc137f8f55 120
EDISON_NGUNJIRI 0:2ebc137f8f55 121 //end UTF conversion
EDISON_NGUNJIRI 0:2ebc137f8f55 122 #endif
EDISON_NGUNJIRI 0:2ebc137f8f55 123
EDISON_NGUNJIRI 0:2ebc137f8f55 124 #endif