DlnSpiMasterSetMode() Function

DLN_RESULT DlnSpiMasterSetMode(
    HDLN handle,
    uint8_t port,
    uint8_t mode
 );

The DlnSpiMasterSetMode() function sets SPI transmission parameters (CPOL and CPHA).

Parameters:

handle
A handle to the DLN-series adapter.
port
A number of the SPI master port to apply configuration to.
mode
A bit field consisting of 8 bits. The bits 0 and 1 correspond to CPOL and CPHA parameters respectively and define the SPI mode. The rest of the bits is not used. You can also use special constants, defined in the dln_spi_master.h file for each of the bits. See Transfer Modes for additional info.
Bit Value Description Constant
0 0 CPOL=0 DLN_SPI_MASTER_CPOL_0
0 1 CPOL=1 DLN_SPI_MASTER_CPOL_1
1 0 CPHA=0 DLN_SPI_MASTER_CPHA_0
1 1 CPHA=1 DLN_SPI_MASTER_CPHA_1

This function is defined in the dln_spi_master.h file.