api-hal-spi.h 534 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "main.h"
  3. #include "api-hal-spi-config.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /**
  8. * Init SPI API
  9. */
  10. void api_hal_spi_init();
  11. /**
  12. * Lock SPI bus
  13. */
  14. void api_hal_spi_lock(SPI_HandleTypeDef* spi);
  15. /**
  16. * Unlock SPI bus
  17. */
  18. void api_hal_spi_unlock(SPI_HandleTypeDef* spi);
  19. /**
  20. * Lock SPI device bus and apply config if needed
  21. */
  22. void api_hal_spi_lock_device(const SPIDevice* device);
  23. /**
  24. * Unlock SPI device bus
  25. */
  26. void api_hal_spi_unlock_device(const SPIDevice* device);
  27. #ifdef __cplusplus
  28. }
  29. #endif