F439_CPP_TX-RX_LoRa_Project

Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
20/* USER CODE END Header */
21
22/* Define to prevent recursive inclusion -------------------------------------*/
23#ifndef __MAIN_H
24#define __MAIN_H
25
26#ifdef __cplusplus
27 extern "C" {
28#endif
29
30/* Includes ------------------------------------------------------------------*/
31#include "stm32f4xx_hal.h"
32
33/* Private includes ----------------------------------------------------------*/
34/* USER CODE BEGIN Includes */
35
36/* USER CODE END Includes */
37
38/* Exported types ------------------------------------------------------------*/
39/* USER CODE BEGIN ET */
40
41/* USER CODE END ET */
42
43/* Exported constants --------------------------------------------------------*/
44/* USER CODE BEGIN EC */
45
46/* USER CODE END EC */
47
48/* Exported macro ------------------------------------------------------------*/
49/* USER CODE BEGIN EM */
50
51/* USER CODE END EM */
52
53/* Exported functions prototypes ---------------------------------------------*/
54
55/* USER CODE BEGIN EFP */
56
57/* USER CODE END EFP */
58
59/* Private defines -----------------------------------------------------------*/
60#define SX1262_TX_ENABLE_Pin GPIO_PIN_6
61#define SX1262_TX_ENABLE_GPIO_Port GPIOF
62#define SX1262_RX_ENABLE_Pin GPIO_PIN_7
63#define SX1262_RX_ENABLE_GPIO_Port GPIOF
64#define MCO_Pin GPIO_PIN_0
65#define MCO_GPIO_Port GPIOH
66#define SX1262_CS_Pin GPIO_PIN_9
67#define SX1262_CS_GPIO_Port GPIOC
68#define SPI1_FRAM_CS_Pin GPIO_PIN_15
69#define SPI1_FRAM_CS_GPIO_Port GPIOA
70#define DIO1_LORA_Pin GPIO_PIN_10
71#define DIO1_LORA_GPIO_Port GPIOC
72#define DIO1_LORA_EXTI_IRQn EXTI15_10_IRQn
73#define SX1262_NRESET_Pin GPIO_PIN_11
74#define SX1262_NRESET_GPIO_Port GPIOC
75#define SX1262_BUSY_Pin GPIO_PIN_12
76#define SX1262_BUSY_GPIO_Port GPIOC
77
78/* USER CODE BEGIN Private defines */
79
80#define SX1262_TX_ENABLE_Pin GPIO_PIN_6
81#define SX1262_TX_ENABLE_GPIO_Port GPIOF
82#define SX1262_RX_ENABLE_Pin GPIO_PIN_7
83#define SX1262_RX_ENABLE_GPIO_Port GPIOF
84#define MCO_Pin GPIO_PIN_0
85#define MCO_GPIO_Port GPIOH
86#define USB_PowerSwitchOn_Pin GPIO_PIN_6
87#define USB_PowerSwitchOn_GPIO_Port GPIOG
88#define USB_OverCurrent_Pin GPIO_PIN_7
89#define USB_OverCurrent_GPIO_Port GPIOG
90#define SX1262_CS_Pin GPIO_PIN_9
91#define SX1262_CS_GPIO_Port GPIOC
92#define DIO1_LORA_Pin GPIO_PIN_10
93#define DIO1_LORA_GPIO_Port GPIOC
94#define DIO1_LORA_EXTI_IRQn EXTI15_10_IRQn
95#define SX1262_NRESET_Pin GPIO_PIN_11
96#define SX1262_NRESET_GPIO_Port GPIOC
97#define SX1262_BUSY_Pin GPIO_PIN_12
98#define SX1262_BUSY_GPIO_Port GPIOC
99
100 typedef enum {
101 SX_ROLE_RX = 0,
102 SX_ROLE_TX
103} SX1262_ROLE;
104
105#define FRAM_BASE_ADDR 0x0100U
106#define FRAM_INIT_BYTES 64U
107
108 void _Error_Handler(const char *, int);
109
110#define Error_Handler() _Error_Handler((const char *)__FILE__, __LINE__)
111#define REDIRECT_PRINTF
112
113/* USER CODE END Private defines */
114
115#ifdef __cplusplus
116}
117#endif
118
119#endif /* __MAIN_H */
SX1262_ROLE
SX1262_ROLE
Definition main.h:100
SX_ROLE_TX
@ SX_ROLE_TX
Definition main.h:102
SX_ROLE_RX
@ SX_ROLE_RX
Definition main.h:101
_Error_Handler
void _Error_Handler(const char *, int)
This function is executed in case of error occurrence.
Definition main.c:602