NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bus_spi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPI_0_28125MHZ_CLOCK_DIVIDER   256
 
#define SPI_0_5625MHZ_CLOCK_DIVIDER   128
 
#define SPI_18MHZ_CLOCK_DIVIDER   2
 
#define SPI_9MHZ_CLOCK_DIVIDER   4
 

Functions

bool spiInit (SPI_TypeDef *instance)
 
void spiSetDivisor (SPI_TypeDef *instance, uint16_t divisor)
 
uint8_t spiTransferByte (SPI_TypeDef *instance, uint8_t in)
 
bool spiIsBusBusy (SPI_TypeDef *instance)
 
void spiTransfer (SPI_TypeDef *instance, uint8_t *out, const uint8_t *in, int len)
 

Macro Definition Documentation

#define SPI_0_28125MHZ_CLOCK_DIVIDER   256
#define SPI_0_5625MHZ_CLOCK_DIVIDER   128
#define SPI_18MHZ_CLOCK_DIVIDER   2
#define SPI_9MHZ_CLOCK_DIVIDER   4

Function Documentation

bool spiInit ( SPI_TypeDef *  instance)
bool spiIsBusBusy ( SPI_TypeDef *  instance)

Return true if the bus is currently in the middle of a transmission.

void spiSetDivisor ( SPI_TypeDef *  instance,
uint16_t  divisor 
)
void spiTransfer ( SPI_TypeDef *  instance,
uint8_t *  out,
const uint8_t *  in,
int  len 
)
uint8_t spiTransferByte ( SPI_TypeDef *  instance,
uint8_t  in 
)