12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /* USER CODE BEGIN Header */
- /**
- ******************************************************************************
- * @file usart.h
- * @brief This file contains all the function prototypes for
- * the usart.c file
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2025 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 __USART_H__
- #define __USART_H__
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* Includes ------------------------------------------------------------------*/
- #include "main.h"
- /* USER CODE BEGIN Includes */
- /* USER CODE END Includes */
- extern UART_HandleTypeDef huart1;
- extern UART_HandleTypeDef huart3;
- /* USER CODE BEGIN Private defines */
- #define BaudRate_4800 (0x01)
- #define BaudRate_9600 (0x02)
- #define BaudRate_19200 (0x03)
- #define BaudRate_38400 (0x04)
- #define BaudRate_57600 (0x05)
- #define BaudRate_115200 (0x06)
- #define BaudRate_230400 (0x07)
- #define UART_BaudRate 9600
- #define UART_TRANSMIT_DATA_POOL_COUNT (128)
- #define UART_RECV_DATA_POOL_COUNT (320)
- typedef struct
- {
- uint16_t recv_len;
- uint16_t send_len;
- uint8_t* recv_buffer;
- uint8_t* send_buffer;
- uint8_t dmasend_count; //ms count
- uint8_t res;
- }UART_INFO;
- extern UART_INFO rs485_info;
- void rs485_TransmitData(uint8_t *pdata, uint16_t length);
- void rs485_ReceiveData(void);
- /* USER CODE END Private defines */
- void MX_USART1_UART_Init(void);
- void MX_USART3_UART_Init(void);
- /* USER CODE BEGIN Prototypes */
- /* USER CODE END Prototypes */
- #ifdef __cplusplus
- }
- #endif
- #endif /* __USART_H__ */
|