HAL_STM32_config.h 803 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * HAL_config.h
  3. *
  4. * Created on: Oct 27, 2025
  5. * Author: juraj
  6. */
  7. #ifndef INC_HAL_STM32_CONFIG_H_
  8. #define INC_HAL_STM32_CONFIG_H_
  9. #include "stm32l0xx_hal.h"
  10. #include "HAL_impl.h"
  11. #include "main.h"
  12. #define USE_SPI 1
  13. #if (!USE_SPI && defined(HAL_I2C_MODULE_ENABLED))
  14. #define IS_SPI false
  15. #endif
  16. #if (USE_SPI && defined(HAL_SPI_MODULE_ENABLED))
  17. #define IS_SPI true
  18. #endif // BUS_SELECT
  19. #ifdef HAL_SPI_MODULE_ENABLED
  20. extern SPI_HandleTypeDef hspi1;
  21. #define CHIP_SELECT_PIN SPI_CS_Pin
  22. #define CHIP_SELECT_PORT SPI_CS_GPIO_Port
  23. #define SPI_INSTANCE hspi1
  24. #endif // HAL_SPI_MODULE_ENABLED
  25. #ifdef HAL_I2C_MODULE_ENABLED
  26. extern I2C_HandleTypeDef hi2c1;
  27. #define I2C_INSTANCE hi2c1
  28. #define I2C_ADDRESS 0x69
  29. #endif // HAL_I2C_MODULE_ENABLED
  30. #endif /* INC_HAL_STM32_CONFIG_H_ */