Macros | Functions
drv_spi.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stm32f10x.h>
#include "drv_gpio.h"
#include "drv_spi.h"
Include dependency graph for drv_spi.c:

Go to the source code of this file.

Macros

#define BR_CLEAR_MASK   0xFFC7
 
#define SPI1_GPIO   GPIOA
 
#define SPI1_GPIO_PERIPHERAL   RCC_AHBPeriph_GPIOA
 
#define SPI1_MISO_PIN   GPIO_Pin_6
 
#define SPI1_MISO_PIN_SOURCE   GPIO_PinSource6
 
#define SPI1_MOSI_PIN   GPIO_Pin_7
 
#define SPI1_MOSI_PIN_SOURCE   GPIO_PinSource7
 
#define SPI1_NSS_PIN   GPIO_Pin_4
 
#define SPI1_NSS_PIN_SOURCE   GPIO_PinSource4
 
#define SPI1_SCK_PIN   GPIO_Pin_5
 
#define SPI1_SCK_PIN_SOURCE   GPIO_PinSource5
 
#define SPI2_GPIO   GPIOB
 
#define SPI2_GPIO_PERIPHERAL   RCC_AHBPeriph_GPIOB
 
#define SPI2_MISO_PIN   GPIO_Pin_14
 
#define SPI2_MISO_PIN_SOURCE   GPIO_PinSource14
 
#define SPI2_MOSI_PIN   GPIO_Pin_15
 
#define SPI2_MOSI_PIN_SOURCE   GPIO_PinSource15
 
#define SPI2_NSS_PIN   GPIO_Pin_12
 
#define SPI2_NSS_PIN_SOURCE   GPIO_PinSource12
 
#define SPI2_SCK_PIN   GPIO_Pin_13
 
#define SPI2_SCK_PIN_SOURCE   GPIO_PinSource13
 
#define UNUSED(x)   (void)(x)
 
#define USE_SPI_DEVICE_1
 
#define USE_SPI_DEVICE_2
 

Functions

void initSpi1 (void)
 
void initSpi2 (void)
 
bool spiInit (SPI_TypeDef *instance)
 
bool spiIsBusBusy (SPI_TypeDef *instance)
 
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 data)
 

Macro Definition Documentation

#define BR_CLEAR_MASK   0xFFC7
#define SPI1_GPIO   GPIOA

Definition at line 36 of file drv_spi.c.

#define SPI1_GPIO_PERIPHERAL   RCC_AHBPeriph_GPIOA

Definition at line 37 of file drv_spi.c.

#define SPI1_MISO_PIN   GPIO_Pin_6

Definition at line 42 of file drv_spi.c.

#define SPI1_MISO_PIN_SOURCE   GPIO_PinSource6

Definition at line 43 of file drv_spi.c.

#define SPI1_MOSI_PIN   GPIO_Pin_7

Definition at line 44 of file drv_spi.c.

#define SPI1_MOSI_PIN_SOURCE   GPIO_PinSource7

Definition at line 45 of file drv_spi.c.

#define SPI1_NSS_PIN   GPIO_Pin_4

Definition at line 38 of file drv_spi.c.

#define SPI1_NSS_PIN_SOURCE   GPIO_PinSource4

Definition at line 39 of file drv_spi.c.

#define SPI1_SCK_PIN   GPIO_Pin_5

Definition at line 40 of file drv_spi.c.

#define SPI1_SCK_PIN_SOURCE   GPIO_PinSource5

Definition at line 41 of file drv_spi.c.

#define SPI2_GPIO   GPIOB

Definition at line 174 of file drv_spi.c.

#define SPI2_GPIO_PERIPHERAL   RCC_AHBPeriph_GPIOB

Definition at line 175 of file drv_spi.c.

#define SPI2_MISO_PIN   GPIO_Pin_14

Definition at line 180 of file drv_spi.c.

#define SPI2_MISO_PIN_SOURCE   GPIO_PinSource14

Definition at line 181 of file drv_spi.c.

#define SPI2_MOSI_PIN   GPIO_Pin_15

Definition at line 182 of file drv_spi.c.

#define SPI2_MOSI_PIN_SOURCE   GPIO_PinSource15

Definition at line 183 of file drv_spi.c.

#define SPI2_NSS_PIN   GPIO_Pin_12

Definition at line 176 of file drv_spi.c.

#define SPI2_NSS_PIN_SOURCE   GPIO_PinSource12

Definition at line 177 of file drv_spi.c.

#define SPI2_SCK_PIN   GPIO_Pin_13

Definition at line 178 of file drv_spi.c.

#define SPI2_SCK_PIN_SOURCE   GPIO_PinSource13

Definition at line 179 of file drv_spi.c.

#define UNUSED (   x)    (void)(x)

Definition at line 28 of file drv_spi.c.

#define USE_SPI_DEVICE_1

Definition at line 30 of file drv_spi.c.

#define USE_SPI_DEVICE_2

Definition at line 31 of file drv_spi.c.

Function Documentation

void initSpi1 ( void  )

Definition at line 48 of file drv_spi.c.

void initSpi2 ( void  )

Definition at line 186 of file drv_spi.c.

bool spiInit ( SPI_TypeDef instance)

Definition at line 372 of file drv_spi.c.

bool spiIsBusBusy ( SPI_TypeDef instance)

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

Definition at line 425 of file drv_spi.c.

void spiSetDivisor ( SPI_TypeDef instance,
uint16_t  divisor 
)

Definition at line 460 of file drv_spi.c.

void spiTransfer ( SPI_TypeDef instance,
uint8_t *  out,
const uint8_t *  in,
int  len 
)

Definition at line 430 of file drv_spi.c.

uint8_t spiTransferByte ( SPI_TypeDef instance,
uint8_t  data 
)

Definition at line 399 of file drv_spi.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:50