Datasheet
486
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Requires
Global variables :
- SPExpanderCS: Chip Select line
- SPExpanderRST: Reset line
- SPExpanderRST_Direction: Direction of the Chip Select pin
-
SPExpanderCS_Direction: Direction of the Reset pin
variables must be defined before using this function.
The SPI module needs to be initialized. See the SPI_Init and
SPI_Init_Advanced routines.
Example
// Port Expander module connections
sbit SPExpanderRST at PORTB.B0;
sbit SPExpanderCS at PORTB.B1;
sbit SPExpanderRST_Direction at DDRB.B0;
sbit SPExpanderCS_Direction at DDRB.B1;
// End Port Expander module connections
...
// 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);
SPI_T6963C_Config(240, 64, 8, 0, 0, 1, 3, 4);