Добавлены команды чтения и записи портов по Ethernet.

This commit is contained in:
MaD_CaT
2024-09-10 11:21:32 +03:00
parent ee17ebfb76
commit e607f3034d
5 changed files with 53026 additions and 38 deletions

View File

@@ -25,7 +25,6 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
@@ -33,16 +32,13 @@ extern "C" {
/* USER CODE BEGIN Includes */
#include <string.h>
#include "lwip.h"
#include "lwip/udp.h"
#include "lwip/debug.h"
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
typedef struct rcv_msg
{
uint32_t rcv_addr;
uint16_t port;
uint16_t cmd_num;
uint16_t cmd_code;
@@ -52,6 +48,15 @@ typedef struct rcv_msg
uint16_t con_timeout;
}_rcv_msg;
typedef struct tsm_msg
{
unsigned char tx_buf[1400];
uint16_t status_len;
uint16_t length;
uint16_t cmd_len;
}_tsm_msg;
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/

View File

@@ -56,6 +56,15 @@ uint32_t get_ip(void);
uint16_t get_port(void);
uint16_t set_status(unsigned char *buf);
enum
{
IN_PROGRESS = 0,
NO_ERROR,
ERR_SIZE,
ERR_UNKNOW_COMMAND = 255
};
#endif /* INC_PRIBORS_H_ */