User manual
mikroPascal PRO for PIC32
MikroElektronika
469
SPI_Lcd8_Cong
Prototype
procedure SPI_Lcd8_Cong(DeviceAddress : byte);
Description Initializes the Lcd module via SPI interface.
Parameters - DeviceAddress: SPI expander hardware address, see schematic at the bottom of this page
Returns Nothing.
Requires Global variables:
- SPExpanderCS: Chip Select line
- SPExpanderRST: Reset line
- SPExpanderCS_Direction: Direction of the Chip Select pin
- SPExpanderRST_Direction: Direction of the Reset pin
must be dened before using this function.
The SPI module needs to be initialized. See SPIx_Init and SPIx_Init_Advanced routines.
Example
// Port Expander module connections
var SPExpanderRST : sbit at LATF0_bit;
var SPExpanderCS : sbit at LATF1_bit;
var SPExpanderRST_Direction : sbit at TRISF0_bit;
var SPExpanderCS_Direction : sbit at TRISF1_bit;
// End Port Expander module connections
...
// If Port Expander Library uses SPI1 module
SPI1_Init(); // Initialize SPI module used
with PortExpander
SPI_Lcd8_Cong(0); // intialize Lcd in 8bit mode
via SPI
Notes None.