ArmSys Support
ArmsysApi  0.12.18

#include <BSpi.h>

Public Types

enum  Mode { Mode0 = 0, Mode1 = 1, Mode2 = 2, Mode3 = 3 }
 

Public Member Functions

 BSpi (Bool useDma=0)
 
BError init (BUInt8 bus, BUInt speed=1000000)
 Initialise the SPI bus. More...
 
BError init (BUInt8 bus, Pin pinClk, Pin pinMosi, Pin pinMiso, BUInt speed=1000000)
 Initialise the SPI bus. More...
 
BError initDev (BUInt8 dev, Pin pinCs, Mode mode, Bool csActive=0)
 Initialise an SPI device with appropriate CS. dev 0 - 7, mode 0 - 3. More...
 
BError transact (BUInt8 dev, const void *txBuf, int txLen, int pad, void *rxBuf, int rxLen)
 
BError transactFull (BUInt8 dev, const void *txBuf, int txLen, int rxIgnore, void *rxBuf, int rxLen)
 
BError transactTxRx (BUInt8 dev, const void *txBuf, void *rxBuf, int len)
 
void setMode (Mode mode)
 Sets the SPI mode to 0,1,2,3. More...
 
BUInt8 sendRecv (BUInt8 txData, BUInt8 &rxData)
 

Protected Attributes

int ouseDma
 
int obus
 
Pin opinCs [4]
 
Mode omodes [4]
 
Bool ocsActives [4]
 
SPI_TypeDef * ospi
 
BDma odmaTx
 
BDma odmaRx
 

Member Enumeration Documentation

◆ Mode

enum BSpi::Mode
Enumerator
Mode0 
Mode1 
Mode2 
Mode3 

Constructor & Destructor Documentation

◆ BSpi()

BSpi::BSpi ( Bool  useDma = 0)

Member Function Documentation

◆ init() [1/2]

BError BSpi::init ( BUInt8  bus,
BUInt  speed = 1000000 
)

Initialise the SPI bus.

◆ init() [2/2]

BError BSpi::init ( BUInt8  bus,
Pin  pinClk,
Pin  pinMosi,
Pin  pinMiso,
BUInt  speed = 1000000 
)

Initialise the SPI bus.

◆ initDev()

BError BSpi::initDev ( BUInt8  dev,
Pin  pinCs,
Mode  mode,
Bool  csActive = 0 
)

Initialise an SPI device with appropriate CS. dev 0 - 7, mode 0 - 3.

◆ sendRecv()

BUInt8 BSpi::sendRecv ( BUInt8  txData,
BUInt8 rxData 
)

◆ setMode()

void BSpi::setMode ( Mode  mode)

Sets the SPI mode to 0,1,2,3.

◆ transact()

BError BSpi::transact ( BUInt8  dev,
const void *  txBuf,
int  txLen,
int  pad,
void *  rxBuf,
int  rxLen 
)

◆ transactFull()

BError BSpi::transactFull ( BUInt8  dev,
const void *  txBuf,
int  txLen,
int  rxIgnore,
void *  rxBuf,
int  rxLen 
)

◆ transactTxRx()

BError BSpi::transactTxRx ( BUInt8  dev,
const void *  txBuf,
void *  rxBuf,
int  len 
)

Member Data Documentation

◆ obus

int BSpi::obus
protected

◆ ocsActives

Bool BSpi::ocsActives[4]
protected

◆ odmaRx

BDma BSpi::odmaRx
protected

◆ odmaTx

BDma BSpi::odmaTx
protected

◆ omodes

Mode BSpi::omodes[4]
protected

◆ opinCs

Pin BSpi::opinCs[4]
protected

◆ ospi

SPI_TypeDef* BSpi::ospi
protected

◆ ouseDma

int BSpi::ouseDma
protected

The documentation for this class was generated from the following files: