📄 hdrv_hardinit.lst
字号:
################################################################################
# #
# IAR Systems Z80/64180 Assembler V3.03A/WIN 22/Sep/107 19:36:25 #
# #
# Target option = z80 #
# Source file = d:\case_i_d913f\drv\ui_ssd1332\hdrv\hdrv_hardinit.msa#
# List file = d:\case_i_d913f\drv\ui_ssd1332\ui_ssd13_b\list\hdrv_hardinit.lst#
# Object file = d:\case_i_d913f\drv\ui_ssd1332\ui_ssd13_b\obj\hdrv_hardinit.r01#
# Command line = -v0 -uu #
# -OD:\case_i_d913f\drv\Ui_SSD1332\UI_SSD13_B\Obj\ #
# -s+ -M<> -w+ -r -DIC3951 -DNAPDEBUG #
# -LD:\case_i_d913f\drv\Ui_SSD1332\UI_SSD13_B\List\ #
# -t8 -Id:\sdk_i_913f\inc\ -Id:\case_i_d913f\inc\ #
# -Id:\case_i_d913f\drv\Ui_SSD1332\inc\ #
# D:\CASE_I_D913F\DRV\UI_SSD1332\HDRV\hdrv_hardinit.msa #
# #
# (c) Copyright IAR Systems 1996 #
################################################################################
1 000000 //**************************************************
*************
2 000000 //* ACTOS
3 000000 //* driver demo
4 000000 //* (c) Copyright 2002-2003, Actions
Co,Ld.
5 000000 //* All Right Reserved
6 000000 //* File : Hdrv_HardInit.msa
7 000000 //* By :
8 000000 //* Version: 1> v1.00 first version date
9 000000 //**************************************************
*************
10 000000 //LCM12_NT39102
11 000000 #include "display.h"
12 000000 #include "Drv_S6B33B0A.h"
13 000000 #include "Hdrv_S6B33B0A.h"
14 000000
15 000000 //**************************************************
*************
16 000000 module Hdrv_HardInit
17 000000 //**************************************************
*************
18 000000 public Hdrv_HardInit
19 000000 public Init_Clear_All
20 000000 //**************************************************
*************
21 000000 extern Write_Command
22 000000 extern Write_Data
23 000000 extern DelayMs
24 000000 extern StoreCE
25 000000 extern ReStoreCE
26 000000 extern Ready_Write_Data
27 000000 //**************************************************
*************
28 000000 rseg BBD_IE
29 000000 //**************************************************
*************
30 000000 //* void sUI_HardInit(void);
31 000000 //** FUNCTION: Hdrv_HardInit
32 000000 //** Description: 初始化LCM的硬件设备
33 000000 //**************************************************
*************
34 000000 Hdrv_HardInit:
35 000000 CD.... call StoreCE
36 000003 CD.... call LCD_Init
37 000006 CD.... call LCD_Set
38 000009 CD.... call Init_Clear_All
39 00000C DELAYMS 50
39.1 00000C 0E32 ld c,50
39.2 00000E CD.... call DelayMs
39.3 000011 endm
40 000011
41 000011 DBEE in a,(0xee)
42 000013 CBCF set 1,a
43 000015 D3EE out (0xee),a
44 000017
45 000017 CD.... call ReStoreCE
46 00001A C9 ret
47 00001B //**************************************************
*************
48 00001B LCD_Init:
49 00001B F5 push af
50 00001C DBF0 in a,(0xf0)
51 00001E CBD7 set 2,a
52 000020 D3F0 out (0xf0),a
53 000022 DBF0 in a,(0xf0)
54 000024 CBC7 set 0,a
55 000026 D3F0 out (0xf0),a
56 000028
57 000028 DBEE in a,(0xee)
58 00002A E61F and 0x1f
59 00002C D3EE out (0xee),a
60 00002E
61 00002E DBEE in a,(0xee)
62 000030 CB8F res 1,a
63 000032 D3EE out (0xee),a
64 000034
65 000034 DELAYMS 20 //20MS
65.1 000034 0E14 ld c,20 //20MS
65.2 000036 CD.... call DelayMs
65.3 000039 endm
66 000039 DBF2 in a,(0xf2)
67 00003B CB97 res 2,a
68 00003D D3F2 out (0xf2),a
69 00003F
70 00003F DELAYMS 10 //20MS
70.1 00003F 0E0A ld c,10 //20MS
70.2 000041 CD.... call DelayMs
70.3 000044 endm
71 000044 DBF2 in a,(0xf2)
72 000046 CBD7 set 2,a
73 000048 D3F2 out (0xf2),a
74 00004A DELAYMS 100
74.1 00004A 0E64 ld c,100
74.2 00004C CD.... call DelayMs
74.3 00004F endm
75 00004F F1 pop af
76 000050 C9 ret
77 000051 //**************************************************
*************
78 000051 LCD_Set:
79 000051 F5 push af
80 000052 C5 push bc
81 000053 E5 push hl
82 000054 21.... ld hl,Set_Init_command
83 000057 LCM_INIT_LOOP:
84 000057 7E ld a,(hl)
85 000058 FEFF cp 0xff //结束标志
86 00005A 2824 jr z,LCM_INIT_OK
87 00005C FEFE cp 0xfe //延时标志
88 00005E 2817 jr z,LCM_INIT_WAIT
89 000060 WRITE_COMMAND (hl)
89.1 000060 4E ld c,(hl)
89.2 000061 CD.... call Write_Command
89.3 000064 endm
90 000064 23 inc hl
91 000065 7E ld a,(hl) //数值个数
92 000066 B7 or a
93 000067 2813 jr z,LCM_INIT_LOOP1
94 000069 47 ld b,a
95 00006A CON_GIVE_DATA:
96 00006A 23 inc hl
97 00006B WRITE_DATA (hl)
97.1 00006B 4E ld c,(hl)
97.2 00006C CD.... call Write_Data
97.3 00006F endm
98 00006F 05 dec b
99 000070 78 ld a,b
100 000071 B7 or a
101 000072 2808 jr z,LCM_INIT_LOOP1
102 000074 C3.... jp CON_GIVE_DATA
103 000077
104 000077 LCM_INIT_WAIT:
105 000077 23 inc hl
106 000078 DELAYMS (hl)
106.1 000078 4E ld c,(hl)
106.2 000079 CD.... call DelayMs
106.3 00007C endm
107 00007C LCM_INIT_LOOP1:
108 00007C 23 inc hl
109 00007D C3.... jp LCM_INIT_LOOP
110 000080
111 000080 LCM_INIT_OK:
112 000080 E1 pop hl
113 000081 C1 pop bc
114 000082 F1 pop af
115 000083 C9 ret
116 000084
117 000084 //**************************************************
*************
118 000084 Init_Clear_All:
119 000084 C5 push bc
120 000085 D5 push de
121 000086 E5 push hl
122 000087 //_________________________
123 000087 WRITE_COMMAND 0x2a //
123.1 000087 0E2A ld c,0x2a //
123.2 000089 CD.... call Write_Command
123.3 00008C endm
124 00008C WRITE_DATA 0
124.1 00008C 0E00 ld c,0
124.2 00008E CD.... call Write_Data
124.3 000091 endm
125 000091 WRITE_DATA 0
125.1 000091 0E00 ld c,0
125.2 000093 CD.... call Write_Data
125.3 000096 endm
126 000096 WRITE_DATA 0 //
126.1 000096 0E00 ld c,0 //
126.2 000098 CD.... call Write_Data
126.3 00009B endm
127 00009B WRITE_DATA 175 //
127.1 00009B 0EAF ld c,175 //
127.2 00009D CD.... call Write_Data
127.3 0000A0 endm
128 0000A0 WRITE_COMMAND 0x2b //
128.1 0000A0 0E2B ld c,0x2b //
128.2 0000A2 CD.... call Write_Command
128.3 0000A5 endm
129 0000A5 WRITE_DATA 0
129.1 0000A5 0E00 ld c,0
129.2 0000A7 CD.... call Write_Data
129.3 0000AA endm
130 0000AA WRITE_DATA 0
130.1 0000AA 0E00 ld c,0
130.2 0000AC CD.... call Write_Data
130.3 0000AF endm
131 0000AF WRITE_DATA 0 //
131.1 0000AF 0E00 ld c,0 //
131.2 0000B1 CD.... call Write_Data
131.3 0000B4 endm
132 0000B4 WRITE_DATA 131 //
132.1 0000B4 0E83 ld c,131 //
132.2 0000B6 CD.... call Write_Data
132.3 0000B9 endm
133 0000B9 WRITE_COMMAND 0x2c
133.1 0000B9 0E2C ld c,0x2c
133.2 0000BB CD.... call Write_Command
133.3 0000BE endm
134 0000BE CD.... call Ready_Write_Data
135 0000C1
136 0000C1 01C05A ld bc,176*132 //clear all
the buffer in driver IC
137 0000C4 110000 ld de,0x0000
138 0000C7 ClearFrame_loop:
139 0000C7 7A ld a,d
140 0000C8 320080 ld (8000h),a
141 0000CB 7B ld a,e
142 0000CC 320080 ld (8000h),a
143 0000CF 0B dec bc
144 0000D0 78 ld a,b
145 0000D1 B1 or c
146 0000D2 20F3 jr nz,ClearFrame_loop
147 0000D4 //_________________________
148 0000D4 E1 pop hl
149 0000D5 D1 pop de
150 0000D6 C1 pop bc
151 0000D7 C9 ret
152 0000D8 //**************************************************
*************
153 0000D8 Set_Init_command:
154 0000D8 //NT39102
155 0000D8 0100 defb 0x01,0//normal display on
156 0000DA 1100 defb 0x11,0//Display Inversion Off
157 0000DC 2000 defb 0x20,0
158 0000DE 3800 defb 0x38,0//Display Inversion on
159 0000E0 1300 defb 0x13,0//Display off
160 0000E2 //======defb djus,1, vcom===================//
161 0000E2 3A0105 defb 0x3a,1,0x05
162 0000E5 C00103 defb 0xc0,1,0x03
163 0000E8 C501C0 defb 0xc5,1,0xc0
164 0000EB C60107 defb 0xc6,1,0x07
165 0000EE E0071011 defb 0xe0,7,0x10,0x11,0x11,0x11,0x11,0x11
,0x01
166 0000F7 360194 defb 0x36,1,0x94
167 0000FA 2A040000 defb 0x2a,4,0x00,0x00,0x00,175
168 000100 2B040000 defb 0x2b,4,0x00,0x00,0x00,131
169 000106
170 000106 0C020055 defb 0x0c,2,0x00,0x55
171 00010A
172 00010A 2C00 defb 0x2c,0
173 00010C 2900 defb 0x29,0
174 00010E FE32 defb 0xfe,50
175 000110 FF defb 0xff
176 000111
177 000111 //**************************************************
*************
178 000111 end
##############################
# CRC:C605 #
# Errors: 0 #
# Warnings: 0 #
# Bytes: 273 #
##############################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -