Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Enum

This section introduces the enumerations that should be configured before performing transfer. More...

Overview

This section introduces the enumerations that should be configured before performing transfer.

Enumerations

enum  spis_cpol {
  SPIS_CPOL_0 = 0,
  SPIS_CPOL_1 = 1
}
 SPI slave's clock polarity definition. More...
 
enum  spis_cpha {
  SPIS_CPHA_0 = 0,
  SPIS_CPHA_1 = 1
}
 SPI slave's clock format definition. More...
 
enum  spis_opcode {
  OPCODE_SPIM_WRITE_SPIS_RX = 0x1,
  OPCODE_SPIM_READ_SPIS_TX = 0x2,
  OPCODE_SPIM_GET_SPIS_STATUS = 0x3,
  OPCODE_SPIM_SET_SPIS_IRQ = 0x8,
  OPCODE_SPIM_CLEAR_SPIS_D2HMB = 0x9,
  OPCODE_SPIM_SEND_SPIS_H2DMB = 0xa
}
 SPI slave's supported opcode. More...
 
enum  spis_tx_rx_flag {
  SPIM_READ_DATA_FROM_SPIS = 0x0,
  SPIM_WRITE_DATA_TO_SPIS = 0x1,
  SPIM_READ_STATUS_FROM_SPIS = 0x2,
  SPIM_WRITE_IRQ_MB_TO_SPIS = 0x3
}
 SPI slave's transmisson type. More...
 
enum  spis_d2hmb_state {
  SPIS_IDLE = 0x0,
  SPIS_READY = 0x1,
  SPIS_DONE = 0x2,
  SPIS_ERR = 0x4
}
 SPI slave's supported transaction status. More...
 
enum  spis_direction_cmd {
  SPIM_READ_DATA = 0,
  SPIM_WRITE_DATA = 1
}
 SPI transmission direction cmd definition. More...
 

Enumeration Type Documentation

enum spis_cpol

SPI slave's clock polarity definition.

Before performing transfer, users should make sure that the cpol parameter is defined in mtk_spis_config structure and is configured through mtk_mhal_spis_setup_hw().

Enumerator
SPIS_CPOL_0 

Clock polarity is 0.

SPIS_CPOL_1 

Clock polarity is 1.

enum spis_cpha

SPI slave's clock format definition.

Before performing transfer, users should make sure that the cpha parameter is defined in mtk_spis_config structure and is configured through mtk_mhal_spis_setup_hw().

Enumerator
SPIS_CPHA_0 

Clock format is 0.

SPIS_CPHA_1 

Clock format is 1.

SPI slave's supported opcode.

Before performing transfer, spi master should send different OPCODE to let spi slave controller know the current transaction type.

Enumerator
OPCODE_SPIM_WRITE_SPIS_RX 

spim writes data to spis

OPCODE_SPIM_READ_SPIS_TX 

spim reads data from spis

OPCODE_SPIM_GET_SPIS_STATUS 

spim reads spis status

OPCODE_SPIM_SET_SPIS_IRQ 

spim sets spis irq

OPCODE_SPIM_CLEAR_SPIS_D2HMB 

spim clears spis D2HMB

OPCODE_SPIM_SEND_SPIS_H2DMB 

spim sends H2DMB to spis

SPI slave's transmisson type.

spis_tx_rx_flag corresponds to SPIS_STATUS Bit[5:4], Which is used to determine the type of current transmission in the irq handler function.

Enumerator
SPIM_READ_DATA_FROM_SPIS 

SPIM read data from SPIS(SPIS TX)

SPIM_WRITE_DATA_TO_SPIS 

SPIM write data to SPIS(SPIS RX)

SPIM_READ_STATUS_FROM_SPIS 

SPIM read SPIS_STATUS from SPIS(SPIS TX)

SPIM_WRITE_IRQ_MB_TO_SPIS 

SPIM write IRQ/MB to SPIS(SPIS RX)

SPI slave's supported transaction status.

This status will be updated to register SPIS_STATUS(0x60) by writing register SPIS_D2HMB(0x68). spi master checks spi slave transaction status via this status.

Enumerator
SPIS_IDLE 

spis idle

SPIS_READY 

spis preparation transfer ready

SPIS_DONE 

spis transfer done

SPIS_ERR 

spis transfer error

SPI transmission direction cmd definition.

spi master tells spi slave through H2DMB whether this transmission wants to read or write.

Enumerator
SPIM_READ_DATA 

spim wants to read data

SPIM_WRITE_DATA 

spim wants to write data