21 #ifdef DRV_SPI_MODULE_ENABLED 91 #ifndef DRV_HANDLE_CHECK_INACTIVE 92 #define DRV_HANDLE_CHECK(handle);\ 94 return DRV_ERROR_PARAM; \ 96 if((handle)->ptDevice.ptSPI==0){ \ 97 return DRV_ERROR_PARAM; \ 100 #define DRV_HANDLE_CHECK(handle); 436 for(i = 0; i < border; i++)
480 for(i = 0; i < border; i++)
727 if(pcData == 0 || size == 0 || size > 0x7ffff)
735 size_t ulArraySize = size;
742 ulArraySize += (2 - ulArraySize) % 2;
750 ulArraySize += (4 - ulArraySize) % 4;
844 if(pcData == 0 || size == 0 || size > 0x7ffff)
852 size_t ulArraySize = size;
859 ulArraySize += (2 - ulArraySize) % 2;
867 ulArraySize += (4 - ulArraySize) % 4;
966 if(pcTxData == 0 || pcRxData == 0 || size == 0 || size > 0x7ffff)
973 size_t ulArraySize = size;
976 ulArraySize += (2 - ulArraySize) % 2;
1202 DRV_SPI_HANDLE_T *
const ptDriver = s_apHandleAddressTable[ulDeviceOffset];
1204 if(ptDriver->
ptDevice.
pt != s_apDeviceAddressTable[ulDeviceOffset].
pt)
1206 ((
DRV_SPI_DEVICE_U const) s_apDeviceAddressTable[ulDeviceOffset]).ptSPI->spi_imsc = 0;
1262 #define DRV_SPI_IRQHandler_Generator(id, _) DRV_Default_IRQHandler_Function_Generator(DRV_SPI_IRQ_HANDLER ## id,DRV_SPI_IRQ_Inline_Handler,(DRV_SPI_DEVICE_ID_E)(DRV_SPI_DEVICE_ID_MIN + id)) DRV_SPI_STATE_E
Enumeration of the spi state informations.
#define DRV_DEF_REPEAT_EVAL(...)
DRV_SPI_BEHAVIOUR_E eBehaviour
DRV_DMAC_TRANSFER_WIDTH_E
The width of a dmac transfer.
#define DRV_LOCK_INITIALIZER
Initializer of the type to be locked as rvalue is in default the mutex initializer.
DRV_DMAC_DEVICE_ID_E eDeviceID
struct sqi_Type::@4043::@4070 sqi_cr1_b
DRV_SPI_FSS_E
Enumeration of the frame or slave select (FSS) signal pin mask.
void DRV_NVIC_DisableIRQ(IRQn_Type IRQn)
This method disables a given interrupt.
__IOM uint32_t sqi_pio_oe
__IOM uint32_t sqi_irq_raw
DRV_STATUS_E DRV_DMAC_Abort(DRV_DMAC_HANDLE_T *const ptSequencer)
Aborts the given dmac sequencer.
DRV_SPI_CONFIGURATION_T tConfiguration
DRV_SPI_DEVICE_ID_E eSPIDeviceID
DRV_SPI_FIFO_WM_E eRxFiFoWm
void * pCompleteCallbackHandle
static void DRV_SPI_Flush_DMA_Callback_Tx(void *ptDriverHandle, DRV_SPI_HANDLE_T *const ptDriver)
size_t volatile RxBufferCounter
__IOM uint32_t sqi_irq_mask
void DRV_NVIC_EnableIRQ(IRQn_Type IRQn)
This method enables a given interrupt.
struct sqi_Type::@4059::@4078 sqi_dmacr_b
DRV_DMAC_HANDLE_T * ptSequencerTx
static DRV_STATUS_E DRV_SPI_Flush_IRQ(DRV_SPI_HANDLE_T *const ptDriver)
This method shall perform a flush by interrupt mode.
void * ptCallbackHandleComplete
static DRV_STATUS_E DRV_SPI_Flush_DMA(DRV_SPI_HANDLE_T *const ptDriver)
This method shall perform a flush by dma mode.
struct spi0_app_Type::@4776::@4802 spi_cr0_b
DRV_SPI_LOOP_BACK_MODE_E eLoopBackMode
struct spi0_app_Type::@4778::@4803 spi_cr1_b
DRV_SPI_DEVICE_ID_E
The SPI device IDs.
static DRV_SPI_DEVICE_U const s_apDeviceAddressTable[DRV_SPI_DEVICE_COUNT]
Table of the device addresses.
#define DRV_SPI_DEVICE_COUNT
__STATIC_INLINE int DRV_IRQ_Enable(void)
This is a semaphore function for nested enabling the interrupts.
DRV_CALLBACK_F fCallbackComplete
DRV_SPI_FRAME_FORMAT_E eFrameFormat
#define DRV_LOCK(__HANDLE__)
A function calling the trylock of the mutex and returning locked in case it is blocked.
DRV_SPI_FREQUENCY_E eFrequency
struct sqi_Type::@4041::@4069 sqi_cr0_b
DRV_SPI_DEVICE_U ptDevice
struct spi0_app_Type::@4784::@4806 spi_imsc_b
__IOM uint32_t sqi_sqirom_cfg
DRV_DMAC_TRANSFER_WIDTH_E eTransferWidthDest
static DRV_STATUS_E DRV_SPI_Flush_POLL(DRV_SPI_HANDLE_T *const ptDriver)
This method shall perform a flush by polling mode.
__STATIC_INLINE void DRV_SPI_IRQ_Inline_Handler(DRV_SPI_DEVICE_ID_E const eDeviceID)
struct spi0_app_Type::@4792::@4810 spi_dmacr_b
size_t volatile TxBufferCounter
DRV_DMAC_TRANSFER_WIDTH_E eTransferWidthSource
DRV_DMAC_INCREMENTATION_E eIncrementationDest
#define DRV_SPI_DEVICE_DMA_LIST
This file contains all the functions prototypes for the peripheral module driver. ...
DRV_STATUS_E DRV_SPI_Abort(DRV_SPI_HANDLE_T *const ptDriver)
Function for aborting the current data transfer on the SPI device.
__IOM uint32_t sqi_irq_clear
The handle of the driver.
size_t volatile TxBufferSize
DRV_DMAC_CONFIGURATION_T tConfiguration
DRV_DMAC_HANDLE_T * ptSequencerRx
static DRV_DMAC_PERIPHERAL_E const s_apDeviceDmacTable[DRV_SPI_DEVICE_COUNT]
Table of the dma channels of the devices.
__STATIC_INLINE DRV_STATUS_E DRV_SPI_Flush_Buffers(DRV_SPI_HANDLE_T *const ptDriver)
This function shall flush the software and hardware buffers of the device.
#define UNUSED(x)
If there is the need to outsmart the compiler or linter.
DRV_STATUS_E DRV_SPI_DeInit(DRV_SPI_HANDLE_T *const ptDriver)
This function disables the DRV_SPI_HANDLE_T object.
DRV_STATUS_E DRV_SPI_ChangeFss(DRV_SPI_HANDLE_T *const ptDriver, DRV_SPI_FSS_E eFss)
Function for changing the fss between transactions.
DRV_SPI_DATA_SIZE_SELECT_E eDataSize
void(* DRV_CALLBACK_F)(void *pvDriverHandle, void *pvUserHandle)
The definition of callbacks used in the driver.
DRV_STATUS_E
DRV Status structures definition.
DRV_STATUS_E DRV_SPI_GetState(DRV_SPI_HANDLE_T *const ptDriver, DRV_SPI_STATE_E *const ptState)
Function returning a driver spi state enumeration and a return code.
DRV_STATUS_E DRV_SPI_Receive(DRV_SPI_HANDLE_T *const ptDriver, uint8_t *pcData, size_t size)
Function for receiveing data of given size by the SPI device.
DRV_SPI_FSS_STATIC_E eFSSStatic
size_t volatile RxBufferSize
DRV_SPI_PARALLELISM_E eParallelism
static IRQn_Type const s_apHandleIRQnTable[DRV_SPI_DEVICE_COUNT]
Table of the IRQ vector numbers.
struct spi0_app_Type::@4782::@4805 spi_sr_b
DRV_OPERATION_MODE_E eOperationMode
DRV_SPI_DUMMYPATTERN_E uDummyPattern
void DRV_NVIC_ClearPendingIRQ(IRQn_Type IRQn)
This method clears the pending state of a given interrupt.
DRV_STATUS_E DRV_DMAC_Start(DRV_DMAC_HANDLE_T *const ptSequencer, void *const ptBufferSource, void *const ptBufferDestination, size_t size)
Starts the given dmac sequencer.
#define DRV_HANDLE_CHECK(handle)
static DRV_SPI_HANDLE_T * s_apHandleAddressTable[DRV_SPI_DEVICE_COUNT]
Used for mapping the handle to an interrupt.
DRV_STATUS_E DRV_DMAC_Init(DRV_DMAC_HANDLE_T *const ptSequencer)
Initializes the dmac sequencer and its handle by the given configuration.
DRV_SPI_SLV_SIG_EARLY_E eSlaveSigEarly
DRV_STATUS_E DRV_SPI_Init(DRV_SPI_HANDLE_T *const ptDriver)
This function initializes the DRV_SPI_HANDLE_T object.
DRV_STATUS_E DRV_SPI_TransmitReceive(DRV_SPI_HANDLE_T *const ptDriver, uint8_t *txData, uint8_t *rxData, size_t size)
Function for transmitting and receiveing data at the same time of given size by the SPI device...
#define DRV_UNLOCK(__HANDLE__)
The release function used.
DRV_DMAC_INCREMENTATION_E eIncrementationSource
#define DRV_SPI_IRQHandler_Generator(id, _)
#define DRV_SPI_DEVICE_LIST
DRV_STATUS_E DRV_SPI_Transmit(DRV_SPI_HANDLE_T *const ptDriver, uint8_t *pcData, size_t size)
Function for transmitting data of given size via the SPI device.
DRV_SPI_FIFO_WM_E eTxFiFoWm
#define DRV_SPI_DEVICE_IRQ_LIST
struct sqi_Type::@4051::@4074 sqi_irq_mask_b
__IOM uint32_t sqi_pio_out
__STATIC_INLINE int DRV_IRQ_Disable(void)
This is a semaphore function for nested disabling the interrupts.
DRV_DMAC_PERIPHERAL_E ePeripheralSource
static void DRV_SPI_Flush_DMA_Callback_Rx(void *ptDriverHandle, DRV_SPI_HANDLE_T *const ptDriver)
struct sqi_Type::@4049::@4073 sqi_tcr_b
uint64_t ullFrameStartTick
DRV_DMAC_DEVICE_ID_E eDMARx
DRV_DMAC_DEVICE_ID_E eDMATx
DRV_DMAC_PERIPHERAL_E ePeripheralDest
DRV_CALLBACK_F fnCompleteCallback