Skip to content

Commit

Permalink
Add API bsp_spi_get_handle() required to mix bsp_spi API with HAL_SPI…
Browse files Browse the repository at this point in the history
…_xxx API for HydraNFC v2...
  • Loading branch information
bvernoux committed Jul 1, 2020
1 parent bbc6adc commit 58587c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/drv/stm32cube/bsp_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,10 @@ bsp_status_t bsp_spi_write_read_u8(bsp_dev_spi_t dev_num, uint8_t* tx_data, uint
return status;
}

SPI_HandleTypeDef* bsp_spi_get_handle(bsp_dev_spi_t dev_num)
{
SPI_HandleTypeDef* hspi;
hspi = &spi_handle[dev_num];

return hspi;
}
2 changes: 2 additions & 0 deletions src/drv/stm32cube/bsp_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ bsp_status_t bsp_spi_write_u8(bsp_dev_spi_t dev_num, uint8_t* tx_data, uint8_t n
bsp_status_t bsp_spi_read_u8(bsp_dev_spi_t dev_num, uint8_t* rx_data, uint8_t nb_data);
bsp_status_t bsp_spi_write_read_u8(bsp_dev_spi_t dev_num, uint8_t* tx_data, uint8_t* rx_data, uint8_t nb_data);

SPI_HandleTypeDef* bsp_spi_get_handle(bsp_dev_spi_t dev_num);

#endif /* _BSP_SPI_H_ */

0 comments on commit 58587c9

Please sign in to comment.