www.beck-ipc.com

@CHIP-RTOS C Library - SPI API


spi_waiton_sem

Wait on the SPI semaphore (hardware interface)

unsigned int spi_waiton_sem ( void );

Return Value

0 on success else error code.

Comments

If multiple tasks use the SPI hardware master interface to access different slaves through different slave chip select PIO pins, this call should be used to synchronise the SPI activity on the bus. The external MMC/SD driver examples uses this call since version V1.02.

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

On SC1x3/SC2x (RTOS version >=1.13, CLIB version >=2.10) there's also a version of this function which uses dynamic linking instead of a software interrupt, which reduces the function's overhead and thus speeds up your application. This function's name is spi_waiton_sem_dyn. You should however not use this function directly. Instead you should add the define SPI_DYN_LINK to your program before including the CLIB's header file(s):
#define SPI_DYN_LINK
#include <clib.h>

This will map the original function's name to the dynamic linking version. This way you can also easily switch existing programs to dynamic linking.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV0.91V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.02

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document