RUI3 (RAK Unified Interface 3) - RAK4631

Functions

void begin ()
 
void end ()
 
uint16_t transfer16 (uint16_t data)
 
void transfer (void *buf, size_t count)
 
void beginTransaction (SPISettings settings)
 
void endTransaction ()
 
void setBitOrder (BitOrder order)
 
void setDataMode (uint8_t mode)
 
void setClockDivider (uint32_t uc_div)
 

Detailed Description

Function Documentation

◆ begin()

void begin ( )
Description
Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high
Syntax
SPI.begin()
Returns
void

◆ end()

void end ( )
Description
Disables the SPI bus
Syntax
SPI.end()
Returns
void

◆ transfer16()

uint16_t transfer16 ( uint16_t  data)
Description
SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal16.
Syntax
receivedVal16 = SPI.transfer16(val16)
Parameters
val16the two bytes variable to send out over the bus
Returns
the received data

◆ transfer()

void transfer ( void *  buf,
size_t  count 
)
Description
SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal. In case of buffer transfers the received data is stored in the buffer in-place.
Syntax
receivedVal = SPI.transfer(val)
SPI.transfer(buffer, size)
Parameters
valthe byte to send out over the bus
bufferthe array of data to be transferred
Returns
the received data

◆ beginTransaction()

void beginTransaction ( SPISettings  settings)
Description
Initializes the SPI bus using the defined SPISettings
Syntax
SPI.beginTransactions(mySetting)
Parameters
mySettingthe chosen settings according to SPISettings
Returns
void

◆ endTransaction()

void endTransaction ( )
Description
Stop using the SPI bus
Syntax
SPI.endTransaction()
Returns
void

◆ setBitOrder()

void setBitOrder ( BitOrder  order)
Description
Sets the order of the bits shifted out of and into the SPI bus, either LSBFIRST (least-significant bit first) or MSBFIRST (most-significant bit first)
Syntax
SPI.setBitOrder(order)
Parameters
ordereither LSBFIRST or MSBFIRST
Returns
void

◆ setDataMode()

void setDataMode ( uint8_t  mode)
Description
Sets the SPI data mode: that is, clock polarity and phase
Syntax
SPI.setDataMode(mode)
Parameters
modeSPI_MODE0
SPI_MODE1
SPI_MODE2
SPI_MODE3
Returns
void

◆ setClockDivider()

void setClockDivider ( uint32_t  uc_div)
Description
Sets the SPI clock divider relative to the system clock
Syntax
SPI.setClockDivider(divider)
Parameters
dividerSPI_CLOCK_DIV2
SPI_CLOCK_DIV4
SPI_CLOCK_DIV8
SPI_CLOCK_DIV16
SPI_CLOCK_DIV32
SPI_CLOCK_DIV64
SPI_CLOCK_DIV128 SPI_CLOCK_DIV256
Returns
void