HAL_STM32_config.h 785 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #define USE_SPI 1
  12. #if (!USE_SPI && defined(HAL_I2C_MODULE_ENABLED))
  13. #define IS_SPI false
  14. #endif
  15. #if (USE_SPI && defined(HAL_SPI_MODULE_ENABLED))
  16. #define IS_SPI true
  17. #endif // BUS_SELECT
  18. #ifdef HAL_SPI_MODULE_ENABLED
  19. extern SPI_HandleTypeDef hspi1;
  20. #define CHIP_SELECT_PIN SPI_CS_Pin
  21. #define CHIP_SELECT_PORT SPI_CS_GPIO_Port
  22. #define SPI_INSTANCE hspi1
  23. #endif // HAL_SPI_MODULE_ENABLED
  24. #ifdef HAL_I2C_MODULE_ENABLED
  25. extern I2C_HandleTypeDef hi2c1;
  26. #define I2C_INSTANCE hi2c1
  27. #define I2C_ADDRESS 0x69
  28. #endif // HAL_I2C_MODULE_ENABLED
  29. #endif /* INC_HAL_STM32_CONFIG_H_ */