API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

Functions

int8_t TSMART_SPI_Init (tsmart_spi_t *TSMART_SPI)
 Initialize SPI bus. More...
 
int32_t TSMART_SPI_Receive (tsmart_spi_t *TSMART_SPI, tsmart_spi_config_t *TSMART_SPI_config, uint32_t TSMART_SPI_nb, uint8_t *TSMART_SPI_buf, portTickType TSMART_SPI_xticks)
 Receives data. More...
 
int8_t TSMART_SPI_Send (tsmart_spi_t *TSMART_SPI, tsmart_spi_config_t *TSMART_SPI_config, uint32_t TSMART_SPI_nb, uint8_t *TSMART_SPI_buf, portTickType TSMART_SPI_xticks)
 Sends data. More...
 
int32_t TSMART_SPI_IO (tsmart_spi_t *TSMART_SPI, tsmart_spi_config_t *TSMART_SPI_config, uint32_t TSMART_SPI_nb, uint8_t *TSMART_SPI_buf, portTickType TSMART_SPI_xticks)
 SPI input/output. More...
 

Detailed Description

Function Documentation

int8_t TSMART_SPI_Init ( tsmart_spi_t TSMART_SPI)

Initialize SPI bus.

This functions initializes the hardware configuration of the selected SPI bus and the associated OS mechanisms.

Note
The SPI2 Bus is incompatible with Ethernet
Parameters
TSMART_SPISPI structure handler.
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
spi.c.
int32_t TSMART_SPI_IO ( tsmart_spi_t TSMART_SPI,
tsmart_spi_config_t TSMART_SPI_config,
uint32_t  TSMART_SPI_nb,
uint8_t *  TSMART_SPI_buf,
portTickType  TSMART_SPI_xticks 
)

SPI input/output.

Parameters
TSMART_SPISPI SPI structure handler.
TSMART_SPI_configSPI configuration.
TSMART_SPI_nbNumber of bytes to input/output.
TSMART_SPI_bufData to send/receive.
TSMART_SPI_xticksMaximum waiting timeout.
int32_t TSMART_SPI_Receive ( tsmart_spi_t TSMART_SPI,
tsmart_spi_config_t TSMART_SPI_config,
uint32_t  TSMART_SPI_nb,
uint8_t *  TSMART_SPI_buf,
portTickType  TSMART_SPI_xticks 
)

Receives data.

Receives data form the selected SPI bus(shifting with dummy 0x00).

Parameters
TSMART_SPISPI structure handler.
TSMART_SPI_configSPI configuration
TSMART_SPI_nbNumber of bytes to send
TSMART_SPI_bufData buffer to store data.
TSMART_SPI_xticksMaximum waiting timeout.
Returns
  • Bytes received
  • TSMART_FAIL - Failure
Examples:
spi.c.
int8_t TSMART_SPI_Send ( tsmart_spi_t TSMART_SPI,
tsmart_spi_config_t TSMART_SPI_config,
uint32_t  TSMART_SPI_nb,
uint8_t *  TSMART_SPI_buf,
portTickType  TSMART_SPI_xticks 
)

Sends data.

Sends data to the selected SPI bus(doesn't read the response).

Parameters
TSMART_SPISPI structure handler.
TSMART_SPI_configSPI configuration
TSMART_SPI_nbNumber of bytes to send
TSMART_SPI_bufData buffer to send.
TSMART_SPI_xticksMaximum waiting timeout.
Returns
  • TSMART_PASS - OK
  • TSMART_FAIL - Failure
Examples:
spi.c.