fsfw-hal/stm32h7/spi/spiCore.h
2021-06-03 14:38:34 +02:00

37 lines
750 B
C

#ifndef FSFW_HAL_STM32H7_SPI_SPICORE_H_
#define FSFW_HAL_STM32H7_SPI_SPICORE_H_
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_dma.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Assign DMA handles. Required to use DMA for SPI transfers.
* @param txHandle
* @param rxHandle
*/
void setDmaHandles(DMA_HandleTypeDef* txHandle, DMA_HandleTypeDef* rxHandle);
void getDmaHandles(DMA_HandleTypeDef** txHandle, DMA_HandleTypeDef** rxHandle);
/**
* Assign SPI handle. Needs to be done before using the SPI
* @param spiHandle
*/
void assignSpiHandle(SPI_HandleTypeDef *spiHandle);
/**
* Get the assigned SPI handle.
* @return
*/
SPI_HandleTypeDef* getSpiHandle();
#ifdef __cplusplus
}
#endif
#endif /* FSFW_HAL_STM32H7_SPI_SPICORE_H_ */