spidrv.c File Reference

SPIDRV API implementation.

License

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

Definition in file spidrv.c .

#include <string.h>
#include "em_device.h"
#include " em_gpio.h "
#include " em_core.h "
#include " em_usart.h "
#include " dmadrv.h "
#include " spidrv.h "

Functions

Ecode_t SPIDRV_AbortTransfer ( SPIDRV_Handle_t handle)
Abort an ongoing SPI transfer.
Ecode_t SPIDRV_DeInit ( SPIDRV_Handle_t handle)
Deinitialize an SPI driver instance.
Ecode_t SPIDRV_GetBitrate ( SPIDRV_Handle_t handle, uint32_t *bitRate)
Get current SPI bus bitrate.
Ecode_t SPIDRV_GetFramelength ( SPIDRV_Handle_t handle, uint32_t *frameLength)
Get current SPI framelength.
Ecode_t SPIDRV_GetTransferStatus ( SPIDRV_Handle_t handle, int *itemsTransferred, int *itemsRemaining)
Get the status of an SPI transfer.
Ecode_t SPIDRV_Init ( SPIDRV_Handle_t handle, SPIDRV_Init_t *initData)
Initialize an SPI driver instance.
Ecode_t SPIDRV_MReceive ( SPIDRV_Handle_t handle, void *buffer, int count, SPIDRV_Callback_t callback)
Start an SPI master receive transfer.
Ecode_t SPIDRV_MReceiveB ( SPIDRV_Handle_t handle, void *buffer, int count)
Start an SPI master blocking receive transfer.
Ecode_t SPIDRV_MTransfer ( SPIDRV_Handle_t handle, const void *txBuffer, void * rxBuffer , int count, SPIDRV_Callback_t callback)
Start an SPI master transfer.
Ecode_t SPIDRV_MTransferB ( SPIDRV_Handle_t handle, const void *txBuffer, void * rxBuffer , int count)
Start an SPI master blocking transfer.
Ecode_t SPIDRV_MTransferSingleItemB ( SPIDRV_Handle_t handle, uint32_t txValue, void *rxValue)
Start an SPI master blocking single item (frame) transfer.
Ecode_t SPIDRV_MTransmit ( SPIDRV_Handle_t handle, const void *buffer, int count, SPIDRV_Callback_t callback)
Start an SPI master transmit transfer.
Ecode_t SPIDRV_MTransmitB ( SPIDRV_Handle_t handle, const void *buffer, int count)
Start an SPI master blocking transmit transfer.
Ecode_t SPIDRV_SetBitrate ( SPIDRV_Handle_t handle, uint32_t bitRate)
Set SPI bus bitrate.
Ecode_t SPIDRV_SetFramelength ( SPIDRV_Handle_t handle, uint32_t frameLength)
Set SPI framelength.
Ecode_t SPIDRV_SReceive ( SPIDRV_Handle_t handle, void *buffer, int count, SPIDRV_Callback_t callback, int timeoutMs)
Start an SPI slave receive transfer.
Ecode_t SPIDRV_SReceiveB ( SPIDRV_Handle_t handle, void *buffer, int count, int timeoutMs)
Start an SPI slave blocking receive transfer.
Ecode_t SPIDRV_STransfer ( SPIDRV_Handle_t handle, const void *txBuffer, void * rxBuffer , int count, SPIDRV_Callback_t callback, int timeoutMs)
Start an SPI slave transfer.
Ecode_t SPIDRV_STransferB ( SPIDRV_Handle_t handle, const void *txBuffer, void * rxBuffer , int count, int timeoutMs)
Start an SPI slave blocking transfer.
Ecode_t SPIDRV_STransmit ( SPIDRV_Handle_t handle, const void *buffer, int count, SPIDRV_Callback_t callback, int timeoutMs)
Start an SPI slave transmit transfer.
Ecode_t SPIDRV_STransmitB ( SPIDRV_Handle_t handle, const void *buffer, int count, int timeoutMs)
Start an SPI slave blocking transmit transfer.