signal_generator/Core/Inc/main.h

181 lines
5.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2024 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C"
{
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "tcpclient.h"
#include "tcpserverc.h"
#include "leds.h"
#include <string.h>
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
extern uint8_t tcp_echo_flags_hart1; // 标志ä½<C3A4>,连接æˆ<C3A6>功ç½?1
extern uint8_t tcp_echo_flags_hart2; // 标志ä½<C3A4>,连接æˆ<C3A6>功ç½?1
extern uint8_t tcp_echo_flags_ble1;
extern uint8_t tcp_echo_flags_ble2;
#define ARRAY_LEN(arr) (sizeof(arr)) / (sizeof(arr[0]))
typedef struct
{
uint16_t rx_num; // 接收到数æ<C2B0>®ä¸ªæ•?
uint8_t rx_data[512]; // 接收到数æ<C2B0>®åŒº
uint8_t rx_data_temp[512]; // 接收到数æ<C2B0>®ç¼“冲区
uint8_t tx_data[512]; // å<>é?<3F>æ•°æ<C2B0>®åŒº
} uart_t;
extern uart_t lcd_uart4;
extern uart_t ble2_uart3;
extern uart_t ble1_uart6;
extern uart_t hart1_uart5;
extern uart_t hart2_uart2;
#define DEST_IP_ADDR0 192
#define DEST_IP_ADDR1 168
#define DEST_IP_ADDR2 1
#define DEST_IP_ADDR3 111
#define DEST_PORT 5001
#define UDP_SEREVER_PORT 5002
#define UDP_CLIENT_PORT 5002
#define LOCAL_PORT 5001
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define ETH_RESET_Pin GPIO_PIN_0
#define ETH_RESET_GPIO_Port GPIOC
#define LED3_R_Pin GPIO_PIN_1
#define LED3_R_GPIO_Port GPIOB
#define LED3_G_Pin GPIO_PIN_2
#define LED3_G_GPIO_Port GPIOB
#define LED3_Y_Pin GPIO_PIN_7
#define LED3_Y_GPIO_Port GPIOE
#define LED2_R_Pin GPIO_PIN_12
#define LED2_R_GPIO_Port GPIOE
#define LED2_G_Pin GPIO_PIN_13
#define LED2_G_GPIO_Port GPIOE
#define LED2_Y_Pin GPIO_PIN_14
#define LED2_Y_GPIO_Port GPIOE
#define BLE2_TX_Pin GPIO_PIN_8
#define BLE2_TX_GPIO_Port GPIOD
#define BLE2_RX_Pin GPIO_PIN_9
#define BLE2_RX_GPIO_Port GPIOD
#define DO_CH4_Pin GPIO_PIN_11
#define DO_CH4_GPIO_Port GPIOD
#define DO_CH3_Pin GPIO_PIN_12
#define DO_CH3_GPIO_Port GPIOD
#define DO_CH1_Pin GPIO_PIN_13
#define DO_CH1_GPIO_Port GPIOD
#define DO_CH2_Pin GPIO_PIN_14
#define DO_CH2_GPIO_Port GPIOD
#define DO_EN_Pin GPIO_PIN_15
#define DO_EN_GPIO_Port GPIOD
#define BLE1_TX_Pin GPIO_PIN_6
#define BLE1_TX_GPIO_Port GPIOC
#define BLE1_RX_Pin GPIO_PIN_7
#define BLE1_RX_GPIO_Port GPIOC
#define DI_CH1_Pin GPIO_PIN_8
#define DI_CH1_GPIO_Port GPIOC
#define DI_CH2_Pin GPIO_PIN_9
#define DI_CH2_GPIO_Port GPIOC
#define HART1_RST_Pin GPIO_PIN_8
#define HART1_RST_GPIO_Port GPIOA
#define DI_CH3_Pin GPIO_PIN_11
#define DI_CH3_GPIO_Port GPIOA
#define DI_CH4_Pin GPIO_PIN_12
#define DI_CH4_GPIO_Port GPIOA
#define HART_CLK_Pin GPIO_PIN_15
#define HART_CLK_GPIO_Port GPIOA
#define LCD_TX_Pin GPIO_PIN_10
#define LCD_TX_GPIO_Port GPIOC
#define LCD_RX_Pin GPIO_PIN_11
#define LCD_RX_GPIO_Port GPIOC
#define HART1_TX_Pin GPIO_PIN_12
#define HART1_TX_GPIO_Port GPIOC
#define HART1_RTS_Pin GPIO_PIN_0
#define HART1_RTS_GPIO_Port GPIOD
#define HART1_OCD_Pin GPIO_PIN_1
#define HART1_OCD_GPIO_Port GPIOD
#define HART1_OCD_EXTI_IRQn EXTI1_IRQn
#define HART1_RX_Pin GPIO_PIN_2
#define HART1_RX_GPIO_Port GPIOD
#define HART2_OCD_Pin GPIO_PIN_3
#define HART2_OCD_GPIO_Port GPIOD
#define HART2_OCD_EXTI_IRQn EXTI3_IRQn
#define HART2_RTS_Pin GPIO_PIN_4
#define HART2_RTS_GPIO_Port GPIOD
#define HART2_TX_Pin GPIO_PIN_5
#define HART2_TX_GPIO_Port GPIOD
#define HART2_RX_Pin GPIO_PIN_6
#define HART2_RX_GPIO_Port GPIOD
#define HART2_RST_Pin GPIO_PIN_7
#define HART2_RST_GPIO_Port GPIOD
#define DAC1_CS_Pin GPIO_PIN_6
#define DAC1_CS_GPIO_Port GPIOB
#define DAC2_CS_Pin GPIO_PIN_7
#define DAC2_CS_GPIO_Port GPIOB
#define ADC_CS_Pin GPIO_PIN_0
#define ADC_CS_GPIO_Port GPIOE
#define AD7124_SYNC_Pin GPIO_PIN_1
#define AD7124_SYNC_GPIO_Port GPIOE
/* USER CODE BEGIN Private defines */
#define TRUE 0
#define FAIL -1
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */