lpspi_master_driver.c File Reference
#include <string.h>
#include "lpspi_master_driver.h"
#include "clock_manager.h"
#include "interrupt_manager.h"
#include "device_registers.h"
#include "lpspi_hw_access.h"

Go to the source code of this file.

Macros

#define MICROSECONDS   1000000
 

Functions

static status_t LPSPI_DRV_MasterStartTransfer (uint32_t instance, const uint8_t *sendBuffer, uint8_t *receiveBuffer, uint16_t transferByteCount)
 
static void LPSPI_DRV_MasterCompleteTransfer (uint32_t instance)
 Finish up a transfer. Cleans up after a transfer is complete. Interrupts are disabled, and the LPSPI module is disabled. This is not a public API as it is called from other driver functions. More...
 
static void LPSPI_DRV_MasterCompleteDMATransfer (void *parameter, edma_chn_status_t status)
 Finish up a transfer DMA. The main purpose of this function is to create a function compatible with DMA callback type. More...
 
static void LPSPI_DRV_MasterClearCountinuous (void *parameter, edma_chn_status_t status)
 Clear the continuous mode. The main purpose of this function is to clear continuous mode. More...
 
status_t LPSPI_DRV_MasterInit (uint32_t instance, lpspi_state_t *lpspiState, const lpspi_master_config_t *spiConfig)
 Initializes a LPSPI instance for interrupt driven master mode operation. More...
 
status_t LPSPI_DRV_MasterDeinit (uint32_t instance)
 Shuts down a LPSPI instance. More...
 
status_t LPSPI_DRV_MasterSetDelay (uint32_t instance, uint32_t delayBetwenTransfers, uint32_t delaySCKtoPCS, uint32_t delayPCStoSCK)
 Configures the LPSPI master mode bus timing delay options. More...
 
status_t LPSPI_DRV_MasterConfigureBus (uint32_t instance, const lpspi_master_config_t *spiConfig, uint32_t *calculatedBaudRate)
 Configures the LPSPI port physical parameters to access a device on the bus when the LSPI instance is configured for interrupt operation. More...
 
status_t LPSPI_DRV_MasterTransferBlocking (uint32_t instance, const uint8_t *sendBuffer, uint8_t *receiveBuffer, uint16_t transferByteCount, uint32_t timeout)
 Performs an interrupt driven blocking SPI master mode transfer. More...
 
status_t LPSPI_DRV_MasterTransfer (uint32_t instance, const uint8_t *sendBuffer, uint8_t *receiveBuffer, uint16_t transferByteCount)
 Performs an interrupt driven non-blocking SPI master mode transfer. More...
 
status_t LPSPI_DRV_MasterGetTransferStatus (uint32_t instance, uint32_t *bytesRemained)
 Returns whether the previous interrupt driven transfer is completed. More...
 
status_t LPSPI_DRV_MasterAbortTransfer (uint32_t instance)
 Terminates an interrupt driven asynchronous transfer early. More...
 
status_t LPSPI_DRV_SetPcs (uint32_t instance, lpspi_which_pcs_t whichPcs, lpspi_signal_polarity_t polarity)
 Select the chip to communicate with. More...
 
void LPSPI_DRV_MasterIRQHandler (uint32_t instance)
 Interrupt handler for LPSPI master mode. This handler uses the buffers stored in the lpspi_state_t structs to transfer data. This is not a public API as it is called whenever an interrupt occurs. More...
 

Macro Definition Documentation

#define MICROSECONDS   1000000

Definition at line 98 of file lpspi_master_driver.c.

Function Documentation

static void LPSPI_DRV_MasterClearCountinuous ( void *  parameter,
edma_chn_status_t  status 
)
static

Clear the continuous mode. The main purpose of this function is to clear continuous mode.

The main purpose of this function is to clear continuous mode.

Definition at line 839 of file lpspi_master_driver.c.

static void LPSPI_DRV_MasterCompleteDMATransfer ( void *  parameter,
edma_chn_status_t  status 
)
static

Finish up a transfer DMA. The main purpose of this function is to create a function compatible with DMA callback type.

Definition at line 826 of file lpspi_master_driver.c.

static void LPSPI_DRV_MasterCompleteTransfer ( uint32_t  instance)
static

Finish up a transfer. Cleans up after a transfer is complete. Interrupts are disabled, and the LPSPI module is disabled. This is not a public API as it is called from other driver functions.

Definition at line 787 of file lpspi_master_driver.c.

static status_t LPSPI_DRV_MasterStartTransfer ( uint32_t  instance,
const uint8_t *  sendBuffer,
uint8_t *  receiveBuffer,
uint16_t  transferByteCount 
)
static

Definition at line 630 of file lpspi_master_driver.c.