User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
433
SPI Library
The SPI module is available with all PIC32 MCUs. mikroC PRO for PIC32 provides a library for initializing the Slave
mode and initializing and comfortable work with the Master mode. The PIC32 can easily communicate with other
devices via SPI: A/D converters, D/A converters, MAX7219, LTC1290, etc.
Important:
- SPI library routines require you to specify the module you want to use. To select the desired SPI module, simply
change the letter x in the routine prototype for a number from 1 to 3.
- Number of SPI modules per MCU differs from chip to chip. Please, read the appropriate datasheet before utilizing
this library.
- Switching between the SPI modules in the SPI library is done by the SPI_Set_Active function (both SPI modules have
to be previously initialized).
Library Routines
- SPIx_Init
- SPIx_Init_Advanced
- SPIx_Read
- SPIx_Write
- SPI_Set_Active