Datasheet
unsigned char panel ; // current panel
unsigned int i ; // general purpose register
unsigned char curs ; // cursor visibility
unsigned int cposx, cposy ; // cursor x-y position
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_DIV32, _SPI_CLK_HI_TRAIL-
ING);
// // If Port Expander Library uses SPI2 module
// Pass pointer to SPI Read function of used SPI module
// SPI_Rd_Ptr = SPI2_Read; // Pass pointer to SPI Read
function of used SPI module
// Initialize SPI module used with PortExpander
// SPI2_Init_Advanced(_SPI_MASTER, _SPI_FCY_DIV32,
_SPI_CLK_HI_TRAILING);
// Initialize SPI Toshiba 240x128
SPI_T6963C_Config(240, 128, 8, 0, 2, 1, 0, 4) ;
Delay_ms(1000);
/*
* Enable both graphics and text display at the same time
*/
SPI_T6963C_graphics(1) ;
SPI_T6963C_text(1) ;
panel = 0 ;
i = 0 ;
curs = 0 ;
cposx = cposy = 0 ;
501
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6