Mikroelektronika MIKROE-350 데이터 시트

다운로드
페이지 526
program SPI_T6963C_240x128
include __Lib_SPIT6963C_Const
include bitmap
include bitmap2
dim
' Port Expander module connections
SPExpanderRST 
as sbit at PORTB.B0
SPExpanderCS  
as sbit at PORTB.B1
SPExpanderRST_Direction 
as sbit at DDRB.B0
SPExpanderCS_Direction  
as sbit at DDRB.B1
' End Port Expander module connections
dim
panel 
as byte
' current panel
as word 
' general purpose register
curs 
as byte 
' cursor visibility
cposx,
cposy 
as word
' cursor x-y position
txt, txt1 
as string[29]
txt1 = " EINSTEIN WOULD HAVE LIKED mE"
txt  = " GLCD LIBRARY DEMO, WELCOME !"
DDRA = 0x00                     ' configure PORTA as input
'  *
'  * init display for 240 pixel width and 128 pixel height
'  * 8 bits character width
'  * data bus on MCP23S17 portB
'  * control bus on MCP23S17 portA
'  * bit 2 is !WR
'  * bit 1 is !RD
'  * bit 0 is !CD
'  * bit 4 is RST
'  * chip enable, reverse on, 8x8 font internaly set in library
'  *
' Pass pointer to SPI Read function of used SPI module
Spi_Rd_Ptr = @SPI1_Read
' Initialize SPI module
SPI1_Init_Advanced(_SPI_MASTER, _SPI_FCY_DIV2, _SPI_CLK_HI_TRAIL-
ING)
437
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6