/***********************************************************************************************************
 * Copyright (c)  2021 - 2022, Unicmicro Co.,Ltd .
 * All rights reserved.
 * Filename    : gtimer.h
 * Description : gtimer driver header file
 * Author(s)   : yanhaihua
 * version     : V1.0
 * Modify date : 2021-09-23
 ***********************************************************************************************************/
#ifndef __GTIMER_H__
#define __GTIMER_H__

#include "config.h"

#ifdef UM3213xA_USING_GTIMER0

void gtimer0_pwm_init(uint16_t arr,uint16_t ccr,uint16_t psc);

void gtimer0_start(void);

void gtimer0_stop(void);

void gtimer0_pwm_enable(void);

void gtimer0_pwm_idle(void);

#endif

#ifdef UM3213xA_USING_GTIMER1

void gtimer1_pwm_init(uint16_t arr,uint16_t ccr,uint16_t psc);

void gtimer1_start(void);

void gtimer1_stop(void);

void gtimer1_pwm_enable(void);

void gtimer1_pwm_idle(void);

#endif

#ifdef UM3213xA_USING_GTIMER2

void gtimer2_count_init(uint16_t arr,uint16_t psc);

void gtimer2_count_irq_init(em_enable_t enable,void (*pfunc)());

void gtimer2_start(void);

void gtimer2_stop(void);

#endif

#if defined(UM3213xA_USING_GTIMER1) || defined(UM3213xA_USING_GTIMER1)

void gtimer_start_all(void);

void gtimer_set_irq_flag(uint8_t flag);
#endif

#endif

