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

@@ -26,7 +26,7 @@ bool hal_gpio_read_sd_detect(void) {
const GpioPin* sd_cs_record = &sd_cs_gpio;
// TODO: SPI manager
api_hal_spi_lock(&SPI_SD_HANDLE);
api_hal_spi_lock(sd_fast_spi.spi);
// configure pin as input
gpio_init_ex(sd_cs_record, GpioModeInput, GpioPullUp, GpioSpeedVeryHigh);
@@ -41,7 +41,7 @@ bool hal_gpio_read_sd_detect(void) {
delay(1);
// TODO: SPI manager
api_hal_spi_unlock(&SPI_SD_HANDLE);
api_hal_spi_unlock(sd_fast_spi.spi);
return result;
}