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

I/O INTERFACE between SPI OS-HAL and M-HAL. More...

#include <mhal_spim.h>

Data Fields

const void * tx_buf
 data to be written (DMA-safe memory), or NULL
 
void * rx_buf
 data to be read (DMA-safe memory), or NULL
 
u32 len
 size of rx and tx buffers (in bytes)
 
u32 opcode
 opcode data to be written (on MOSI pin)
 
u32 opcode_len
 size of opcode length (in bytes)
Note on MT3620:
half duplex:
TX only: it should be 1~4. More...
 
u32 use_dma
 spi support FIFO & DMA mode, 0:FIFO, 1: DMA
 
u32 speed_khz
 config SPIM HW SCK speed that talk with device for this transfer. More...
 

Detailed Description

I/O INTERFACE between SPI OS-HAL and M-HAL.

struct mtk_spi_transfer - a read/write buffer pair.
SPI transfers always write the same number of bytes as they read.
OS-HAL should always provide rx_buf and/or tx_buf.

Field Documentation

u32 opcode_len

size of opcode length (in bytes)
Note on MT3620:
half duplex:
TX only: it should be 1~4.

RX only: it should be 0~4.
full duplex: it should be 1~4.

u32 speed_khz

config SPIM HW SCK speed that talk with device for this transfer.

The maximum CLK freq is 40Mhz and the suggestion value of speed_khz is 250 (250Khz),500(500Khz),1000(1Mhz),2000(2Mhz),4000(4Mhz), 6000(6Mhz),8000(8Mhz),10000(10Mhz),40000(40Mhz).
If speed_khz=0, SPIM HW use default 1Mhz.


The documentation for this struct was generated from the following file: