S32 SDK
lpspi_shared_function.h File Reference
#include <stdbool.h>
#include "lpspi_hal.h"
#include "edma_driver.h"
#include "osif.h"
#include "status.h"

Go to the source code of this file.

Data Structures

struct  lpspi_state_t
 Runtime state structure for the LPSPI master driver. More...
 

Enumerations

enum  lpspi_transfer_type { LPSPI_USING_DMA = 0, LPSPI_USING_INTERRUPTS }
 Type of LPSPI transfer (based on interrupts or DMA). Implements : lpspi_transfer_type_Class. More...
 
enum  transfer_status_t { LPSPI_TRANSFER_OK = 0U, LPSPI_TRANSMIT_FAIL, LPSPI_RECEIVE_FAIL }
 

Functions

void LPSPI_DRV_IRQHandler (uint32_t instance)
 The function LPSPI_DRV_IRQHandler passes IRQ control to either the master or slave driver. More...
 
void LPSPI_DRV_FillupTxBuffer (uint32_t instance)
 The function LPSPI_DRV_FillupTxBuffer writes data in TX hardware buffer depending on driver state and number of bytes remained to send. More...
 
void LPSPI_DRV_ReadRXBuffer (uint32_t instance)
 The function LPSPI_DRV_ReadRXBuffer reads data from RX hardware buffer and writes this data in RX software buffer. More...
 
void LPSPI_DRV_DisableTEIEInterrupts (uint32_t instance)
 Disable the TEIE interrupts at the end of a transfer. Disable the interrupts and clear the status for transmit/receive errors. More...
 
Non-blocking transfers
void LPSPI_DRV_MasterIRQHandler (uint32_t instance)
 Interrupt handler for LPSPI master mode. This handler uses the buffers stored in the lpspi_master_state_t structs to transfer data. More...
 
Non-blocking transfers
void LPSPI_DRV_SlaveIRQHandler (uint32_t instance)
 Interrupt handler for LPSPI slave mode. This handler uses the buffers stored in the lpspi_master_state_t structs to transfer data. More...
 

Variables

LPSPI_Typeg_lpspiBase [LPSPI_INSTANCE_COUNT]
 Table of base pointers for SPI instances. More...
 
IRQn_Type g_lpspiIrqId [LPSPI_INSTANCE_COUNT]
 Table to save LPSPI IRQ enumeration numbers defined in the CMSIS header file. More...
 
lpspi_state_tg_lpspiStatePtr [LPSPI_INSTANCE_COUNT]