Background technology
LCDs LCD was widely used in the embedded digital product miscellaneous as a kind of low in energy consumption, display device that volume is little, radiationless in recent years.In the current all kinds of embedded system development design, memory module is indispensable importance.The flash storer has series of advantages such as volume is little, capacity is big, cost is low, the power down data are not lost as a kind of safe, memory bank fast.Progressively replace other semiconductor memory component at present, become the main carrier of data and program in the embedded system.In market competition fierce day by day today, the share of product in market improves in order to enhance competitiveness in digital product manufacturer, and increasing manufacturer sells to overseas a plurality of country with product, supports that multi-lingual digital electronic goods just arise at the historic moment.
Based on the digital product of Linux and Windows Mobile operating system, all have to show multi-lingual function.Installed System Memory is all bigger, and type matrix is a dynamic load, at first in internal memory, opens up a zone, and the formed word module information of loading a part of conventional characters safeguards that simultaneously a mapping table is used for inquiring about type matrix and whether is present in the internal memory in internal memory.Like this can take a large amount of internal memories, for little memory system, be definitely worthless.And prior art do not combine the characteristic of black and white LCD and the lattice information store status of type matrix, and display efficiency is not high.
Goal of the invention
The object of the invention is to provide a kind of display packing that in little memory system, shows multiple character fast; This method combines the lattice information store status of type matrix with the characteristic of vertical arrangement mode of black and white LCD; And adopt and show that a type matrix loads the mode of a type matrix, saves memory source.
The object of the invention can be realized through following scheme: based on the multilingual character display method of the little internal memory of nand flash; It is characterized in that; Formed word module information saves as several continuous pages or leaves, and each page or leaf comprises that M binary number, each binary number comprise N position; The corresponding successively black and white LCD of each binary number goes up a hurdle (column) of display matrix; Each position basipetal each display dot in the last hurdle of corresponding successively black and white LCD from the low level to a high position in the binary number; Each 1 and 0 representes that respectively black and white LCD goes up the open and closed of corresponding display dot; Each page formed the display matrix of a M*N; All pages or leaves of this type matrix vertically rearrange and need characters displayed.
The present invention can also do following improvement:
In order to save memory source, described formed word module information all is stored on the nandflash with conversion code table (codepage), just the information of this type matrix is read and load into internal memory when using a type matrix.
In order efficiently to obtain character pattern data, described formed word module information reads process and adopts naked the reading of nand flash, promptly without file system and MTD layer (Memory Technology Drivers, memory technology equipment), directly from nand flash reading of data.
Need characters displayed in order efficiently to search, the storage base unit of described formed word module information is 1/4th of a page or leaf (2048 byte), i.e. 512 bytes.
The present invention is for fear of the appearance of mess code, and at first the size according to object space calculates the character quantity that will change; Be to use still a plurality of byte representations according to this corresponding code table of encoding at character of identification then, draw the required byte number of this character code; Search all characters of this space at last successively, draw shared total bytes.
The advantage of the relative prior art of the present invention is: according to the characteristic of vertical arrangement mode of black and white LCD, in the naked formed word module information of depositing of nand flash, practiced thrift Installed System Memory and improved the character display speed; The content that shows different bytes mixing can avoid causing mess code through the character conversion function, has solved multilingual and has shown the common fault that has simultaneously.
Embodiment
In order to save cost, enhance competitiveness, generally adopt little internal memory embedded system of physical memory 192k.Because system need support the demonstration of multilingual character, the local code of various language needs change in a large number code tables with single sign indicating number (Unicode) conversion the time, with the code table information stores of different conversion code tables (codepage) in nand flash.In little memory system of internal memory anxiety, seem like this and particularly difficulty,, the conversion code table is adopted instant mode of getting through the naked mode of reading of nand flash therefore in order to save the use of internal memory.Without file system and MTD layer, directly from nand flash reading of data.
The structure of hand over word gauge outfit information mainly is used for storing the header and the right skew of location correspondence code epiphase of current conversion code table.Some nand flash information that the location code table of conversion code table needs are used the global variable record.
With 132 of main flow * 65 a black and white LCD, the KS0724 of Samsung is an example, and the built-in video memory of LCD (video memory is to be used for the region of memory that LCD shows, is the inner module of LCD) distributes as shown in Figure 1.The matrix that can find out whole 65 row * 132 row is following by cutting:
1, row is 9 pages or leaves by cutting, and wherein page0 is 8 bit wides to page7, adapts to 8 MPU interfaces and writes 1 byte data at every turn.Page8 is 1 bit wide, only is used for the lowest order of 1 byte data that 8 MPU interfaces write at every turn.Therefore, 65 row are divided into the page or leaf of 88 bit wides and the page or leaf of 11 bit wide.The page0 of page or leaf can be used for showing square literal or picture that as shown in Figure 1, page0 has shown " S " to page7, page1 has shown " A " ..., page6 has shown " M ", page7 has shown "-".And the page8 of wire is used to show complementary icon, like certain bar underscore or point.Only consider to use page0, i.e. 64 points of rectangular confession of 88 bit wides to page7.
2, row are divided into 132 hurdles, and 1 hurdle is 1 vertical line.The hurdle adds 1 characteristic after having visit automatically, and this point helps in same page or leaf, the byte content that writes or read a page or leaf continuously.System has only used column 0 to 127 (i.e. 128 row), and residue 4 row are temporary transient idle.The video memory size is (8 * 8) * 128=64 * 128 dot.
System has specified page or leaf and hurdle, has promptly confirmed one 8 vertical bar, at this time writes a byte through 8 MPU interfaces, promptly can be shown in this vertical bar zone, and the arrangement mode of LCD video memory is longitudinally.Like " A " word of Fig. 1, need to write " 0,111 1110 " toward the column 0 of page1, column 1 writes " 00010001 ", and column 2 writes " 0,001 0001 ", and column 3 writes " 0,001 0001 ", and column4 writes " 0,111 1110 ".At this time utilize the hurdle to add 1 characteristic automatically, only need begin to have specified page number most is 0, and column is 0, writes above 5 bytes continuously, and complete " A " word has just shown.According to the LCD video memory character of arrangement mode longitudinally, the formed word module information of " A " word on nand flash is stored as (01111110,00010001,00010001,00010001,01111110,00000000,00000000,00000000).
According to the number of pages cutting is some pages or leaves, and column number adds 1 physical characteristics automatically.Being defined as height to a viewing area is 8 * n (n is 1 to 8 integer), and wide is the rectangle of 1 to 128 integer.The coboundary of this rectangle is capable at the DB0 of certain page, and lower limb is capable at the DB7 of certain page, and is as shown in Figure 2.Refreshing of LCD is that earlier direction increases along the hurdle, increases along page orientation again, as shown in Figure 3 (content area numerical value change from small to big the direction that expression refreshes).
In the system data structure definition of formed word module information the width and the font position of left side-play amount of font position, character contour be the side-play amount that right-hand font is reserved.Because the arrangement mode of the LCD video memory that system uses is longitudinally, be to be base unit with 8 vertical bars, the direction of page or leaf is carried out access behind the first hurdle, so the storage order of the lattice information of 16*16 is as shown in Figure 4.
Can find out that a formed word module information needs 16*16/8+4=36 (byte); Per 512 bytes can be stored 14 type matrixes (filling a vacancy in remaining space) when therefore storing; The piece (256KB) of main flow MLC nand flash can be stored 7168 type matrixes altogether, so 65536 single codeword symbols need 10 piece storage formed word module information altogether.More efficient in order when reading, to be left the space of 36 bytes and to obtain formed word module information, the space of the 40k that left a blank in the time of the storage type matrix.The formed word module information that " greatly " word among Fig. 4 is stored on nand flash is preceding 4 information that byte is formed word module information T_FONT_ABC, back 32 lattice informations that byte is a character in proper order.
Read and the procedure for displaying of type matrix are:
According to the display language of the coding of wanting characters displayed with system's setting at present, search the conversion code table that is stored on the nandflash, just can get access to the single sign indicating number coding of this character.Know a single codeword symbol (unsigned short type), the piece that the formed word module information that navigates to this character correspondence that just can be very fast is stored on nand flash, which 512 bytes (offset) in page or leaf and the page or leaf, computing formula is following:
block?=font2block[Unicode/(14*4*128)];
page =(Unicode%(14*4*128))/128;
offset=((Unicode%(14*4*128))%128)/512。
Because the public buffer storer (buffer) of the shared LCD of 512 byte formed word module information that reads out; From the public memory buffer of LCD, retrieve the formed word module information of single sign indicating number then; Move formed word module information and deliver to the LCD demonstration, only show a word at every turn to the first address of memory buffer.
In order to read type matrix fast and to ensure the reliability that type matrix writes,, but select 512 bytes as the base unit of depositing formed word module information not with the page or leaf size (2048 byte) of main flow nand flash base unit as store byte.Reason is: in its life cycle, keep the reliable of performance because the technology of nand flash can not be guaranteed the MemoryArray (storage array) of nand flash.Therefore, can produce bad piece in the production of nand flash and in the use.In order to detect the reliability of data, in the system that uses nand flash, generally all can adopt certain defective-area management strategy, and the prerequisite of management bad block be can be reliable the bad block that carries out detect.During nand flash handles, adopt ECC (Error Checking and Correcting bug check and correction) as data verification method.The page or leaf of used nand flash is 2048 bytes; Want characters displayed in order to search efficiently; Not with the base unit of page or leaf as store byte, but the error correction length of the minimum that needs according to ECC is come the refinement storage cell; With 1/4th of a page or leaf, promptly 512 bytes are as the base unit of depositing formed word module information.
In the process that shows Chinese character; Displaying contents often is that Chinese character and ASCII character mix, because Chinese character is made up of 2 bytes, ASCII character is a byte; If the number in the ASCII number in the displaying contents is an odd number, the phenomenon of mess code will appear in the demonstration of ASCII character back Chinese character.Because the character in some codings is not to take identical storage space; Byte number shared when for example being Chinese character in the Chinese character code with English storage is different, so before not converting single sign indicating number to, be not know its concrete character number for a succession of character.Can know after the conversion because single all characters of sign indicating number coding all are to store with two bytes.Bring difficulty so just for the intercepting of the demonstration of e-book, if will cause the mess code of character demonstration from the middle intercepting of a Chinese character (taking two bytes).Other system all is after finishing for a string character string conversion, in demonstration that character is set type.So just need open up very big memory headroom, inadvisable for mini system.To this phenomenon, provide an algorithm that solves mess code: in the time of with a string character string converting into target space, can be according to the size of object space, the character of conversion some, and return the byte number of having changed.Byte of code table identification according under the correspondence coding of its inside is character of expression under corresponding codes, still says and the character of several expression that needs with remaining.Like this just need not open up very big internal memory, do the demonstration and the composing of font.Give a string character, when showing, can obtain corresponding character through this algorithm successively and show, up to the ending that is shown to delegation.And return the byte number of demonstration.The byte number that upper layer application just can then show a string character skew, then next line shows.
The present invention reads the characteristic on hurdle according to LCD display, and the storage mode of type matrix is combined with it, obtains saving internal memory, the effect of searching fast.