monoZ docs
SPI

-For monoZ SPI refer MZ_spi.h file. More...

Functions

MZ_SPI_BTYPE_PTR MZ_SPI_get_base_address (void)
 This function returns the base address of all the SPI defined in SDK. More...
 
MZ_SPI_BTYPE_PTR MZ_SPI_reference (en_spi_no spi_no)
 This function returns the address of specific SPI defined in SDK. More...
 
mz_error_t MZ_SPI_init (MZ_SPI_INIT_PTR _cfg)
 This function initializes the specific SPI. More...
 
mz_error_t MZ_SPI_register_callback (uint8_t spi_no, _spi_api cb)
 This function registers the SPI Event callback. More...
 
mz_error_t MZ_SPI_register_intr_cb_tx (uint8_t spi_no, _spi_api cb)
 This function registers the Interrupt for TX complete callback function for the specific SPI. More...
 
mz_error_t MZ_SPI_register_intr_cb_rx (uint8_t spi_no, _spi_api cb)
 This function registers the Interrupt for RX complete callback function for the specific SPI. More...
 
void MZ_HAL_SPI_IRQHandler (uint8_t spi_no)
 This function defines the Global Interrupt handler functions of SPI. More...
 
mz_error_t MZ_SPI_Transmit (uint8_t spi_no, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 This function is used to transmit data using SPI in polling mode. More...
 
mz_error_t MZ_SPI_Receive (uint8_t spi_no, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 This function is used to receive data using SPI in polling mode. More...
 
mz_error_t MZ_SPI_TransmitReceive (uint8_t spi_no, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
 This function is used to transmit/receive data using SPI in polling mode. More...
 
mz_error_t MZ_SPI_Transmit_IT (uint8_t spi_no, uint8_t *pData, uint16_t Size)
 This function is used to transmit data using SPI in interrupt mode. More...
 
mz_error_t MZ_SPI_Receive_IT (uint8_t spi_no, uint8_t *pData, uint16_t Size)
 This function is used to receive data using SPI in interrupt mode. More...
 
mz_error_t MZ_SPI_TransmitReceive_IT (uint8_t spi_no, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
 This function is used to transmit/receive data using SPI in interrupt mode. More...
 

Detailed Description

-For monoZ SPI refer MZ_spi.h file.

Function Documentation

◆ MZ_SPI_get_base_address()

MZ_SPI_BTYPE_PTR MZ_SPI_get_base_address ( void  )

This function returns the base address of all the SPI defined in SDK.

Returns
Base address of SPI

◆ MZ_SPI_reference()

MZ_SPI_BTYPE_PTR MZ_SPI_reference ( en_spi_no  spi_no)

This function returns the address of specific SPI defined in SDK.

Parameters
spi_noen_spi_no
Returns
Reference of SPI

◆ MZ_SPI_init()

mz_error_t MZ_SPI_init ( MZ_SPI_INIT_PTR  _cfg)

This function initializes the specific SPI.

Parameters
_cfgMZ_SPI_INIT_PTR
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_register_callback()

mz_error_t MZ_SPI_register_callback ( uint8_t  spi_no,
_spi_api  cb 
)

This function registers the SPI Event callback.

Parameters
spi_nouint8_t
cb_spi_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_register_intr_cb_tx()

mz_error_t MZ_SPI_register_intr_cb_tx ( uint8_t  spi_no,
_spi_api  cb 
)

This function registers the Interrupt for TX complete callback function for the specific SPI.

Parameters
spi_nouint8_t
cb_spi_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_register_intr_cb_rx()

mz_error_t MZ_SPI_register_intr_cb_rx ( uint8_t  spi_no,
_spi_api  cb 
)

This function registers the Interrupt for RX complete callback function for the specific SPI.

Parameters
spi_nouint8_t
cb_spi_api
Returns
MZ_OK/MZ_FAIL

◆ MZ_HAL_SPI_IRQHandler()

void MZ_HAL_SPI_IRQHandler ( uint8_t  spi_no)

This function defines the Global Interrupt handler functions of SPI.

Parameters
spi_nouint8_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_Transmit()

mz_error_t MZ_SPI_Transmit ( uint8_t  spi_no,
uint8_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

This function is used to transmit data using SPI in polling mode.

Parameters
spi_nouint8_t
pData*uint8_t
Sizeuint8_t
Timeoutuint32_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_Receive()

mz_error_t MZ_SPI_Receive ( uint8_t  spi_no,
uint8_t *  pData,
uint16_t  Size,
uint32_t  Timeout 
)

This function is used to receive data using SPI in polling mode.

Parameters
spi_nouint8_t
pData*uint8_t
Sizeuint16_t
Timeoutuint32_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_TransmitReceive()

mz_error_t MZ_SPI_TransmitReceive ( uint8_t  spi_no,
uint8_t *  pTxData,
uint8_t *  pRxData,
uint16_t  Size,
uint32_t  Timeout 
)

This function is used to transmit/receive data using SPI in polling mode.

Parameters
spi_nouint8_t
pTxData*uint8_t
pRxData*uint8_t
Sizeuint16_t
Timeoutuint32_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_Transmit_IT()

mz_error_t MZ_SPI_Transmit_IT ( uint8_t  spi_no,
uint8_t *  pData,
uint16_t  Size 
)

This function is used to transmit data using SPI in interrupt mode.

Parameters
spi_nouint8_t
pData*uint8_t
Sizeuint16_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_Receive_IT()

mz_error_t MZ_SPI_Receive_IT ( uint8_t  spi_no,
uint8_t *  pData,
uint16_t  Size 
)

This function is used to receive data using SPI in interrupt mode.

Parameters
spi_nouint8_t
pData*uint8_t
Sizeuint16_t
Returns
MZ_OK/MZ_FAIL

◆ MZ_SPI_TransmitReceive_IT()

mz_error_t MZ_SPI_TransmitReceive_IT ( uint8_t  spi_no,
uint8_t *  pTxData,
uint8_t *  pRxData,
uint16_t  Size 
)

This function is used to transmit/receive data using SPI in interrupt mode.

Parameters
spi_nouint8_t
pTxData*uint8_t
pRxData*uint8_t
Sizeuint16_t
Returns
MZ_OK/MZ_FAIL