Autodrone
Multi-Domain Vehicle
drv_spi1.c File Reference
#include "board.h"

Functions

void spi1Init (void)
 Initializes SPI1. More...
 
void spi1ReadBytes (uint8_t reg, uint8_t *pData, uint8_t size)
 Reads multiple bytes of data in. More...
 
void spi1WriteBytes (uint8_t *pData, uint8_t size)
 Writes multiple bytes of data in. More...
 
void spi1ReadOneByte (uint8_t reg, uint8_t *pData)
 Reads one byte of data in. More...
 
void spi1WriteOneByte (uint8_t reg, uint8_t data)
 Writes one byte of data. More...
 
void DMA2_Stream0_IRQHandler (void)
 This function handles DMA2 stream1 global interrupt. More...
 
void DMA2_Stream3_IRQHandler (void)
 This function handles DMA2 stream3 global interrupt. More...
 

Function Documentation

◆ DMA2_Stream0_IRQHandler()

void DMA2_Stream0_IRQHandler ( void  )

This function handles DMA2 stream1 global interrupt.

◆ DMA2_Stream3_IRQHandler()

void DMA2_Stream3_IRQHandler ( void  )

This function handles DMA2 stream3 global interrupt.

◆ spi1Init()

void spi1Init ( void  )

Initializes SPI1.

Returns
Void.

◆ spi1ReadBytes()

void spi1ReadBytes ( uint8_t  reg,
uint8_t *  pData,
uint8_t  size 
)

Reads multiple bytes of data in.

Parameters
regThe hex value of the first register to read from.
*pDataA pointer to location where you want to read data to.
sizeThe amount of bytes to be read.
Returns
Void.

◆ spi1ReadOneByte()

void spi1ReadOneByte ( uint8_t  reg,
uint8_t *  pData 
)

Reads one byte of data in.

Parameters
regThe hex value of the register to read from.
*pDataA pointer to location where you want to read data to.
Returns
Void.

◆ spi1WriteBytes()

void spi1WriteBytes ( uint8_t *  pData,
uint8_t  size 
)

Writes multiple bytes of data in.

Parameters
regThe hex value of the register to write to.
*pDataA pointer to the data you want to write.
sizeThe amount of bytes to write.
Returns
Void.

◆ spi1WriteOneByte()

void spi1WriteOneByte ( uint8_t  reg,
uint8_t  data 
)

Writes one byte of data.

Parameters
regThe hex value of the register to write to.
dataThe data to write.
Returns
Void.