106 lines
3.1 KiB
C
106 lines
3.1 KiB
C
/* 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 "stm32f1xx_hal.h"
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
/* USER CODE BEGIN Includes */
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
/* USER CODE END Includes */
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
/* USER CODE BEGIN ET */
|
|
/* 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 M0_Pin GPIO_PIN_7
|
|
#define M0_GPIO_Port GPIOA
|
|
#define M1_Pin GPIO_PIN_0
|
|
#define M1_GPIO_Port GPIOB
|
|
#define AUX_Pin GPIO_PIN_1
|
|
#define AUX_GPIO_Port GPIOB
|
|
#define RESET_Pin GPIO_PIN_2
|
|
#define RESET_GPIO_Port GPIOB
|
|
#define W5500_CS_Pin GPIO_PIN_12
|
|
#define W5500_CS_GPIO_Port GPIOB
|
|
#define W5500_RESET_Pin GPIO_PIN_8
|
|
#define W5500_RESET_GPIO_Port GPIOA
|
|
#define RL_Control_Pin GPIO_PIN_15
|
|
#define RL_Control_GPIO_Port GPIOA
|
|
#define LED_RX_Pin GPIO_PIN_3
|
|
#define LED_RX_GPIO_Port GPIOB
|
|
#define MCU_DI1_Pin GPIO_PIN_4
|
|
#define MCU_DI1_GPIO_Port GPIOB
|
|
#define MCU_DI2_Pin GPIO_PIN_5
|
|
#define MCU_DI2_GPIO_Port GPIOB
|
|
#define MCU_DI3_Pin GPIO_PIN_6
|
|
#define MCU_DI3_GPIO_Port GPIOB
|
|
#define MCU_DI4_Pin GPIO_PIN_7
|
|
#define MCU_DI4_GPIO_Port GPIOB
|
|
#define LED_TX_Pin GPIO_PIN_9
|
|
#define LED_TX_GPIO_Port GPIOB
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
void gpio_led_tx_on(void);
|
|
void gpio_led_tx_off(void);
|
|
void gpio_led_rx_on(void);
|
|
void gpio_led_rx_off(void);
|
|
|
|
void systick_interrupt_1ms_callback(void);
|
|
void systick_set_user_timeout( uint32_t time_ms );
|
|
uint32_t systick_get_user_timeout(void);
|
|
|
|
void uart1_rx_timeout_1ms_callback(void);
|
|
bool uart1_check_rx_done( uint8_t *buffer , uint32_t *length );
|
|
/* USER CODE END Private defines */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __MAIN_H */
|