IPC@CHIP® RTOS-LNX – API Documentation

Header image

Main page


◆ spiInit()

int spiInit ( BYTE  idx,
unsigned int  mode,
unsigned int  div 
)

This function must be called to initialize the SPI master interface on the respective hardware pins.

Parameters
idxSPI bus index
     0 = SPI on SPI1
     1 = SPI on SPI2
     etc.
modeSPI mode bits
     Bit0-1: SPI mode
             0 = SPI_MODE0 => CPOL=0, CPHA=0
             1 = SPI_MODE1 => CPOL=0, CPHA=1
             2 = SPI_MODE2 => CPOL=1, CPHA=0
             3 = SPI_MODE3 => CPOL=1, CPHA=1
     Bit5-7: SPI shift count
             0 = SPI_SHIFT8 => Shift 8 bits
             1 = SPI_SHIFT1 => Shift 1 bits
             2 = SPI_SHIFT2 => Shift 2 bits
             3 = SPI_SHIFT3 => Shift 3 bits
             4 = SPI_SHIFT4 => Shift 4 bits
             5 = SPI_SHIFT5 => Shift 5 bits
             6 = SPI_SHIFT6 => Shift 6 bits
             7 = SPI_SHIFT7 => Shift 7 bits

divMaximum clock frequency in Hz
Compatibility:
Please note that the interpretation of the div parameter has changed when compared with SC1x, SC2x, SC1x3 and SC2x3 systems.
Returns
Zero on success
Since
V0.86





Top of page | Main page

Copyright © 2018 Beck IPC GmbH
Generated on Fri Feb 9 2018 17:44:50 by Doxygen 1.8.13