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:
@@ -291,11 +291,9 @@ static uint8_t SD_ReadData(void);
|
||||
* - MSD_OK: Sequence succeed
|
||||
*/
|
||||
uint8_t BSP_SD_Init(void) {
|
||||
// TODO: SPI manager
|
||||
api_hal_spi_lock(&SPI_SD_HANDLE);
|
||||
|
||||
/* Init to maximum slow speed */
|
||||
SD_SPI_Reconfigure_Slow();
|
||||
// TODO: SPI manager
|
||||
api_hal_spi_lock_device(&sd_slow_spi);
|
||||
|
||||
/* Configure IO functionalities for SD pin */
|
||||
SD_IO_Init();
|
||||
@@ -304,11 +302,8 @@ uint8_t BSP_SD_Init(void) {
|
||||
SdStatus = SD_PRESENT;
|
||||
uint8_t res = SD_GoIdleState();
|
||||
|
||||
/* Init to maximum fastest speed */
|
||||
SD_SPI_Reconfigure_Fast();
|
||||
|
||||
// TODO: SPI manager
|
||||
api_hal_spi_unlock(&SPI_SD_HANDLE);
|
||||
api_hal_spi_unlock_device(&sd_slow_spi);
|
||||
|
||||
/* SD initialized and set to SPI mode properly */
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user