Astra MCU SDK Peripheral Driver Library
 
Loading...
Searching...
No Matches
Enumerated Types

Enumerated types for SPI driver. More...

Enumerations

enum  spi_status_en {
  SPI_OK = 0 ,
  SPI_ERROR ,
  SPI_ERROR_PARAMETER ,
  SPI_ERROR_BUSY ,
  SPI_ERROR_TIMEOUT ,
  SPI_ERROR_UNSUPPORTED ,
  SPI_ERROR_BAUDRATE ,
  SPI_ERROR_NOT_INITIALIZED ,
  SPI_ERROR_TX_OVERFLOW
}
 SPI driver status and error codes. More...
 
enum  spi_transfer_status_en {
  SPI_TRANSFER_IN_PROGRESS = 0x01 ,
  SPI_TRANSFER_TIMEOUT = 0x02 ,
  SPI_TRANSFER_ERROR = 0x03 ,
  SPI_TRANSFER_DONE = 0x04 ,
  SPI_FIFO_DRAINED = 0x05 ,
  SPI_ALL_DATA_IN_FIFO = 0x06
}
 SPI transfer status. More...
 
enum  spi_sclk_mode_en {
  SPI_CPHA0_CPOL0 = 0U ,
  SPI_CPHA1_CPOL0 = 1U ,
  SPI_CPHA0_CPOL1 = 2U ,
  SPI_CPHA1_CPOL1 = 3U
}
 SPI clock mode. More...
 
enum  spi_xfer_mode_en {
  SPI_TRANSMIT_AND_RECEIVE = 0u ,
  SPI_TRANSMIT_ONLY = 1u ,
  SPI_RECEIVE_ONLY = 2u ,
  SPI_EEPROM_READ = 3u
}
 SPI transfer mode. More...
 

Detailed Description

Enumerated types for SPI driver.

Enumeration Type Documentation

◆ spi_status_en

SPI driver status and error codes.

This enumeration defines various return and error codes used by the SPI driver to indicate operation success, failure, and specific error conditions.

Enumerator
SPI_OK 

Operation succeeded

SPI_ERROR 

Unspecified error

SPI_ERROR_PARAMETER 

Invalid parameter

SPI_ERROR_BUSY 

Driver is busy

SPI_ERROR_TIMEOUT 

Timeout occurred

SPI_ERROR_UNSUPPORTED 

Operation not supported

SPI_ERROR_BAUDRATE 

Baudrate is not supported in current clock source

SPI_ERROR_NOT_INITIALIZED 

device instance was not initialized

SPI_ERROR_TX_OVERFLOW 

SPI TX overflow

◆ spi_transfer_status_en

SPI transfer status.

This enumeration defines various transfer status used by the SPI driver.

Enumerator
SPI_TRANSFER_IN_PROGRESS 

SPI transfer is in progress

SPI_TRANSFER_TIMEOUT 

SPI transfer timeout

SPI_TRANSFER_ERROR 

SPI transfer error

SPI_TRANSFER_DONE 

SPI transfer done

SPI_FIFO_DRAINED 

SPI fifo drained

SPI_ALL_DATA_IN_FIFO 

SPI datas written in TX fifo

◆ spi_sclk_mode_en

SPI clock mode.

This enumeration defines the SPI clock polarity and phase.

Enumerator
SPI_CPHA0_CPOL0 

Clock is active low, data is changed on first edge

SPI_CPHA1_CPOL0 

Clock is active low, data is changed on second edge

SPI_CPHA0_CPOL1 

Clock is active high, data is changed on first edge

SPI_CPHA1_CPOL1 

Clock is active high, data is changed on second edge

◆ spi_xfer_mode_en

SPI transfer mode.

This enumeration selects the direction and type of SPI data transfer.

Enumerator
SPI_TRANSMIT_AND_RECEIVE 

Both transmit and receive are enabled

SPI_TRANSMIT_ONLY 

Only transmit is enabled, receive data is dropped

SPI_RECEIVE_ONLY 

Only receive is enabled, first word written to TX FIFO is repeated, Total data received is specified in spi_config_t

SPI_EEPROM_READ 

First send all control data (address, opcode), While sending control data receive data is ignored Once TX FIFO is empty receive data is stored in RX FIFO; amount received is specified in spi_config_t