2020-12-19 07:52:17 +00:00
|
|
|
#pragma once
|
|
|
|
#include "main.h"
|
2021-01-12 17:33:36 +00:00
|
|
|
#include "api-hal-spi-config.h"
|
2020-12-19 07:52:17 +00:00
|
|
|
|
2021-01-12 17:33:36 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init SPI API
|
|
|
|
*/
|
2020-12-19 07:52:17 +00:00
|
|
|
void api_hal_spi_init();
|
2021-01-12 17:33:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Lock SPI bus
|
|
|
|
*/
|
2020-12-19 07:52:17 +00:00
|
|
|
void api_hal_spi_lock(SPI_HandleTypeDef* spi);
|
2021-01-12 17:33:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock SPI bus
|
|
|
|
*/
|
|
|
|
void api_hal_spi_unlock(SPI_HandleTypeDef* spi);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lock SPI device bus and apply config if needed
|
|
|
|
*/
|
|
|
|
void api_hal_spi_lock_device(const SPIDevice* device);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock SPI device bus
|
|
|
|
*/
|
|
|
|
void api_hal_spi_unlock_device(const SPIDevice* device);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|