Mercurial > public > hwos_code
comparison src/tft.asm @ 361:631cbfea3757
1.85beta release
author | heinrichsweikamp |
---|---|
date | Tue, 04 Aug 2015 11:09:35 +0200 |
parents | 5f142cff43f6 |
children | 9a1c275077b0 |
comparison
equal
deleted
inserted
replaced
360:5f142cff43f6 | 361:631cbfea3757 |
---|---|
314 Parameter_out 0x00, 0x00 | 314 Parameter_out 0x00, 0x00 |
315 | 315 |
316 Index_out 0x00 | 316 Index_out 0x00 |
317 rcall TFT_CmdRead_PROD ; Get ID into PRODL:PRODH | 317 rcall TFT_CmdRead_PROD ; Get ID into PRODL:PRODH |
318 ; 5:197 -> display0 | 318 ; 5:197 -> display0 |
319 ;147:37 -> display1 | 319 ;37:147 -> display1 |
320 movlw .5 | 320 movlw .5 |
321 cpfseq PRODL ; display0? | 321 cpfseq PRODL ; display0? |
322 bra TFT_boot_1 ; No | 322 bra TFT_boot_1 ; No |
323 movlw .197 | 323 movlw .197 |
324 cpfseq PRODH ; display0? | 324 cpfseq PRODH ; display0? |
656 movff PRODH,PORTA ; Move high byte to PORTA | 656 movff PRODH,PORTA ; Move high byte to PORTA |
657 movff PRODL,PORTH ; Move low byte to PORTH | 657 movff PRODL,PORTH ; Move low byte to PORTH |
658 WR_L | 658 WR_L |
659 WR_H ; Tick | 659 WR_H ; Tick |
660 return | 660 return |
661 | |
662 ;TFT_CmdRead_PROD: | |
663 ; setf TRISA ; PortA as input. | |
664 ; setf TRISH ; PortH as input. | |
665 ; RS_H ; Data | |
666 ; WR_H ; Not write | |
667 ; nop | |
668 ; nop | |
669 ; nop | |
670 ; RD_L ; Read! | |
671 ; nop | |
672 ; nop | |
673 ; nop | |
674 ; RD_H ; Tick | |
675 ; movff PORTA,PRODH | |
676 ; movff PORTH,PRODL | |
677 ; nop | |
678 ; clrf TRISA ; PortA as output | |
679 ; clrf TRISH ; PortH as output | |
680 ; return | |
681 | 661 |
682 TFT_DataRead_PROD: | 662 TFT_DataRead_PROD: |
683 Index_out 0x22 ; Frame Memory Data Read start | 663 Index_out 0x22 ; Frame Memory Data Read start |
684 TFT_CmdRead_PROD: | 664 TFT_CmdRead_PROD: |
685 setf TRISA ; PortA as input. | 665 setf TRISA ; PortA as input. |
717 movff win_leftx2,WREG ; Compute left = 2*leftx2 --> PROD | 697 movff win_leftx2,WREG ; Compute left = 2*leftx2 --> PROD |
718 mullw 2 | 698 mullw 2 |
719 | 699 |
720 global TFT_box_write_16bit_win_left | 700 global TFT_box_write_16bit_win_left |
721 TFT_box_write_16bit_win_left: ; With column in PRODL:PRODH | 701 TFT_box_write_16bit_win_left: ; With column in PRODL:PRODH |
722 btfsc flip_screen ; 180° rotation ? | 702 btfsc screen_type ; display1? |
703 bra TFT_box_write_16bit_win_left_d1 ; Yes | |
704 ; Display0 | |
705 btfsc flip_screen ; 180° rotation? | |
723 bra DISP_box_flip_H ; Yes | 706 bra DISP_box_flip_H ; Yes |
724 | 707 bra TFT_box_write_16bit_win_left_com ; No |
708 TFT_box_write_16bit_win_left_d1: ; Display1 | |
709 btfss flip_screen ; 180° rotation? | |
710 bra DISP_box_flip_H ; Yes | |
711 ; No | |
712 TFT_box_write_16bit_win_left_com: | |
725 ;---- Normal horizontal window --------------------------------------- | 713 ;---- Normal horizontal window --------------------------------------- |
726 Index_out 0x52 ; Window Vertical Start Address | 714 Index_out 0x52 ; Window Vertical Start Address |
727 rcall TFT_DataWrite_PROD ; Output left | 715 rcall TFT_DataWrite_PROD ; Output left |
728 Index_out 0x21 ; Frame Memory Vertical Address | 716 Index_out 0x21 ; Frame Memory Vertical Address |
729 rcall TFT_DataWrite_PROD ; Output left | 717 rcall TFT_DataWrite_PROD ; Output left |