⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssd1283a_16tft.ls

📁 STM8-触摸例程
💻 LS
📖 第 1 页 / 共 5 页
字号:
1474  05bb 0e            	dc.b	14
1475  05bc 00            	dc.b	0
1476  05bd 00            	dc.b	0
1477  05be 00            	dc.b	0
1478  05bf 00            	dc.b	0
1479  05c0 00            	dc.b	0
1480  05c1 00            	dc.b	0
1481  05c2 18            	dc.b	24
1482  05c3 18            	dc.b	24
1483  05c4 18            	dc.b	24
1484  05c5 18            	dc.b	24
1485  05c6 18            	dc.b	24
1486  05c7 00            	dc.b	0
1487  05c8 18            	dc.b	24
1488  05c9 18            	dc.b	24
1489  05ca 18            	dc.b	24
1490  05cb 18            	dc.b	24
1491  05cc 18            	dc.b	24
1492  05cd 00            	dc.b	0
1493  05ce 00            	dc.b	0
1494  05cf 00            	dc.b	0
1495  05d0 00            	dc.b	0
1496  05d1 00            	dc.b	0
1497  05d2 70            	dc.b	112
1498  05d3 18            	dc.b	24
1499  05d4 18            	dc.b	24
1500  05d5 18            	dc.b	24
1501  05d6 0e            	dc.b	14
1502  05d7 18            	dc.b	24
1503  05d8 18            	dc.b	24
1504  05d9 18            	dc.b	24
1505  05da 18            	dc.b	24
1506  05db 70            	dc.b	112
1507  05dc 00            	dc.b	0
1508  05dd 00            	dc.b	0
1509  05de 00            	dc.b	0
1510  05df 00            	dc.b	0
1511  05e0 00            	dc.b	0
1512  05e1 00            	dc.b	0
1513  05e2 3b            	dc.b	59
1514  05e3 6e            	dc.b	110
1515  05e4 00            	dc.b	0
1516  05e5 00            	dc.b	0
1517  05e6 00            	dc.b	0
1518  05e7 00            	dc.b	0
1519  05e8 00            	dc.b	0
1520  05e9 00            	dc.b	0
1521  05ea 00            	dc.b	0
1522  05eb 00            	dc.b	0
1523  05ec 00            	dc.b	0
1524  05ed 00            	dc.b	0
1525  05ee 00            	dc.b	0
1526  05ef 00            	dc.b	0
1527  05f0 00            	dc.b	0
1528  05f1 70            	dc.b	112
1529  05f2 d8            	dc.b	216
1530  05f3 d8            	dc.b	216
1531  05f4 70            	dc.b	112
1532  05f5 00            	dc.b	0
1533  05f6 00            	dc.b	0
1534  05f7 00            	dc.b	0
1535  05f8 00            	dc.b	0
1536  05f9 00            	dc.b	0
1537  05fa 00            	dc.b	0
1538  05fb 00            	dc.b	0
1539  05fc 00            	dc.b	0
1540  05fd 00            	dc.b	0
1541  05fe 00            	dc.b	0
1542  05ff 00            	dc.b	0
1574                     	bsct
1575  0000               _TextColor:
1576  0000 0000          	dc.w	0
1577  0002               _BackColor:
1578  0002 ffff          	dc.w	-1
1627                     ; 58 void delayms(unsigned int ms)
1627                     ; 59 {
1629                     	switch	.text
1630  0000               _delayms:
1632  0000 89            	pushw	x
1633  0001 88            	push	a
1634       00000001      OFST:	set	1
1637  0002 200a          	jra	L15
1638  0004               L74:
1639                     ; 64     for (k = 0; k < 114; k++)
1641  0004 0f01          	clr	(OFST+0,sp)
1642  0006               L55:
1646  0006 0c01          	inc	(OFST+0,sp)
1649  0008 7b01          	ld	a,(OFST+0,sp)
1650  000a a172          	cp	a,#114
1651  000c 25f8          	jrult	L55
1652  000e               L15:
1653                     ; 62   while (ms--)
1655  000e 1e02          	ldw	x,(OFST+1,sp)
1656  0010 5a            	decw	x
1657  0011 1f02          	ldw	(OFST+1,sp),x
1658  0013 5c            	incw	x
1659  0014 26ee          	jrne	L74
1660                     ; 67 }
1663  0016 5b03          	addw	sp,#3
1664  0018 81            	ret	
1709                     ; 74 void write_data(unsigned char dat)
1709                     ; 75 {
1710                     	switch	.text
1711  0019               _write_data:
1713  0019 88            	push	a
1714  001a 88            	push	a
1715       00000001      OFST:	set	1
1718                     ; 77    c_d1;
1720  001b 4b20          	push	#32
1721  001d ae500a        	ldw	x,#20490
1722  0020 cd0000        	call	_GPIO_WriteHigh
1724  0023 84            	pop	a
1725                     ; 78    LcdCS0;
1727  0024 4b40          	push	#64
1728  0026 ae500a        	ldw	x,#20490
1729  0029 cd0000        	call	_GPIO_WriteLow
1731  002c 84            	pop	a
1732                     ; 79    for(i=0;i<8;i++)
1734  002d 0f01          	clr	(OFST+0,sp)
1735  002f               L501:
1736                     ; 81      sclk0;
1738  002f 4b20          	push	#32
1739  0031 ae5014        	ldw	x,#20500
1740  0034 cd0000        	call	_GPIO_WriteLow
1742  0037 84            	pop	a
1743                     ; 83 		 if(dat>=0x80)
1745  0038 7b02          	ld	a,(OFST+1,sp)
1746  003a a180          	cp	a,#128
1747  003c 250a          	jrult	L311
1748                     ; 84 		 sdata1;
1750  003e 4b40          	push	#64
1751  0040 ae5014        	ldw	x,#20500
1752  0043 cd0000        	call	_GPIO_WriteHigh
1755  0046 2008          	jra	L511
1756  0048               L311:
1757                     ; 86 		 sdata0;
1759  0048 4b40          	push	#64
1760  004a ae5014        	ldw	x,#20500
1761  004d cd0000        	call	_GPIO_WriteLow
1763  0050               L511:
1764  0050 84            	pop	a
1765                     ; 87      dat=dat<<1;
1767  0051 0802          	sll	(OFST+1,sp)
1768                     ; 89      sclk1;
1770  0053 4b20          	push	#32
1771  0055 ae5014        	ldw	x,#20500
1772  0058 cd0000        	call	_GPIO_WriteHigh
1774  005b 84            	pop	a
1775                     ; 79    for(i=0;i<8;i++)
1777  005c 0c01          	inc	(OFST+0,sp)
1780  005e 7b01          	ld	a,(OFST+0,sp)
1781  0060 a108          	cp	a,#8
1782  0062 25cb          	jrult	L501
1783                     ; 91    LcdCS1;
1785  0064 4b40          	push	#64
1786  0066 ae500a        	ldw	x,#20490
1787  0069 cd0000        	call	_GPIO_WriteHigh
1789  006c 84            	pop	a
1790                     ; 92 }
1793  006d 85            	popw	x
1794  006e 81            	ret	
1848                     ; 99 void write_data16(unsigned char datH,unsigned char datL)
1848                     ; 100 {
1849                     	switch	.text
1850  006f               _write_data16:
1852  006f 89            	pushw	x
1853  0070 88            	push	a
1854       00000001      OFST:	set	1
1857                     ; 102    c_d1;
1859  0071 4b20          	push	#32
1860  0073 ae500a        	ldw	x,#20490
1861  0076 cd0000        	call	_GPIO_WriteHigh
1863  0079 84            	pop	a
1864                     ; 103    LcdCS0;
1866  007a 4b40          	push	#64
1867  007c ae500a        	ldw	x,#20490
1868  007f cd0000        	call	_GPIO_WriteLow
1870  0082 84            	pop	a
1871                     ; 104    for(i=0;i<8;i++)
1873  0083 0f01          	clr	(OFST+0,sp)
1874  0085               L541:
1875                     ; 106      sclk0;
1877  0085 4b20          	push	#32
1878  0087 ae5014        	ldw	x,#20500
1879  008a cd0000        	call	_GPIO_WriteLow
1881  008d 84            	pop	a
1882                     ; 109 		 if(datH>=0x80)
1884  008e 7b02          	ld	a,(OFST+1,sp)
1885  0090 a180          	cp	a,#128
1886  0092 250a          	jrult	L351
1887                     ; 110 		    sdata1;
1889  0094 4b40          	push	#64
1890  0096 ae5014        	ldw	x,#20500
1891  0099 cd0000        	call	_GPIO_WriteHigh
1894  009c 2008          	jra	L551
1895  009e               L351:
1896                     ; 112 		    sdata0;
1898  009e 4b40          	push	#64
1899  00a0 ae5014        	ldw	x,#20500
1900  00a3 cd0000        	call	_GPIO_WriteLow
1902  00a6               L551:
1903  00a6 84            	pop	a
1904                     ; 113      datH=datH<<1;
1906  00a7 0802          	sll	(OFST+1,sp)
1907                     ; 115      sclk1;
1909  00a9 4b20          	push	#32
1910  00ab ae5014        	ldw	x,#20500
1911  00ae cd0000        	call	_GPIO_WriteHigh
1913  00b1 84            	pop	a
1914                     ; 104    for(i=0;i<8;i++)
1916  00b2 0c01          	inc	(OFST+0,sp)
1919  00b4 7b01          	ld	a,(OFST+0,sp)
1920  00b6 a108          	cp	a,#8
1921  00b8 25cb          	jrult	L541
1922                     ; 117    for(i=0;i<8;i++)
1924  00ba 0f01          	clr	(OFST+0,sp)
1925  00bc               L751:
1926                     ; 119       sclk0;
1928  00bc 4b20          	push	#32
1929  00be ae5014        	ldw	x,#20500
1930  00c1 cd0000        	call	_GPIO_WriteLow
1932  00c4 84            	pop	a
1933                     ; 122 		if(datL>=0x80)
1935  00c5 7b03          	ld	a,(OFST+2,sp)
1936  00c7 a180          	cp	a,#128
1937  00c9 250a          	jrult	L561
1938                     ; 123 		    sdata1;
1940  00cb 4b40          	push	#64
1941  00cd ae5014        	ldw	x,#20500
1942  00d0 cd0000        	call	_GPIO_WriteHigh
1945  00d3 2008          	jra	L761
1946  00d5               L561:
1947                     ; 125 		    sdata0;
1949  00d5 4b40          	push	#64
1950  00d7 ae5014        	ldw	x,#20500
1951  00da cd0000        	call	_GPIO_WriteLow
1953  00dd               L761:
1954  00dd 84            	pop	a
1955                     ; 126      datL=datL<<1;
1957  00de 0803          	sll	(OFST+2,sp)
1958                     ; 127       sclk1;
1960  00e0 4b20          	push	#32
1961  00e2 ae5014        	ldw	x,#20500
1962  00e5 cd0000        	call	_GPIO_WriteHigh
1964  00e8 84            	pop	a
1965                     ; 117    for(i=0;i<8;i++)
1967  00e9 0c01          	inc	(OFST+0,sp)
1970  00eb 7b01          	ld	a,(OFST+0,sp)
1971  00ed a108          	cp	a,#8
1972  00ef 25cb          	jrult	L751
1973                     ; 129    LcdCS1;
1975  00f1 4b40          	push	#64
1976  00f3 ae500a        	ldw	x,#20490
1977  00f6 cd0000        	call	_GPIO_WriteHigh
1979  00f9 84            	pop	a
1980                     ; 130 }
1983  00fa 5b03          	addw	sp,#3
1984  00fc 81            	ret	
2029                     ; 137 void write_cmd(unsigned char dat)
2029                     ; 138 {
2030                     	switch	.text
2031  00fd               _write_cmd:
2033  00fd 88            	push	a
2034  00fe 88            	push	a
2035       00000001      OFST:	set	1
2038                     ; 140    c_d0;
2040  00ff 4b20          	push	#32
2041  0101 ae500a        	ldw	x,#20490
2042  0104 cd0000        	call	_GPIO_WriteLow
2044  0107 84            	pop	a
2045                     ; 141    LcdCS0;
2047  0108 4b40          	push	#64
2048  010a ae500a        	ldw	x,#20490
2049  010d cd0000        	call	_GPIO_WriteLow
2051  0110 84            	pop	a
2052                     ; 143    for(i=0;i<8;i++)
2054  0111 0f01          	clr	(OFST+0,sp)
2055  0113               L312:
2056                     ; 145       sclk0;
2058  0113 4b20          	push	#32
2059  0115 ae5014        	ldw	x,#20500
2060  0118 cd0000        	call	_GPIO_WriteLow
2062  011b 84            	pop	a
2063                     ; 148 		if(dat>=0x80)
2065  011c 7b02          	ld	a,(OFST+1,sp)
2066  011e a180          	cp	a,#128
2067  0120 250a          	jrult	L122
2068                     ; 149 		    sdata1;
2070  0122 4b40          	push	#64
2071  0124 ae5014        	ldw	x,#20500
2072  0127 cd0000        	call	_GPIO_WriteHigh
2075  012a 2008          	jra	L322
2076  012c               L122:
2077                     ; 151 		    sdata0;
2079  012c 4b40          	push	#64
2080  012e ae5014        	ldw	x,#20500
2081  0131 cd0000        	call	_GPIO_WriteLow
2083  0134               L322:
2084  0134 84            	pop	a
2085                     ; 152      dat=dat<<1;
2087  0135 0802          	sll	(OFST+1,sp)
2088                     ; 153       sclk1;
2090  0137 4b20          	push	#32
2091  0139 ae5014        	ldw	x,#20500
2092  013c cd0000        	call	_GPIO_WriteHigh
2094  013f 84            	pop	a
2095                     ; 143    for(i=0;i<8;i++)
2097  0140 0c01          	inc	(OFST+0,sp)
2100  0142 7b01          	ld	a,(OFST+0,sp)
2101  0144 a108          	cp	a,#8
2102  0146 25cb          	jrult	L312
2103                     ; 155    LcdCS1;  
2105  0148 4b40          	push	#64
2106  014a ae500a        	ldw	x,#20490
2107  014d cd0000        	call	_GPIO_WriteHigh
2109  0150 84            	pop	a
2110                     ; 156  }
2113  0151 85            	popw	x
2114  0152 81            	ret	
2143                     ; 163 void  tft_16lcd_init()
2143                     ; 164 {
2144                     	switch	.text
2145  0153               _tft_16lcd_init:
2149                     ; 165    LcdCS1;
2151  0153 4b40          	push	#64
2152  0155 ae500a        	ldw	x,#20490
2153  0158 cd0000        	call	_GPIO_WriteHigh
2155  015b 84            	pop	a
2156                     ; 166    sclk0;
2158  015c 4b20          	push	#32
2159  015e ae5014        	ldw	x,#20500
2160  0161 cd0000        	call	_GPIO_WriteLow
2162  0164 ae0064        	ldw	x,#100
2163  0167 84            	pop	a
2164                     ; 173    delayms(100);
2166  0168 cd0000        	call	_delayms
2168                     ; 175    write_cmd(0x10);           //Power control 1
2170  016b a610          	ld	a,#16
2171  016d ad8e          	call	_write_cmd
2173                     ; 176    write_data16(0x2f,0xce);	  //2f8e
2175  016f ae00ce        	ldw	x,#206
2176  0172 a62f          	ld	a,#47
2177  0174 95            	ld	xh,a
2178  0175 cd006f        	call	_write_data16
2180                     ; 178    write_cmd(0x11);           //Power control 2
2182  0178 a611          	ld	a,#17
2183  017a ad81          	call	_write_cmd
2185                     ; 179    write_data16(0x00,0x0c);
2187  017c ae000c        	ldw	x,#12
2188  017f 4f            	clr	a
2189  0180 95            	ld	xh,a
2190  0181 cd006f        	call	_write_data16
2192                     ; 181    write_cmd(0x07);
2194  0184 a607          	ld	a,#7
2195  0186 cd00fd        	call	_write_cmd
2197                     ; 182    write_data16(0x00,0x21);
2199  0189 ae0021        	ldw	x,#33
2200  018c 4f            	clr	a
2201  018d 95            	ld	xh,a
2202  018e cd006f        	call	_write_data16
2204                     ; 184    write_cmd(0x28);
2206  0191 a628          	ld	a,#40
2207  0193 cd00fd        	call	_write_cmd
2209                     ; 185    write_data16(0x00,0x06);
2211  0196 ae0006        	ldw	x,#6
2212  0199 4f            	clr	a
2213  019a 95            	ld	xh,a
2214  019b cd006f        	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -