
DOCUMENT NUMBER :E-M-0001-00
C++ Sample Code Y-Series
13/18 E2
−
5008
−
00
4.6
User-Definable Font – Flash ROM
DEFINING FONTS (Fig. 4-9 and Fig. 4-10)
DISPLAYING CHARACTERS (Fig. 4-8)
B7
(MSB)
B6 B5 B4 B3 B2 B1 B0
(LSB)
BYTE 1
P8 P7 P6 P5 P4 P3 P2
P1
BYTE 2
P16 P15
P14
P13
P12
P11
P10 P9
BYTE 3
P24 P23 P22 P21 P20 P19 P18
P17
BYTE 4
P32 P31 P30 P29 P28 P27 P26
P25
BYTE 5
P40 P39 P38 P37 P36 P35 P34
P33
Each bit value is logic level one, in Fig. 4-9, Fig. 4-10 and Table 4-2, if a
pixel is ON, whereas the value is logic level zero if a pixel is OFF. The
character code address location of Fig. 4-9 and Fig. 4-10 are 20h and
21h respectively in this example.
Fig. 4-9
Fig. 4-10
Table 4-2
Fig. 4-8
void defining_rom_user_font( )
{
const int command_set [1137] = {
0x1F, 0x28, 0x65, 0x01, 0x49, 0x4E, //User Setup Mode
0x1F, 0x28, 0x65, 0x14,
//Define ROM User Font
0x00,
//BYTE 1 DATA
0x62,
//BYTE 2 DATA
0xCE,
//BYTE 3 DATA
0x31,
//BYTE 4 DATA
0x04,
//BYTE 5 DATA
0x82,
//BYTE 1 DATA
0x24,
//BYTE 2 DATA
0xA5,
//BYTE 3 DATA
Example 4-7
User-definable font – Flash ROM is stored (224 characters:
20h ~ FFh) and displayed in a horizontal orientation. All
224 character data has to be defined at once, so dummy
blank data is stored in the unused memory space. Example
4-7 defines two symbols (Fig. 4-9 and Fig. 4-10), and
Example 4-8 displays the symbols and some characters
(Fig. 4-8). An initialization of the module does not clear
defined ROM user fonts.
0x12,
//BYTE 4 DATA
0x11,
//BYTE 5 DATA
0x00, 0x00, 0x00, 0x00, 0x00,
//Dummy Blank Data
·····Input 5×220 = 1,100 0x00s as dummy blank data·····
0x00, 0x00, 0x00, 0x00, 0x00,
//Dummy Blank Data
0x1F, 0x28, 0x65, 0x02, 0x4F, 0x55, 0x54};
//User
Setup
Mode
for(n = 0; n < 1137; n++)
{
data = command_set [n];
parallel_out (data);
}
}
void displaying_rom_user_font( )
{
const int command_set [42] = {
0x1F, 0x24, 0x05, 0x00, 0x00, 0x00, //Cursor Position
0x53, 0x50, 0x45, 0x41, 0x4B, 0x45, 0x52, 0x20, 0x56,
0x4F, 0x4C, 0x55, 0x4D, 0x45,
//Character Code
0x1B, 0x74, 0xFF,
//Select Font Type
0x1F, 0x24, 0x0A, 0x00, 0x02, 0x00, //Cursor Position
0x20,
0x21,
//Character
Code
Example 4-8
0x1B, 0x74, 0x00,
//Select Font Type
0x1F, 0x24, 0x0D, 0x00, 0x02, 0x00 //Cursor Position
0x34,
0x35};
//Character
Code
for(n = 0; n < 42; n++)
{
data = command_set [n];
parallel_out (data);
}
}