Mercurial > public > hwos_code
comparison src/tft.asm @ 360:5f142cff43f6
hardware support
author | heinrichsweikamp |
---|---|
date | Mon, 03 Aug 2015 22:47:39 +0200 |
parents | b2f6a4b01e64 |
children | 631cbfea3757 |
comparison
equal
deleted
inserted
replaced
359:2be48ccfa9de | 360:5f142cff43f6 |
---|---|
311 | 311 |
312 ; Data Transfer Synchronization | 312 ; Data Transfer Synchronization |
313 Parameter_out 0x00, 0x00 | 313 Parameter_out 0x00, 0x00 |
314 Parameter_out 0x00, 0x00 | 314 Parameter_out 0x00, 0x00 |
315 | 315 |
316 ;; Init through config table... ; mH | 316 Index_out 0x00 |
317 ; movlw LOW display1_config_table | 317 rcall TFT_CmdRead_PROD ; Get ID into PRODL:PRODH |
318 ; movwf TBLPTRL | 318 ; 5:197 -> display0 |
319 ; movlw HIGH display1_config_table | 319 ;147:37 -> display1 |
320 ; movwf TBLPTRH | 320 movlw .5 |
321 ; movlw UPPER display1_config_table | 321 cpfseq PRODL ; display0? |
322 ; movwf TBLPTRU | 322 bra TFT_boot_1 ; No |
323 movlw .197 | |
324 cpfseq PRODH ; display0? | |
325 bra TFT_boot_1 ; No | |
323 | 326 |
324 ; Init through config table... | 327 ; Init through config table... |
325 movlw LOW display0_config_table | 328 movlw LOW display0_config_table |
326 movwf TBLPTRL | 329 movwf TBLPTRL |
327 movlw HIGH display0_config_table | 330 movlw HIGH display0_config_table |
328 movwf TBLPTRH | 331 movwf TBLPTRH |
329 movlw UPPER display0_config_table | 332 movlw UPPER display0_config_table |
330 movwf TBLPTRU | 333 movwf TBLPTRU |
334 bcf screen_type | |
335 bra TFT_boot_com | |
336 | |
337 TFT_boot_1: | |
338 ; Init through config table... | |
339 movlw LOW display1_config_table | |
340 movwf TBLPTRL | |
341 movlw HIGH display1_config_table | |
342 movwf TBLPTRH | |
343 movlw UPPER display1_config_table | |
344 movwf TBLPTRU | |
345 bsf screen_type | |
346 | |
347 TFT_boot_com: | |
331 rcall display0_init_loop | 348 rcall display0_init_loop |
332 | 349 |
333 Index_out 0x03 | 350 Index_out 0x03 |
334 btfsc flip_screen ; 180° rotation ? | 351 btfsc flip_screen ; 180° rotation ? |
335 bra TFT_boot2 ; Yes | 352 bra TFT_boot2 ; Yes |
336 Parameter_out 0x50, 0x20 | 353 |
337 ; Parameter_out 0x10, 0x00 ; mH | 354 btfss screen_type ; display1? |
355 bra TFT_boot1a ; no | |
356 Parameter_out 0x10, 0x00 ; display1 | |
357 bra TFT_boot3 | |
358 TFT_boot1a: | |
359 Parameter_out 0x50, 0x20 ; display0 | |
338 bra TFT_boot3 | 360 bra TFT_boot3 |
339 TFT_boot2: | 361 TFT_boot2: |
340 Parameter_out 0x50, 0x10 | 362 btfss screen_type ; display1? |
341 ; Parameter_out 0x10, 0x30 ; mH | 363 bra TFT_boot2a ; no |
364 Parameter_out 0x10, 0x30 ; display1 | |
365 bra TFT_boot3 | |
366 TFT_boot2a: | |
367 Parameter_out 0x50, 0x10 ; display0 | |
342 TFT_boot3: | 368 TFT_boot3: |
343 Index_out 0x22 | 369 Index_out 0x22 |
344 rcall TFT_ClearScreen | 370 rcall TFT_ClearScreen |
345 Index_out 0x07 | 371 Index_out 0x07 |
346 Parameter_out 0x01, 0x33 | 372 Parameter_out 0x01, 0x33 |
631 movff PRODL,PORTH ; Move low byte to PORTH | 657 movff PRODL,PORTH ; Move low byte to PORTH |
632 WR_L | 658 WR_L |
633 WR_H ; Tick | 659 WR_H ; Tick |
634 return | 660 return |
635 | 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 | |
636 TFT_DataRead_PROD: | 682 TFT_DataRead_PROD: |
637 Index_out 0x22 ; Frame Memory Data Read start | 683 Index_out 0x22 ; Frame Memory Data Read start |
684 TFT_CmdRead_PROD: | |
638 setf TRISA ; PortA as input. | 685 setf TRISA ; PortA as input. |
639 setf TRISH ; PortH as input. | 686 setf TRISH ; PortH as input. |
640 RS_H ; Data | 687 RS_H ; Data |
641 WR_H ; Not write | 688 WR_H ; Not write |
642 RD_L ; Read! | 689 RD_L ; Read! |