SPI Device API (#304)

* spi device config
* fix api_interrupt_call warning
* added configs for spi2 bus devices
* simplified spi bus api
* use new spi device api
This commit is contained in:
DrZlo13
2021-01-13 03:33:36 +10:00
committed by GitHub
parent 6a5e3e83b4
commit 9ed8bebba1
10 changed files with 172 additions and 24 deletions

View File

@@ -1,7 +1,36 @@
#pragma once
#include "main.h"
#include <cmsis_os.h>
#include "api-hal-spi-config.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Init SPI API
*/
void api_hal_spi_init();
/**
* Lock SPI bus
*/
void api_hal_spi_lock(SPI_HandleTypeDef* spi);
void api_hal_spi_unlock(SPI_HandleTypeDef* spi);
/**
* 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