HAL_STM32_config.h 737 B

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