/*!
 * @file        user_tmr_config.h
 *
 * @brief       TMR 6Steps configuration
 *
 * @version     V1.0.0
 *
 * @date        2026-03-26
 *
 * @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.
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the license.
 */

#ifndef USER_TMR_CONFIG_H
#define USER_TMR_CONFIG_H

/* Includes */
#include "g32a10xx_tmr.h"
#include "g32a10xx_gpio.h"
#include "g32a10xx_misc.h"
#include "g32a10xx_eint.h"
#include "g32a10xx_rcm.h"

#ifdef __cplusplus
extern "C" {
#endif

/** @addtogroup Examples
  @{
*/

/** @addtogroup TMR_Examples
@{
*/

/** @addtogroup TMR_6Steps
  @{
*/

/** @defgroup TMR_6Steps_Macros Macros
  @{
*/

/* ========================= TMR1 IO Definition ========================= */
/* CH1 */
#define TMR1_CH1_PORT        GPIOC
#define TMR1_CH1_PIN         GPIO_PIN_13
#define TMR1_CH1_PIN_SRC     GPIO_PIN_SOURCE_13
#define TMR1_CH1_AF          GPIO_AF_PIN2

/* CH2 */
#define TMR1_CH2_PORT        GPIOC
#define TMR1_CH2_PIN         GPIO_PIN_14
#define TMR1_CH2_PIN_SRC     GPIO_PIN_SOURCE_14
#define TMR1_CH2_AF          GPIO_AF_PIN2

/* CH3 */
#define TMR1_CH3_PORT        GPIOC
#define TMR1_CH3_PIN         GPIO_PIN_15
#define TMR1_CH3_PIN_SRC     GPIO_PIN_SOURCE_15
#define TMR1_CH3_AF          GPIO_AF_PIN2

/* BKIN */
#define TMR1_BKIN_PORT       GPIOB
#define TMR1_BKIN_PIN        GPIO_PIN_12
#define TMR1_BKIN_PIN_SRC    GPIO_PIN_SOURCE_12
#define TMR1_BKIN_AF         GPIO_AF_PIN2

/* CH1N */
#define TMR1_CH1N_PORT       GPIOB
#define TMR1_CH1N_PIN        GPIO_PIN_13
#define TMR1_CH1N_PIN_SRC    GPIO_PIN_SOURCE_13
#define TMR1_CH1N_AF         GPIO_AF_PIN2

/* CH2N */
#define TMR1_CH2N_PORT       GPIOB
#define TMR1_CH2N_PIN        GPIO_PIN_14
#define TMR1_CH2N_PIN_SRC    GPIO_PIN_SOURCE_14
#define TMR1_CH2N_AF         GPIO_AF_PIN2

/* CH3N */
#define TMR1_CH3N_PORT       GPIOB
#define TMR1_CH3N_PIN        GPIO_PIN_15
#define TMR1_CH3N_PIN_SRC    GPIO_PIN_SOURCE_15
#define TMR1_CH3N_AF         GPIO_AF_PIN2

/* GPIO Group */
#define TMR1_GPIOB_PINS      ((uint16_t)GPIO_PIN_12 | (uint16_t)GPIO_PIN_13 | (uint16_t)GPIO_PIN_14 | (uint16_t)GPIO_PIN_15)
#define TMR1_GPIOC_PINS      ((uint16_t)GPIO_PIN_13 | (uint16_t)GPIO_PIN_14 | (uint16_t)GPIO_PIN_15)

/**@} end of group TMR_6Steps_Macros */

/** @defgroup TMR_6Steps_Variables Variables
  @{
*/

extern Tmr_TimeBaseType    g_tmrBaseCfg;
extern Tmr_OcConfigType    g_tmrOc1Cfg;
extern Tmr_OcConfigType    g_tmrOc2Cfg;
extern Tmr_OcConfigType    g_tmrOc3Cfg;
extern Tmr_BdtInitType     g_tmrBdtCfg;

/**@} end of group TMR_6Steps_Variables */

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

#ifdef __cplusplus
}
#endif

#endif /* USER_TMR_CONFIG_H */
