cancel
Showing results for 
Search instead for 
Did you mean: 

stm8s_spi.h and manual misalignement

spiovan9
Associate II
Posted on January 03, 2011 at 10:34

I was about to implement a SPI communication between STM8s and another peripheral. I came across a possible misalignement between what the manual says and the remarks in the FW library code stm8s_spi.h.

When the SPI_NSS_HARD bit is ZERO maybe the Software slave management is DISABLED as the manual says. On the other hand the remarks in the code library says exactly the opposite.

Which one is correct? I guess the manual is fine.

Thanks

Stefano

(A)

FWLib\library\inc

stm8s_spi.h

...

/**

* @brief SPI Slave Select management

* Warning: element values correspond to LSBFIRST bit position

*/

typedef enum

{

SPI_NSS_SOFT = (u8)0x02, /*!< Software slave management disabled */

SPI_NSS_HARD = (u8)0x00 /*!< Software slave management enabled */

} SPI_NSS_TypeDef;

(B)

STM8S microcontroller family reference manual

Doc ID 14587 Rev 6, page 269/441

Serial peripheral interface (SPI)

...

Bit 1 SSM: Software slave management

0: Software slave management disabled

1: Software slave management enabled

When the SSM bit is set, the NSS pin input is replaced with the value coming from the SSI bit

Bit 0 SSI: Internal slave select

This bit has effect only when SSM bit is set. The value of this bit is forced onto the NSS pin and the I/O

value of the NSS pin is ignored.

0: Slave mode

1: Master mode

#spi
0 REPLIES 0