Mercurial > public > hwos_code
comparison src/tft.asm @ 436:95ee78f4a974
no screen reboot after logbook exit
author | heinrichsweikamp |
---|---|
date | Fri, 24 Jun 2016 12:51:14 +0200 |
parents | a001f170a1f7 |
children | 360acdcda0d7 |
comparison
equal
deleted
inserted
replaced
435:0590b8fafc8d | 436:95ee78f4a974 |
---|---|
206 | 206 |
207 global TFT_CmdWrite | 207 global TFT_CmdWrite |
208 TFT_CmdWrite: | 208 TFT_CmdWrite: |
209 RS_L ; Command | 209 RS_L ; Command |
210 clrf PORTA ; Upper | 210 clrf PORTA ; Upper |
211 bcf INTCON,GIE | |
211 movwf PORTH ; Lower | 212 movwf PORTH ; Lower |
212 WR_L | 213 WR_L |
213 WR_H ; Tick | 214 WR_H ; Tick |
215 bsf INTCON,GIE | |
214 return; | 216 return; |
215 | 217 |
216 global TFT_DataWrite | 218 global TFT_DataWrite |
217 TFT_DataWrite: | 219 TFT_DataWrite: |
218 RS_H ; Data | 220 RS_H ; Data |
221 bcf INTCON,GIE | |
219 movwf PORTH ; Lower | 222 movwf PORTH ; Lower |
220 WR_L | 223 WR_L |
221 WR_H ; Tick | 224 WR_H ; Tick |
225 bsf INTCON,GIE | |
222 return | 226 return |
223 | 227 |
224 ;============================================================================= | 228 ;============================================================================= |
225 ; | 229 ; |
226 global TFT_ClearScreen | 230 global TFT_ClearScreen |
250 TFT_ClearScreen2: | 254 TFT_ClearScreen2: |
251 movlw d'30' | 255 movlw d'30' |
252 movwf tft_temp2 | 256 movwf tft_temp2 |
253 TFT_ClearScreen3: | 257 TFT_ClearScreen3: |
254 clrf tft_temp1 ; 30*10*256=76800 Pixels -> Clear complete 240*320 | 258 clrf tft_temp1 ; 30*10*256=76800 Pixels -> Clear complete 240*320 |
259 bcf INTCON,GIE | |
255 TFT_ClearScreen4: | 260 TFT_ClearScreen4: |
256 WR_L | 261 WR_L |
257 WR_H ; Tick | 262 WR_H ; Tick |
258 decfsz tft_temp1,F | 263 decfsz tft_temp1,F |
259 bra TFT_ClearScreen4 | 264 bra TFT_ClearScreen4 |
265 bsf INTCON,GIE | |
260 decfsz tft_temp2,F | 266 decfsz tft_temp2,F |
261 bra TFT_ClearScreen3 | 267 bra TFT_ClearScreen3 |
262 decfsz tft_temp3,F | 268 decfsz tft_temp3,F |
263 bra TFT_ClearScreen2 | 269 bra TFT_ClearScreen2 |
264 return | 270 |
271 movlw 0x00 ; NOP, to stop window mode | |
272 bra TFT_CmdWrite ; And return | |
273 ; return | |
265 | 274 |
266 ;============================================================================= | 275 ;============================================================================= |
267 ; | 276 ; |
268 global TFT_DisplayOff | 277 global TFT_DisplayOff |
269 TFT_DisplayOff: | 278 TFT_DisplayOff: |
571 Index_out 0x20 ; Frame Memory Horizontal Address | 580 Index_out 0x20 ; Frame Memory Horizontal Address |
572 rcall TFT_DataWrite_PROD | 581 rcall TFT_DataWrite_PROD |
573 | 582 |
574 Index_out 0x22 ; Frame Memory Data Write start | 583 Index_out 0x22 ; Frame Memory Data Write start |
575 RS_H ; Data | 584 RS_H ; Data |
585 bcf INTCON,GIE | |
576 movff win_color1,PORTA ; Upper | 586 movff win_color1,PORTA ; Upper |
577 movff win_color2,PORTH ; Lower | 587 movff win_color2,PORTH ; Lower |
578 WR_L | 588 WR_L |
579 WR_H ; Tick | 589 WR_H ; Tick |
590 bsf INTCON,GIE | |
580 return | 591 return |
581 | 592 |
582 ;----------------------------------------------------------------------------- | 593 ;----------------------------------------------------------------------------- |
583 ; Writes a vertical line of half-pixel at position (win_top,win_leftx2,win_height). | 594 ; Writes a vertical line of half-pixel at position (win_top,win_leftx2,win_height). |
584 ; Inputs: win_leftx2, win_top, win_height, win_color:2 | 595 ; Inputs: win_leftx2, win_top, win_height, win_color:2 |
633 ; | 644 ; |
634 global TFT_DataWrite_PROD | 645 global TFT_DataWrite_PROD |
635 TFT_DataWrite_PROD: | 646 TFT_DataWrite_PROD: |
636 ; RD_H ; Keep high | 647 ; RD_H ; Keep high |
637 RS_H ; Data | 648 RS_H ; Data |
649 bcf INTCON,GIE | |
638 movff PRODH,PORTA ; Move high byte to PORTA | 650 movff PRODH,PORTA ; Move high byte to PORTA |
639 movff PRODL,PORTH ; Move low byte to PORTH | 651 movff PRODL,PORTH ; Move low byte to PORTH |
640 WR_L | 652 WR_L |
641 WR_H ; Tick | 653 WR_H ; Tick |
654 bsf INTCON,GIE | |
642 return | 655 return |
643 | 656 |
644 TFT_DataRead_PROD: | 657 TFT_DataRead_PROD: |
645 Index_out 0x22 ; Frame Memory Data Read start | 658 Index_out 0x22 ; Frame Memory Data Read start |
646 TFT_CmdRead_PROD: | 659 TFT_CmdRead_PROD: |
859 | 872 |
860 TFT_box2: ; Loop height times | 873 TFT_box2: ; Loop height times |
861 movff win_height,PRODL | 874 movff win_height,PRODL |
862 | 875 |
863 TFT_box3: ; loop width times | 876 TFT_box3: ; loop width times |
877 bcf INTCON,GIE | |
864 movff win_color1,PORTA ; Upper | 878 movff win_color1,PORTA ; Upper |
865 movff win_color2,PORTH ; Lower | 879 movff win_color2,PORTH ; Lower |
866 WR_L | 880 WR_L |
867 WR_H ; Tick | 881 WR_H ; Tick |
868 ; | 882 ; |
869 ; movff win_color1,PORTA ; Upper | 883 ; movff win_color1,PORTA ; Upper |
870 ; movff win_color2,PORTH ; Lower | 884 ; movff win_color2,PORTH ; Lower |
871 WR_L | 885 WR_L |
872 WR_H ; Tick | 886 WR_H ; Tick |
873 | 887 bsf INTCON,GIE |
874 decfsz PRODL,F ; row loop finished ? | 888 decfsz PRODL,F ; row loop finished ? |
875 bra TFT_box3 ; No: continue. | 889 bra TFT_box3 ; No: continue. |
876 | 890 |
877 incf PRODH,F ; column count ++ | 891 incf PRODH,F ; column count ++ |
878 | 892 |