The DlnSpiSlaveGetMode() function retrieves the current transmission parameters (CPOL and CPHA) for the specified SPI slave port. For details, read Clock Phase and Polarity.
DlnSpiSlaveGetMode()
DLN_RESULT DlnSpiSlaveGetMode( HDLN handle, uint8_t port, uint8_t* mode );
A handle to the DLN-series adapter.
A number of the SPI slave port.
A pointer to an unsigned 8 bit integer that receives the SPI mode value. The bits 0 and 1 of this value correspond to CPOL and CPHA parameters respectively. The rest of the bits are not used.
0
CPOL=0
DLN_SPI_SLAVE_CPOL_0
1
CPOL=1
DLN_SPI_SLAVE_CPOL_1
CPHA=0
DLN_SPI_SLAVE_CPHA_0
CPHA=1
DLN_SPI_SLAVE_CPHA_1
The function successfully configured the slave port mode.
The port number is not valid. Use the DlnSpiSlaveGetPortCount() function to find the maximum possible port number.
The DlnSpiSlaveGetMode() function is defined in the dln_spi_slave.h file.
dln_spi_slave.h