Subversion Repositories svn.mios

Rev

Rev 52 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
53 tk 1
; $Id: mios_mlcd.inc 53 2008-01-30 22:52:41Z tk $
1 tk 2
;
3
; MIOS MIDI LCD Driver (1st layer routines)
4
;
5
; ==========================================================================
6
;
7
;  Copyright 1998-2006 Thorsten Klose (tk@midibox.org)
8
;  Licensed for personal non-commercial use only.
9
;  All other rights reserved.
10
;
11
; ==========================================================================
12
 
13
;; --------------------------------------------------------------------------
14
;;  Init Routine for LC Display
15
;; --------------------------------------------------------------------------
16
MIOS_MLCD_Init
17
	rgoto	MIOS_MLCD_Clear
18
 
19
;; --------------------------------------------------------------------------
20
;;  Print Character
21
;; --------------------------------------------------------------------------
22
MIOS_MLCD_PrintChar
23
	;; notify that no graphical LCD is connected
24
	bcf	MIOS_BOX_CFG0, MIOS_BOX_CFG0_USE_GLCD
25
 
26
	SET_BSR	MIOS_GLCD_BUFFER
27
	movwf	MIOS_GLCD_BUFFER, BANKED
28
 
29
	RCALL_IFCLR MIOS_BOX_STAT, MIOS_BOX_STAT_MLCD_TRANSFER, ACCESS, MIOS_MLCD_SendSyxHeaderChr
30
 
31
	SET_BSR	MIOS_GLCD_BUFFER
32
	movf	MIOS_GLCD_BUFFER, W, BANKED
33
	andlw	0x7f
34
	goto	MIOS_MIDI_TxBufferPut
35
 
36
;; ==========================================================================
37
 
38
MIOS_MLCD_Clear
39
	rcall	MIOS_MLCD_SendSyxHeaderClr
40
	rgoto	MIOS_MLCD_SendSyxFooter
41
 
42
;; ==========================================================================
43
 
44
MIOS_MLCD_CursorSet
45
	rcall	MIOS_MLCD_SendSyxHeaderPosChr
46
	SET_BSR	MIOS_LCD_CURSOR_POS
47
	movf	MIOS_LCD_CURSOR_POS, W, BANKED
48
	andlw	0x3f
49
	call	MIOS_MIDI_TxBufferPut
50
	swapf	MIOS_LCD_CURSOR_POS, W, BANKED
51
	rrf	WREG, W
52
	rrf	WREG, W
53
	andlw	0x03
54
	call	MIOS_MIDI_TxBufferPut
55
	rgoto	MIOS_MLCD_SendSyxFooter
56
 
57
;; ==========================================================================
58
 
59
;; --------------------------------------------------------------------------
60
;;  MLCD: send SysEx header
61
;; --------------------------------------------------------------------------
62
MIOS_MLCD_SendSyxHeader
63
	bsf	MIOS_BOX_STAT, MIOS_BOX_STAT_MLCD_TRANSFER
64
 
65
	movlw	0xf0
66
	call	MIOS_MIDI_TxBufferPut
67
	movlw	0x00
68
	call	MIOS_MIDI_TxBufferPut
69
	movlw	0x00
70
	call	MIOS_MIDI_TxBufferPut
71
	movlw	0x7e
72
	call	MIOS_MIDI_TxBufferPut
73
	movlw	0x40
74
	call	MIOS_MIDI_TxBufferPut
75
	SET_BSR	MIOS_LCD_OPTION1	; (device ID)
76
	movf	MIOS_LCD_OPTION1, W, BANKED
77
	andlw	0x7f
78
	call	MIOS_MIDI_TxBufferPut
79
	movlw	0x08
80
	goto	MIOS_MIDI_TxBufferPut
81
 
82
;; --------------------------------------------------------------------------
83
;;  MLCD: send SysEx header for Clear Command
84
;; --------------------------------------------------------------------------
85
MIOS_MLCD_SendSyxHeaderClr
86
	call	MIOS_MLCD_SendSyxHeader
87
	movlw	0x00
88
	goto	MIOS_MIDI_TxBufferPut
89
 
90
;; --------------------------------------------------------------------------
91
;;  MLCD: send SysEx header for PosChr Command
92
;; --------------------------------------------------------------------------
93
MIOS_MLCD_SendSyxHeaderPosChr
94
	call	MIOS_MLCD_SendSyxHeader
95
	movlw	0x01
96
	goto	MIOS_MIDI_TxBufferPut
97
 
98
;; --------------------------------------------------------------------------
99
;;  MLCD: send SysEx header for Chr Command
100
;; --------------------------------------------------------------------------
101
MIOS_MLCD_SendSyxHeaderChr
102
	call	MIOS_MLCD_SendSyxHeader
103
	movlw	0x02
104
	goto	MIOS_MIDI_TxBufferPut
105
 
106
 
107
;; --------------------------------------------------------------------------
108
;;  MLCD: send SysEx footer
109
;; --------------------------------------------------------------------------
110
MIOS_MLCD_SendSyxFooter
111
	btfss	MIOS_BOX_STAT, MIOS_BOX_STAT_MLCD_TRANSFER
112
	return
113
	bcf	MIOS_BOX_STAT, MIOS_BOX_STAT_MLCD_TRANSFER
114
	movlw	0xf7
115
	goto	MIOS_MIDI_TxBufferPut