/*!
 * @file        user_tmr_config.h
 *
 * @brief       TMR PWM Input configuration
 *
 * @version     V1.0.0
 *
 * @date        2026-03-27
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 */

#ifndef USER_TMR_CONFIG_H
#define USER_TMR_CONFIG_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes */
#include "g32a10xx.h"
#include "g32a10xx_gpio.h"
#include "g32a10xx_tmr.h"
#include "g32a10xx_misc.h"

/** @addtogroup Examples
  @{
*/

/** @addtogroup TMR_Examples
@{
*/

/** @addtogroup TMR_PWMInput
  @{
*/

/** @defgroup TMR_PWMInput_Macros Macros
  @{
*/

/* TMR3 CH2 */
#define TMR3_CH2_GPIO_PORT        GPIOA
#define TMR3_CH2_PIN              GPIO_PIN_7
#define TMR3_CH2_PIN_SOURCE       GPIO_PIN_SOURCE_7
#define TMR3_CH2_GPIO_AF          GPIO_AF_PIN1

/**@} end of group TMR_PWMInput_Macros */

/** @defgroup TMR_PWMInput_Variables Variables
  @{
*/

extern Gpio_ConfigType g_tmr3_Ch2GpioConfig;

extern Tmr_IcConfigType g_tmr3_PWMInputConfig;

extern Tmr_TimeBaseType g_tmr1_BaseConfig;

extern volatile uint32_t tick;

extern volatile uint32_t g_overflowCNT;
extern volatile uint8_t  g_irqFlag;
extern volatile uint32_t g_ic2Value;
extern volatile uint32_t g_ic1Value;
extern volatile uint32_t g_dutyCycle;
extern volatile uint32_t g_frequency;
extern volatile uint32_t g_highLev;
extern volatile uint32_t g_lowLev;
extern volatile uint32_t g_hclk;
extern volatile uint32_t g_peroid;

/**@} end of group TMR_PWMInput_Variables */

void Tmr_Delay(void);

/**@} end of group TMR_PWMInput */
/**@} end of group TMR_Examples */
/**@} end of group Examples */

#ifdef __cplusplus
}
#endif

#endif /* USER_TMR_CONFIG_H */
