/* 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) 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 __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32u5xx_hal.h"

#include "stm32u5xx_nucleo.h"

#include "nfc_conf.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#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 */

#define REBOOT_ON_SERIAL_KEYPRESS()     do{while((GPIOA->IDR & GPIO_PIN_10) != 0) {} ; HAL_NVIC_SystemReset();}while(0)
#define REBOOT_ON_ERROR()               REBOOT_ON_SERIAL_KEYPRESS()
#define REBOOT_ON_FAULT()               REBOOT_ON_SERIAL_KEYPRESS()

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define PRESCALER_VALUE 9999
#define NFC_IRQ_Pin GPIO_PIN_0
#define NFC_IRQ_GPIO_Port GPIOA
#define NFC_IRQ_EXTI_IRQn EXTI0_IRQn
#define NFC_LED1_Pin GPIO_PIN_1
#define NFC_LED1_GPIO_Port GPIOA
#define NFC_LED3_Pin GPIO_PIN_0
#define NFC_LED3_GPIO_Port GPIOB
#define NFC_LED5_Pin GPIO_PIN_10
#define NFC_LED5_GPIO_Port GPIOB
#define NFC_RST_Pin GPIO_PIN_7
#define NFC_RST_GPIO_Port GPIOC
#define NFC_SS_Pin GPIO_PIN_9
#define NFC_SS_GPIO_Port GPIOC
#define NFC_LED4_Pin GPIO_PIN_8
#define NFC_LED4_GPIO_Port GPIOA
#define NFC_LED6_Pin GPIO_PIN_4
#define NFC_LED6_GPIO_Port GPIOB
#define NFC_TMP_LED2_Pin GPIO_PIN_6
#define NFC_TMP_LED2_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
