00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include "lcd.h"
00042
00043
00044
00045
00046
00047
00048 typedef enum {
00049 LCD_DUTY_STATIC = 0,
00050 LCD_DUTY_HALF = 1,
00051 LCD_DUTY_THIRD = 2,
00052 LCD_DUTY_QUART = 3
00053 } lcd_duty_t;
00054
00055 typedef enum {
00056 LCD_PM_0_12 = 0x0,
00057 LCD_PM_0_14 = 0x1,
00058 LCD_PM_0_16 = 0x2,
00059 LCD_PM_0_18 = 0x3,
00060 LCD_PM_0_20 = 0x4,
00061 LCD_PM_0_22 = 0x5,
00062 LCD_PM_0_23 = 0x6,
00063 LCD_PM_0_24 = 0x7,
00064 LCD_PM_0_26 = 0x8,
00065 LCD_PM_0_28 = 0x9,
00066 LCD_PM_0_30 = 0xA,
00067 LCD_PM_0_32 = 0xB,
00068 LCD_PM_0_34 = 0xC,
00069 LCD_PM_0_36 = 0xD,
00070 LCD_PM_0_38 = 0xE,
00071 LCD_PM_0_39 = 0xF
00072 } lcd_pm_t;
00073
00074 #if defined( DOXYGEN )
00075 static const seg_map[];
00076 static const LCD_character_table[];
00077 static const seg_inf[];
00078 static const lcd_symbol_chart[LCD_SYMBOL_COUNT];
00079 #else
00080
00081
00082 static const unsigned char seg_map[] PROGMEM = {
00083 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F ,
00084 NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C ,
00085 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B| NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E| NUM_LCD_SYMBOL_G,
00086 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D| NUM_LCD_SYMBOL_G,
00087 NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C| NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00088 NUM_LCD_SYMBOL_A| NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D| NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00089 NUM_LCD_SYMBOL_A| NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00090 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C ,
00091 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00092 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D| NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00093 NUM_LCD_SYMBOL_A|NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C| NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00094 NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00095 NUM_LCD_SYMBOL_A| NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F ,
00096 NUM_LCD_SYMBOL_B|NUM_LCD_SYMBOL_C|NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E| NUM_LCD_SYMBOL_G,
00097 NUM_LCD_SYMBOL_A| NUM_LCD_SYMBOL_D|NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00098 NUM_LCD_SYMBOL_A| NUM_LCD_SYMBOL_E|NUM_LCD_SYMBOL_F|NUM_LCD_SYMBOL_G,
00099 0,
00100 NUM_LCD_SYMBOL_G
00101 };
00102
00103
00104
00105 static const unsigned int LCD_character_table[] PROGMEM =
00106 {
00107 0x0000,
00108 0x2830,
00109 0x0000,
00110 0x0810,
00111 0x0200,
00112 0x0240,
00113 0x93C5,
00114 0x80C0,
00115 0x1994,
00116 0x9894,
00117 0x8891,
00118 0x9815,
00119 0x9915,
00120 0x8084,
00121 0x9995,
00122 0x9895,
00123 0x0000,
00124 0x0000,
00125 0x0000,
00126 0x0000,
00127 0x0202,
00128 0x0000,
00129 0x8E53,
00130 0x8995,
00131 0xB8A4,
00132 0x1105,
00133 0xB0A4,
00134 0x1915,
00135 0x0915,
00136 0x9905,
00137 0x8991,
00138 0x2020,
00139 0x9180,
00140 0x0551,
00141 0x1101,
00142 0x81C3,
00143 0x8583,
00144 0x9185,
00145 0x0995,
00146 0x9585,
00147 0x0D95,
00148 0x1406,
00149 0x2024,
00150 0x9181,
00151 0x0341,
00152 0x8781,
00153 0x0642,
00154 0x2042,
00155 0x1244,
00156 0x0000,
00157 0x0000,
00158 0x0000,
00159 0x0000,
00160 0x0000,
00161 0x0004,
00162 0x0080,
00163 0x8000,
00164 0x1000,
00165 0x0100,
00166 0x0001,
00167 0x0002,
00168 0x0020,
00169 0x0040,
00170 0x0800,
00171 0x0400,
00172 0x2000,
00173 0x0200,
00174 0x0010,
00175 0x0000,
00176 0x0000,
00177 0x0000
00178 };
00179
00180
00181 static const unsigned char seg_inf[] PROGMEM = {
00182 2<<5|19,
00183 1<<5|19,
00184 1<<5|9,
00185 2<<5|4,
00186 2<<5|9,
00187 2<<5|14,
00188 1<<5|14
00189 };
00190
00191
00192 static const lcd_symbol_t lcd_symbol_chart[LCD_SYMBOL_COUNT] PROGMEM= {
00193
00194 LCD_SYMBOL_RAVEN ,
00195
00196
00197 LCD_SYMBOL_BELL ,
00198 LCD_SYMBOL_TONE ,
00199 LCD_SYMBOL_MIC ,
00200 LCD_SYMBOL_SPEAKER ,
00201
00202
00203 LCD_SYMBOL_KEY ,
00204 LCD_SYMBOL_ATT ,
00205
00206
00207 LCD_SYMBOL_SUN ,
00208 LCD_SYMBOL_MOON ,
00209 LCD_SYMBOL_AM ,
00210 LCD_SYMBOL_PM ,
00211
00212
00213 LCD_SYMBOL_RX ,
00214 LCD_SYMBOL_TX ,
00215 LCD_SYMBOL_IP ,
00216 LCD_SYMBOL_PAN ,
00217 LCD_SYMBOL_ZLINK ,
00218 LCD_SYMBOL_ZIGBEE ,
00219
00220
00221 LCD_SYMBOL_ANT_FOOT,
00222 LCD_SYMBOL_ANT_SIG1,
00223 LCD_SYMBOL_ANT_SIG2,
00224 LCD_SYMBOL_ANT_SIG3,
00225 LCD_SYMBOL_ANT_DIS ,
00226
00227
00228 LCD_SYMBOL_BAT_CONT,
00229 LCD_SYMBOL_BAT_CAP1,
00230 LCD_SYMBOL_BAT_CAP2,
00231 LCD_SYMBOL_BAT_CAP3,
00232
00233
00234 LCD_SYMBOL_ENV_OP ,
00235 LCD_SYMBOL_ENV_CL ,
00236 LCD_SYMBOL_ENV_MAIN,
00237
00238
00239 LCD_SYMBOL_C ,
00240 LCD_SYMBOL_F ,
00241
00242
00243 LCD_SYMBOL_MINUS ,
00244 LCD_SYMBOL_DOT ,
00245 LCD_SYMBOL_COL
00246 };
00247 #endif
00248
00249
00250 static unsigned char lcd_text[20];
00251
00252
00253 static int lcd_text_rd_ptr = 0;
00254
00255
00256 static int lcd_text_wr_ptr = 0;
00257
00258 static bool lcd_scroll_enable;
00259 static int lcd_scroll_prescale;
00260 static int lcd_scroll_prescale_value;
00261 static int lcd_num_print(uint16_t numb, bool negative, lcd_padding_t padding);
00262 static void lcd_nmb_print_dig(uint8_t val, int dig);
00263 static int lcd_text_sl(void);
00264 static int lcd_text_put(const char* s, int pos);
00265 static int lcd_char_put(unsigned char c, int pos);
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276 int
00277 lcd_init(void)
00278 {
00279
00280
00281
00282
00283
00284
00285
00286 lcd_config_t lcd_config ;
00287 lcd_config.blanking = LCD_BLANKING_OFF;
00288 lcd_config.buffer = LCD_BUFFER_ON;
00289 lcd_config.wave = LCD_WAVE_LOW_POWER;
00290 lcd_config.clock = LCD_CLOCK_EXTERN;
00291 lcd_config.bias = LCD_BIAS_HALF;
00292 lcd_config.prescl = LCD_PRESCL_16;
00293 lcd_config.div = LCD_DIV_8;
00294 lcd_config.drive = LCD_DRIVE_450;
00295 lcd_config.contrast = LCD_CONTRAST_3_30;
00296
00297
00298 PRR &= ~(1 << PRLCD);
00299
00300
00301 LCDCRB = lcd_config.lcdcrb|(LCD_PM_0_39<<LCDPM0)|(LCD_DUTY_QUART<<LCDMUX0);
00302 LCDFRR = lcd_config.lcdfrr;
00303 LCDCCR = lcd_config.lcdccr;
00304 LCDCRA = lcd_config.lcdcra|(1<<LCDEN)|(1<<LCDIE);
00305
00306
00307 lcd_symbol_clr_all();
00308
00309
00310 lcd_scroll_prescale_value = LCD_CLCK_FRQ/128;
00311 lcd_scroll_prescale_value >>= (lcd_config.prescl == 0) ? 4 : (5+lcd_config.prescl);
00312 lcd_scroll_prescale_value /= (lcd_config.div+1);
00313 lcd_scroll_prescale_value = (lcd_scroll_prescale_value==0) ? 1 : lcd_scroll_prescale_value;
00314 lcd_scroll_prescale = lcd_scroll_prescale_value;
00315
00316 return 0;
00317 }
00318
00319
00320
00321
00322
00323
00324 void
00325 lcd_deinit(void)
00326 {
00327 while (!(LCDCRA & (1<<LCDIF)))
00328 ;
00329
00330
00331
00332
00333
00334 LCDCRA = (1<<LCDEN)|(1<<LCDIF)|(1<<LCDBL);
00335
00336 while ( !(LCDCRA & (1<<LCDIF)) )
00337 ;
00338
00339
00340 LCDCRA = (0<<LCDEN) | (0<<LCDIE);
00341
00342
00343 PRR |= (1 << PRLCD);
00344 }
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 uint8_t
00356 itobcd(uint8_t inNumber)
00357 {
00358 int newByte;
00359
00360 newByte = 0;
00361
00362 while (inNumber >= 10){
00363 inNumber -= 10;
00364 newByte++;
00365 }
00366
00367 newByte = newByte << 4;
00368 newByte = (newByte | inNumber);
00369
00370 return newByte;
00371 }
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 int
00385 lcd_num_puthex(uint16_t numb, lcd_padding_t padding)
00386 {
00387 return lcd_num_print(numb, false, padding);
00388 }
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401 int
00402 lcd_num_putdec(int numb, lcd_padding_t padding)
00403 {
00404 uint16_t bcd;
00405
00406
00407 if (numb > 9999) {
00408 numb = 9999;
00409 } else if (numb < -9999) {
00410 numb = -9999;
00411 }
00412
00413
00414 bcd = itobcd(abs(numb));
00415
00416
00417 return lcd_num_print(bcd, (bool)(numb<0), padding);
00418 }
00419
00420
00421
00422
00423
00424
00425
00426
00427 int
00428 lcd_num_clr(void)
00429 {
00430 volatile unsigned char* lcd_data = (volatile unsigned char*)0xEC;
00431 int i,j;
00432
00433 for (i=0;i<4;++i){
00434 for (j=0;j<7;++j){
00435 lcd_data[pgm_read_byte(&seg_inf[j])&0x1F] &= ~((pgm_read_byte(&seg_inf[j])>>5)<<(i*2));
00436 }
00437 }
00438 return 0;
00439 }
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450 int
00451 lcd_puts(const char* s)
00452 {
00453 strcpy((char*)lcd_text, s);
00454 lcd_text_wr_ptr = strlen(s);
00455 lcd_text_rd_ptr = 0;
00456
00457 lcd_text_put((char*)&lcd_text[lcd_text_rd_ptr], 1);
00458
00459 lcd_scroll_enable = (lcd_text_wr_ptr > 7) ? true : false;
00460
00461 return 0;
00462 }
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474 int
00475 lcd_puta(size_t length, const uint8_t *s)
00476 {
00477 memcpy((void*)lcd_text, (void const*)s, length);
00478 lcd_text_wr_ptr = length;
00479 lcd_text_rd_ptr = 0;
00480
00481 lcd_text_put((char*)&lcd_text[lcd_text_rd_ptr], 1);
00482
00483 lcd_scroll_enable = (lcd_text_wr_ptr > 7) ? true : false;
00484
00485 return 0;
00486 }
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497 int
00498 lcd_puts_P(const char *s)
00499 {
00500 strcpy_P((char*)lcd_text, s);
00501 lcd_text_wr_ptr = strlen_P(s);
00502 lcd_text_rd_ptr = 0;
00503
00504 lcd_text_put((char*)&lcd_text[lcd_text_rd_ptr], 1);
00505
00506 lcd_scroll_enable = (lcd_text_wr_ptr > 7) ? true : false;
00507
00508 return 0;
00509 }
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520 int
00521 lcd_putchar(unsigned char c)
00522 {
00523 lcd_text[lcd_text_wr_ptr++] = c;
00524 lcd_text[lcd_text_wr_ptr] = 0;
00525
00526 lcd_text_put((char*)&lcd_text[lcd_text_rd_ptr], 1);
00527
00528 lcd_scroll_enable = (lcd_text_wr_ptr > 7) ? true : false;
00529
00530 return 0;
00531 }
00532
00533
00534
00535
00536
00537
00538
00539
00540 void
00541 lcd_symbol_set(lcd_symbol_t symbol)
00542 {
00543 unsigned char mem_offset;
00544 unsigned char bit_offset;
00545 volatile unsigned char* lcd_data = (volatile unsigned char*)0xEC;
00546
00547
00548 bit_offset = (symbol >> 5);
00549 mem_offset = (symbol & 0x1F);
00550 if ( mem_offset >= 20 ){
00551 return;
00552 }
00553 lcd_data = lcd_data + mem_offset;
00554
00555 *lcd_data = *lcd_data | ( 1 << bit_offset);
00556 }
00557
00558
00559
00560
00561
00562
00563
00564
00565 void
00566 lcd_symbol_clr(lcd_symbol_t symbol)
00567 {
00568 unsigned char offset;
00569 unsigned char setbit;
00570 volatile unsigned char* lcd_data = (volatile unsigned char*)0xEC;
00571
00572
00573 setbit = (symbol >> 5);
00574 offset = (symbol & 0x1F);
00575 if ( offset >= 20 ){
00576 return;
00577 }
00578
00579 lcd_data = lcd_data + offset;
00580
00581 *lcd_data = *lcd_data & ~( 1 << setbit);
00582 }
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592 void
00593 lcd_symbol_set_group(int start, int count)
00594 {
00595 count = (start + count)>LCD_SYMBOL_COUNT ?
00596 LCD_SYMBOL_COUNT - start :
00597 count;
00598 int i;
00599
00600 for(i=start; i<start+count; ++i){
00601 lcd_symbol_set(pgm_read_byte(&lcd_symbol_chart[i]));
00602 }
00603 }
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613 void
00614 lcd_symbol_clr_group(int start, int count)
00615 {
00616 count = (start + count)>LCD_SYMBOL_COUNT ?
00617 LCD_SYMBOL_COUNT - start :
00618 count;
00619 int i;
00620
00621 for(i=start; i<count; ++i){
00622 lcd_symbol_clr(pgm_read_byte(&lcd_symbol_chart[i]));
00623 }
00624 }
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637 static int
00638 lcd_num_print(uint16_t numb, bool negative, lcd_padding_t padding)
00639 {
00640 int i;
00641 for (i=0;i<4;) {
00642
00643 lcd_nmb_print_dig(pgm_read_byte(&seg_map[(numb&(0xF<<4*i))>>4*i]), i);
00644
00645
00646 if (++i<4) {
00647 if (numb >> 4*i == 0) {
00648 if (negative == true) {
00649 lcd_nmb_print_dig(pgm_read_byte(&seg_map[(padding == LCD_NUM_PADDING_ZERO) ? LCD_SEV_SEG_INDEX_0 : LCD_SEV_SEG_INDEX_MINUS]), i++);
00650 if (padding == LCD_NUM_PADDING_ZERO) {
00651 lcd_symbol_set(LCD_SYMBOL_MINUS);
00652 }
00653 } else {
00654 lcd_symbol_clr(LCD_SYMBOL_MINUS);
00655 }
00656 while (i<4){
00657 lcd_nmb_print_dig(pgm_read_byte(&seg_map[(padding == LCD_NUM_PADDING_ZERO) ? LCD_SEV_SEG_INDEX_0 : LCD_SEV_SEG_INDEX_SPACE]), i++);
00658 }
00659 }
00660 } else {
00661 if (negative == true) {
00662 lcd_symbol_set(LCD_SYMBOL_MINUS);
00663 } else {
00664 lcd_symbol_clr(LCD_SYMBOL_MINUS);
00665 }
00666 }
00667 }
00668 return 0;
00669 }
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679 static void
00680 lcd_nmb_print_dig(uint8_t val, int dig)
00681 {
00682 volatile unsigned char* lcd_data = (volatile unsigned char*)0xEC;
00683 int j;
00684
00685 for (j=0;j<7;++j){
00686 if (val & (1<<j)) {
00687 lcd_data[pgm_read_byte(&seg_inf[j])&0x1F] |= (pgm_read_byte(&seg_inf[j])>>5)<<(dig*2);
00688 }
00689 else {
00690 lcd_data[pgm_read_byte(&seg_inf[j])&0x1F] &= ~((pgm_read_byte(&seg_inf[j])>>5)<<(dig*2));
00691 }
00692 }
00693 }
00694
00695
00696
00697
00698
00699
00700
00701
00702 static int
00703 lcd_text_sl(void)
00704 {
00705 static int pos = 1;
00706 if (lcd_text[lcd_text_rd_ptr] == 0) {
00707 lcd_text_rd_ptr = 0;
00708 pos = 7;
00709 }
00710 else {
00711 if (pos){
00712 pos--;
00713 }
00714 else {
00715 lcd_text_rd_ptr++;
00716 }
00717 }
00718
00719 lcd_text_put((char*)&lcd_text[lcd_text_rd_ptr], pos);
00720 return 0;
00721 }
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734 static int
00735 lcd_text_put(const char* s, int pos)
00736 {
00737 int i;
00738
00739
00740 for (i=1; i<pos; i++) {
00741 lcd_char_put(' ', i);
00742 }
00743
00744
00745 for ( i=pos; i<=7; ++i) {
00746 if (*s == 0) {
00747 lcd_char_put(' ', i);
00748 }
00749 else {
00750 lcd_char_put( (unsigned char)*s++, i);
00751 }
00752 }
00753 return 0;
00754 }
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767 static int
00768 lcd_char_put(unsigned char c, int pos)
00769 {
00770 unsigned int seg, segMask;
00771 unsigned char i;
00772 unsigned char mask, nibble, nibbleMask;
00773
00774 volatile unsigned char* lcd_data = (volatile unsigned char*)0xEC;
00775 unsigned char lcd_reg;
00776
00777 if (pos > 7){
00778 return EOF;
00779 }
00780
00781
00782 if (((c >= '*') && (c <= 'z')) || (c == ' ')){
00783 if (c >= 'a' ){
00784 c &= ~0x20;
00785 }
00786 if (c == ' ') {
00787 c = 0x00;
00788 }
00789 else {
00790 c -= '*';
00791 }
00792 if ( c > 0x35 ){
00793 return EOF;
00794 }
00795 else{
00796 seg = pgm_read_dword(&LCD_character_table[c]);
00797 }
00798 }
00799 else {
00800 return EOF;
00801 }
00802
00803
00804
00805 segMask = 0x4008;
00806
00807 i = pos-1;
00808 i >>= 1;
00809 lcd_data += i;
00810
00811 i = 4;
00812 do{
00813 nibble = seg & 0x000F;
00814 nibbleMask = segMask & 0x000F;
00815
00816 seg >>= 4;
00817 segMask >>= 4;
00818
00819 if (pos & 0x01) {
00820 mask = 0xF0 | nibbleMask;
00821 }
00822 else {
00823 nibble <<= 4;
00824 mask = 0x0F | ( nibbleMask <<4 );
00825 }
00826 lcd_reg = *lcd_data;
00827 *lcd_data |= (lcd_reg & mask) | nibble;
00828
00829 lcd_reg = *lcd_data;
00830 *lcd_data &= (lcd_reg & mask) | nibble;
00831
00832 lcd_data += 5;
00833 } while ( --i );
00834
00835 return 0;
00836 }
00837
00838
00839
00840
00841
00842
00843
00844
00845 ISR
00846 (LCD_vect)
00847 {
00848 if (lcd_scroll_enable) {
00849 if (--lcd_scroll_prescale == 0) {
00850 lcd_text_sl();
00851 lcd_scroll_prescale = lcd_scroll_prescale_value;
00852 }
00853 }
00854 }
00855
00856
00857
00858
00859
00860
00861 void
00862 led_on(void)
00863 {
00864 DDRB |= 0x80;
00865 PORTB &= ~0x80;
00866 }
00867
00868
00869
00870
00871
00872
00873 void
00874 led_off(void)
00875 {
00876 DDRB &= ~0x80;
00877 PORTB |= 0x80;
00878 }
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889 void
00890 lcd_single_print_dig(uint8_t numb, uint8_t pos)
00891 {
00892 lcd_nmb_print_dig(pgm_read_byte(&seg_map[numb]), pos);
00893 }
00894
00895