Mivel lehet grafikus fontokat szerkeszteni?
Kelenének a 16*16 ékezetes betűk!
Esetleg már készen is jó lenne!
Kód: Egész kijelölése
copyright = MCS Electronics
www = http://www.mcselec.com
email = avr@mcselec.com
comment = RA6963 graphic display library
libversion = 2.0.4.1
date = 5 apr 2012
statement = No SOURCE code from the library may be distributed in any form
statement = Of course this does not apply for the COMPILED code when you have a BASCOM-AVR license
history = No known bugs.
history = LINE added
history = RLE decoding added
history = rcall changed into call
history = a RET was left in the lib causing the status check not to work
history = box statement did not filled complete box
history = R23 is replaced by r11 because r23 might be used in case you use an extended port for control
history = changed for RA6963 single scan , 32KB model , MD2 Pin setup = _Glcd_md2
history = AVR 16MHz
[_GLCD]
;init display uses r24,r25
_set_display:
* Sbi _glcd_portm,_GLCD_CD ; command high
* nop
* nop
* nop
* Sbi _glcd_portm,_GLCD_Ce ; ChipEnable high
* nop
* nop
* nop
* Sbi _glcd_portm,_glcd_wr ; write high
* nop
* nop
* nop
* sbi _glcd_portm,_glcd_rd ; read high
* nop
* nop
* nop
* #IF _GLCD_MODE=8
* cbi _glcd_portM,_glcd_fs ; font select 0 for 8*8
* nop
* nop
* nop
* sbi _glcd_portM,_Glcd_md2 ; 32 Colums H
* #ELSE
* sbi _glcd_portM,_glcd_fs ; font select 1 for 6*8
* nop
* nop
* nop
* cbi _glcd_portM,_Glcd_md2 ; 40 Colums L
* #ENDIF
* nop
* nop
* nop
* cbi _glcd_portm,_glcd_reset ; reset low
Ldi r24,100 ; reset 100 mS
Clr R25
* Call _Waitms
* sbi _glcd_portm,_glcd_reset ; reset high
Ldi r24,100 ; Wait 100 mS
Clr R25
* Call _Waitms
rcall _gstatus_check
Clr r24
rcall _GWrite_Data
rcall _GWrite_Data
ldi r24,&H40 ; home adres text ram.upperleft corner 0000
rcall _GWrite_Cmd
rcall _GWrite_Data
rcall _GWrite_Data
ldi r24,&H22 ; offset register 00 00
rcall _GWrite_Cmd
* ldi r24,_GLCD_COLS
rcall _GWrite_Data
Clr r24
rcall _GWrite_Data
ldi r24,&H41 ; linewidth graphic (characters per line)
rcall _GWrite_Cmd
Clr r24
rcall _GWrite_Data
ldi r24,&H08 ; 0800
rcall _GWrite_Data
ldi r24,&H42 ; home adress graphical ram.upperleft corner 0800
rcall _GWrite_Cmd
* ldi r24, _GLCD_COLS ; columns depends on mode for 240 with mode 6 it is 40
rcall _GWrite_Data
Clr r24
rcall _GWrite_Data
ldi r24,&H43 ; linewidth graphics (bytes per line)
rcall _GWrite_Cmd
ldi r24,&H80 ' OR mode
rcall _GWrite_Cmd
ldi r24,&H9F ; text, graph, cursor , blink all on
rjmp _GWrite_Cmd
;Status check
;The Status of T6963C can be read from the data lines.
; RD L
; WR H
; CE L
; C/D H
; Do to D7 H
; The T6963C status word format is as follows:
_gstatus_check:
; Adat Port bemenet
clr r25 ; r25 = 0
* out _glcd_port_ddr,r25 ; make port an input
ser r25 ; r25 = HFF
* out _glcd_port,r25 ; Adat Port Felhuzo R
* nop
* nop
* nop
* nop
* nop
* nop
* Sbi _glcd_portm,_GLCD_CD ; H command
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* Cbi _glcd_portm,_glcd_ce ; L Enable Chip
* nop
* nop
* nop
* sbi _glcd_portm,_glcd_wr ; H write high
_gstatus_check1:
* nop
* nop
* nop
* nop
* cbi _glcd_portm,_glcd_rd ; L RD low
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* in r25, _glcd_port_in ; get status
* nop
* nop
* nop
* sbi _glcd_portm,_glcd_rd ; H end RD
* nop
* nop
* nop
* nop
* nop
Andi R25 , 3 ; Mask Bits
;cpi r25,3
* #IF _SIM=0
breq _Gstatus_check1 ; not ready
* #ENDIF
; Adat Port kimenet
_gstatus_check2:
* sbi _glcd_portm,_GLCD_CE ; disable chip not needed at this stage
* nop
* nop
* nop
* nop
ser r25 ; 255
* out _glcd_port_ddr,r25 ; AVR make output port
* nop
* nop
Ret ; _gstatus_check END
_wr_check:
clr r25
; AVR Adat Port bemenet
* out _glcd_port_ddr,r25 ; make port an input
ser r25
* out _glcd_port,r25
* nop
* nop
* nop
* nop
* nop
* Sbi _glcd_portm,_GLCD_CD ; command H
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* Cbi _glcd_portm,_glcd_ce ; Enable Chip L
* nop
* nop
* nop
* sbi _glcd_portm,_glcd_wr ; write high H
_wr_check1:
* nop
* nop
* nop
* nop
* nop
* nop
* cbi _glcd_portm,_glcd_rd ; RD low
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* in r25, _glcd_port_in ; get status
* nop
* nop
* sbi _glcd_portm,_glcd_rd ; H end RD
* nop
* nop
* nop
* nop
* nop
* nop
Andi R25 , 8 ; Mask Bits
* #IF _SIM=0
breq _wr_check1 ; not ready
* #ENDIF
rjmp _gstatus_check2 ; set to output
_Gwrite_Data:
rcall _GStatus_check ; check status
_Gwrite_Data_NS:
* cbi _glcd_portm,_GLCD_CD ; L data
_gwrite_datamisc:
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* cbi _glcd_portm,_GLCD_CE ; enable chip is done in status checl
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* out _GLCD_PORT,r24 ; write
* nop
* nop
* nop
* nop
* nop
* nop
* cbi _glcd_portm,_glcd_wr ; write low
* nop
* nop
* nop
* nop
* nop
* nop
* nop
* sbi _glcd_portm,_glcd_wr ; write high
* nop
* nop
* nop
* nop
* nop
* Sbi _glcd_portm,_GLCD_CE ; disable chip
* nop
* nop
* nop
* nop
* nop
Ret ; _Gwrite_Data END
_Gwrite_Cmd:
....
....
Kód: Egész kijelölése
'__________________________ LCD RG240128B-BIW-V CONFIG ___________________
'Bascom által nem vezérelt MD2 Port Output
Config Portc.3 = Output
Lcd_md2 Alias Portc.3
' (LCD PIN 18 MD2 = H: 32 columns ; L: 40 columns) > Controlport._glcd_md2
Const _glcd_md2 = 3 'MD2 = Controlport.3
' LCD-RA6963 and AVR $crystal = 16000000 used crystal frequency Optimized glcdRA6963_2.Lib
$lib "glcdRA6963.LIB"
Config Graphlcd = 240 * 128 , Dataport = Porta , Controlport = Portc , Ce = 0 , Cd = 2 , Wr = 7 , Rd = 6 , Reset = 1 , Fs = 4 , Mode = 8
Cursor Off
ClsKód: Egész kijelölése
'1 sor kirakása X-Y-ra
'X,Y
'
Sorxy: 'SX() sor tömb kirakása x-y ponttól SXHOSSZ-ig
X = Sorxy_x
Y = Sorxy_y
For Ctx = 1 To Sxhossz '1-től a hosszig
Pixelbyte = Sx(ctx)
Gosub Wpixel
X = X + 1
Y = Y - 8
Next Ctx
Return
Wpixel: '1 függőleges byte kirakása x-y-ponttól lefelé
Bitct = 255
While Bitct <> 7
Incr Bitct
'Decr Bitct 'Ha fejjel lefelé kell kiírni...minek?
If Pixelbyte.bitct <> 0 Then
Ink = 1
Gosub Plot_v
Else
If Ov = 0 Then 'OV=1 overlaynél a 0-s pixel nem rakódik ki
Ink = 0
Gosub Plot_v
End If
End If
Incr Y
If Y > 63 Then Exit While
Wend
Return