main.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2023 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __MAIN_H
  22. #define __MAIN_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32l0xx_hal.h"
  28. /* Private includes ----------------------------------------------------------*/
  29. /* USER CODE BEGIN Includes */
  30. /* USER CODE END Includes */
  31. /* Exported types ------------------------------------------------------------*/
  32. /* USER CODE BEGIN ET */
  33. typedef enum {
  34. STATE_WAIT_LEN,
  35. STATE_PAYLOAD,
  36. } ProtocolState;
  37. /* USER CODE END ET */
  38. /* Exported constants --------------------------------------------------------*/
  39. /* USER CODE BEGIN EC */
  40. /* USER CODE END EC */
  41. /* Exported macro ------------------------------------------------------------*/
  42. /* USER CODE BEGIN EM */
  43. /* USER CODE END EM */
  44. /* Exported functions prototypes ---------------------------------------------*/
  45. void Error_Handler(void);
  46. /* USER CODE BEGIN EFP */
  47. /* USER CODE END EFP */
  48. /* Private defines -----------------------------------------------------------*/
  49. #define LD3_Pin GPIO_PIN_1
  50. #define LD3_GPIO_Port GPIOB
  51. #define SPI_SS_Pin GPIO_PIN_8
  52. #define SPI_SS_GPIO_Port GPIOA
  53. #define VCP_TX_Pin GPIO_PIN_9
  54. #define VCP_TX_GPIO_Port GPIOA
  55. #define VCP_RX_Pin GPIO_PIN_10
  56. #define VCP_RX_GPIO_Port GPIOA
  57. #define TMS_Pin GPIO_PIN_13
  58. #define TMS_GPIO_Port GPIOA
  59. #define TCK_Pin GPIO_PIN_14
  60. #define TCK_GPIO_Port GPIOA
  61. #define SPI_INT_Pin GPIO_PIN_15
  62. #define SPI_INT_GPIO_Port GPIOA
  63. #define SPI_INT_EXTI_IRQn EXTI4_15_IRQn
  64. #define ONE_WIRE_Pin GPIO_PIN_4
  65. #define ONE_WIRE_GPIO_Port GPIOB
  66. /* USER CODE BEGIN Private defines */
  67. /* USER CODE END Private defines */
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* __MAIN_H */