12.07.2015 Views

SUB-20 User Manual - Dimax

SUB-20 User Manual - Dimax

SUB-20 User Manual - Dimax

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

27<strong>SUB</strong>-<strong>20</strong><strong>SUB</strong>-<strong>20</strong> APISPI Transfer format with SPI_SETUP_SMPLSPI_CPOL_RISESPI_CPOL_FALLSampleMOSI PinMISO PinFunctionssub_spi_configsub_spi_transfersub_spi_transfer_esssub_sdio_transfer3.5.1 sub_spi_configSynopsisint sub_spi_config( sub_handle hndl, int cfg_set, int* cfg_get )Configure <strong>SUB</strong>-<strong>20</strong> SPI module or read current configuration. If *cfg_get is NULL function will configure SPIaccording to the cfg_set parameter. Otherwise it will read current SPI configuration into *cfg_getParameters· cfg_set - Desired SPI configuration. This parameter is effective only if *cfg_get is NULL. cfg_set should beassembled as a combination of below flagsSPI_ENABLESPI_SLAVESPI_CPOL_RISESPI_CPOL_FALLSPI_SMPL_SETUPSPI_SETUP_SMPLEnable <strong>SUB</strong>-<strong>20</strong> SPI module.SPI module is in Slave mode. sub_spi_transfer can work only when SPI module is inMaster modeSCK is low when idle. See SPI Polarity and Phase explanationsSCK is high when idle. See SPI Polarity and Phase explanationsSample data on leading SCK edge, setup on trailing. See SPI Polarity and PhaseSetup data on leading SCK edge, sample on trailing. See SPI Polarity and PhaseBelow flags are relevant only for SPI master mode (SPI_SLAVE not set)SPI_LSB_FIRSTSPI_MSB_FIRSTTransmit LSB firstTransmit MSB first© <strong>20</strong>13 xdimax.com rev 2.17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!