Macros
Collaboration diagram for Command Codes:

Macros

#define SPILPF3DMA_CMD_RETURN_PARTIAL_ENABLE   (SPI_CMD_RESERVED + 0)
 Command used by SPI_control() to enable partial return. More...
 
#define SPILPF3DMA_CMD_RETURN_PARTIAL_DISABLE   (SPI_CMD_RESERVED + 1)
 Command used by SPI_control() to disable partial return. More...
 
#define SPILPF3DMA_CMD_SET_CSN_PIN   (SPI_CMD_RESERVED + 2)
 Command used by SPI_control() to re-configure chip select pin. More...
 
#define SPILPF3DMA_CMD_CLEAR_CSN_PIN   (SPI_CMD_RESERVED + 3)
 Command used by SPI_control() to clear the chip select pin. More...
 
#define SPILPF3DMA_CMD_SET_MANUAL   (SPI_CMD_RESERVED + 4)
 Command used by SPI_control() to enable manual start mode. More...
 
#define SPILPF3DMA_CMD_CLR_MANUAL   (SPI_CMD_RESERVED + 5)
 Command used by SPI_control() to disable manual start mode. More...
 
#define SPILPF3DMA_CMD_MANUAL_START   (SPI_CMD_RESERVED + 6)
 Command used by SPI_control() to enable manual start mode. More...
 
#define SPILPF3DMA_CMD_SET_SAMPLE_DELAY   (SPI_CMD_RESERVED + 7)
 Command used by SPI_control() to set the sample delay in controller mode. More...
 

Detailed Description

SPI_CMD_* macros are general command codes for SPI_control(). Not all SPI driver implementations support these command codes.

SPILPF3DMA_CMD_* macros are command codes only defined in the SPILPF3DMA.h driver implementation and need to:

Macro Definition Documentation

§ SPILPF3DMA_CMD_RETURN_PARTIAL_ENABLE

#define SPILPF3DMA_CMD_RETURN_PARTIAL_ENABLE   (SPI_CMD_RESERVED + 0)

Command used by SPI_control() to enable partial return.

Enabling this command allows SPI_transfer to return partial data if the controller de-asserts the CS line before the expected number of frames were received. This command arg is of type don't care and it returns SPI_STATUS_SUCCESS or SPI_STATUS_ERROR.

§ SPILPF3DMA_CMD_RETURN_PARTIAL_DISABLE

#define SPILPF3DMA_CMD_RETURN_PARTIAL_DISABLE   (SPI_CMD_RESERVED + 1)

Command used by SPI_control() to disable partial return.

Disabling this command returns the SPILPF3DMA to the default blocking behavior where SPI_transfer blocks until all data bytes were received. With this command arg is don't care and it returns SPI_STATUS_SUCCESS.

§ SPILPF3DMA_CMD_SET_CSN_PIN

#define SPILPF3DMA_CMD_SET_CSN_PIN   (SPI_CMD_RESERVED + 2)

Command used by SPI_control() to re-configure chip select pin.

This command specifies a chip select pin in arg with type uint_least8_t. It always returns SPI_STATUS_SUCCESS.

§ SPILPF3DMA_CMD_CLEAR_CSN_PIN

#define SPILPF3DMA_CMD_CLEAR_CSN_PIN   (SPI_CMD_RESERVED + 3)

Command used by SPI_control() to clear the chip select pin.

This command arg should be NULL. It always returns SPI_STATUS_SUCCESS.

§ SPILPF3DMA_CMD_SET_MANUAL

#define SPILPF3DMA_CMD_SET_MANUAL   (SPI_CMD_RESERVED + 4)

Command used by SPI_control() to enable manual start mode.

Manual start mode can only be used when in callback mode. In manual start mode, calls to SPI_transfer() queue the transaction but does not start the transfer until another control call is made with SPILPF3DMA_CMD_MANUAL_START. This allows multiple transactions to be queued and executed seamlessly using the DMA's ping pong mechanism. This mode is MANDATORY for peripherals queueing multiple short transactions. Manual start mode can only be enabled or disabled when no transactions are queued.

Returns SPI_STATUS_SUCCESS or SPI_STATUS_ERROR.

§ SPILPF3DMA_CMD_CLR_MANUAL

#define SPILPF3DMA_CMD_CLR_MANUAL   (SPI_CMD_RESERVED + 5)

Command used by SPI_control() to disable manual start mode.

Manual start mode is disabled by default. Enabling and disabling manual mode can only be done if no transactions are currently queued.

Returns SPI_STATUS_SUCCESS or SPI_STATUS_ERROR.

§ SPILPF3DMA_CMD_MANUAL_START

#define SPILPF3DMA_CMD_MANUAL_START   (SPI_CMD_RESERVED + 6)

Command used by SPI_control() to enable manual start mode.

This command is used with manual start mode enabled. If transactions have been queued and the driver is in manual mode, this command will enable the SSI and DMA. For controller devices, the transfer will start. For peripheral devices, the transfer will start when the controller initiates.

Returns SPI_STATUS_SUCCESS or SPI_STATUS_ERROR.

§ SPILPF3DMA_CMD_SET_SAMPLE_DELAY

#define SPILPF3DMA_CMD_SET_SAMPLE_DELAY   (SPI_CMD_RESERVED + 7)

Command used by SPI_control() to set the sample delay in controller mode.

This command is only used when in controller mode. After SPI_open() is called, the default DSAMPLE value is set as follows.

  • (bitRate < 4MHz) -> delay = 0
  • (bitRate >= 4MHz) -> delay = 1
  • (bitRate >= 8MHz) -> delay = 2

The sample delay is a measurement of clock cycles. In controller mode the data on the input pin will delay sampling by the defined clock cycles. At lower bitRates a delay is usually not necessary. At higher bitRates a delay may become necessary if the peripheral device is not keeping pace with the controller device. In this case, the delay can be used to ensure the controller device captures the data on the input pin. This command arg is of type uint8_t.

Returns SPI_STATUS_SUCCESS or SPI_STATUS_ERROR.

© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale