/** ******************************************************************************* * @file hc32f4a0_tmr0.h * @brief This file contains all the functions prototypes of the TMR0 driver * library. @verbatim Change Logs: Date Author Notes 2020-06-12 Heqb First version @endverbatim ******************************************************************************* * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. * * This software component is licensed by HDSC under BSD 3-Clause license * (the "License"); You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************* */ #ifndef __HC32F4A0_TMR0_H__ #define __HC32F4A0_TMR0_H__ /* C binding of definitions if building with C++ compiler */ #ifdef __cplusplus extern "C" { #endif /******************************************************************************* * Include files ******************************************************************************/ #include "hc32_common.h" #include "ddl_config.h" /** * @addtogroup HC32F4A0_DDL_Driver * @{ */ /** * @addtogroup DDL_TMR0 * @{ */ #if (DDL_TMR0_ENABLE == DDL_ON) /******************************************************************************* * Global type definitions ('typedef') ******************************************************************************/ /** * @defgroup TMR0_Global_Types TMR0 Global Types * @{ */ /** * @brief Tmr0 base counter function init structrue definition */ typedef struct { uint32_t u32ClockDivision; /*!< Specifies the TMR0 clock division, and this parameter can be a value of @ref TMR0_Clock_Division_define */ uint32_t u32ClockSource; /*!< Specifies the TMR0 clock source, and this parameter can be a value of @ref TMR0_Clock_Source_define*/ uint32_t u32Tmr0Func; /*!< Specifies the TMR0 function, compare output or capture input @ref TMR0_Function_define */ uint32_t u32HwTrigFunc; /*!< Specifies the TMR0 compare function hardware trigger function, and this parameter can be a value of @ref TMR0_HardwareTrigger_Func_define */ uint16_t u16CmpValue; /*!< Specifies the TMR0 compare value This value can be set 0-0xFFFF */ uint16_t u16CntValue; /*!< Specifies the TMR0 count value This value can be set 0-0xFFFF */ }stc_tmr0_init_t; /** * @} */ /******************************************************************************* * Global pre-processor symbols/macros ('#define') ******************************************************************************/ /** * @defgroup TMR0_Global_Macros TMR0 Global Macros * @{ */ /** @defgroup TMR0_Clock_Division_define TMR0 clock division define * @{ */ #define TMR0_CLK_DIV1 (0UL<