WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
spi.c File Reference
#include <msp430.h>
#include "../globals.h"
#include "spi.h"

Functions

BOOL SPI_initialize ()
 
BOOL SPI_acquirePort ()
 
BOOL SPI_releasePort ()
 
BOOL SPI_transaction (uint8_t *rxBuf, uint8_t *txBuf, uint16_t size)
 

Variables

uint8_t gpRxBuf [SPI_GP_RXBUF_SIZE]
 
struct {
   BOOL   bPortInUse
 
   BOOL   bNewDataReceived
 
   unsigned int   uiCurRx
 
   unsigned int   uiCurTx
 
   unsigned int   uiBytesToSend
 
   uint8_t *   pcRxBuffer
 
   uint8_t *   pcTxBuffer
 
spiSM
 

Function Documentation

◆ SPI_acquirePort()

BOOL SPI_acquirePort ( )
Returns
Success - you were able to get the port. Fail - you don't have the port, so don't use it.

◆ SPI_initialize()

BOOL SPI_initialize ( )
Returns
success or failure
Todo:
Implement this function

◆ SPI_releasePort()

BOOL SPI_releasePort ( )
Returns
success or fail
Todo:
Make this more robust (don't allow release of port if we don't have it)

◆ SPI_transaction()

BOOL SPI_transaction ( uint8_t *  rxBuf,
uint8_t *  txBuf,
uint16_t  size 
)

Engage in a synchronous serial transaction of the specified length. This function blocks until transaction is complete.

Parameters
txBuf
size
Returns
success or fail

Variable Documentation

◆ bNewDataReceived

BOOL bNewDataReceived

◆ bPortInUse

BOOL bPortInUse

◆ gpRxBuf

uint8_t gpRxBuf[SPI_GP_RXBUF_SIZE]

sensor_spi.c

Author
Aaron Parks
Date
Aug 2013

◆ pcRxBuffer

uint8_t* pcRxBuffer

◆ pcTxBuffer

uint8_t* pcTxBuffer

◆ spiSM

struct { ... } spiSM

Description of state of the SPI module.

◆ uiBytesToSend

unsigned int uiBytesToSend

◆ uiCurRx

unsigned int uiCurRx

◆ uiCurTx

unsigned int uiCurTx