Mikroelektronika MIKROE-738 Datenbogen
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
mikroC PRO for PIC32
MikroElektronika
501
SPI_Lcd_Config
SPI_Lcd_Out
Prototype
void SPI_Lcd_Config(char DeviceAddress);
Description Initializes the Lcd module via SPI interface.
Parameters -
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 defined before using this function.
The SPI module needs to be initialized. See SPIx_Init and SPIx_Init_Advanced routines.
Example
// Port Expander module connections
sbit SPExpanderRST at LATF0_bit;
sbit SPExpanderCS at LATF1_bit;
sbit SPExpanderRST_Direction at TRISF0_bit;
sbit SPExpanderCS_Direction at TRISF1_bit;
// End Port Expander module connections
// If Port Expander Library uses SPI1 module
SPI1_Init(); // Initialize SPI module used with PortExpander
SPI_Lcd_Config(0); // initialize Lcd over SPI interface
Notes
None.
Prototype
void SPI_Lcd_Out(char row, char column, char *text);
Description Prints text on the Lcd starting from specified position. Both string variables and literals can be passed
as a text.
Parameters -
row
: starting position row number
-
column
: starting position column number
-
text
: text to be written
Returns
Nothing.
Requires
Lcd needs to be initialized for SPI communication, see SPI_Lcd_Config routine.
Example
// Write text “Hello!” on Lcd starting from row 1, column 3:
SPI_Lcd_Out(1, 3, “Hello!”);
Notes
None.