/**
* @file:	 pwm_manage.h
* @brief:
* @author:	mingyea
* @version: V1.0.0
* @date:	 2016-03-22
* @history:
*	   1.
*  author:
*  version:
*  date:
*/
#ifndef _PWM_MANAGE_H_
#define _PWM_MANAGE_H_

#include "system_config.h"

#if 0
#define PWM_BASE_ID_0  0u
#define PWM_BASE_ID_1  1u
#define PWM_BASE_ID_2  2u
#endif

#define PWM_BASE_ID_ATM  0u
#define PWM_BASE_ID_GPTM0  1u
#define PWM_BASE_ID_GPTM1  2u
#define PWM_BASE_ID_GPTM2  3u
#define PWM_BASE_ID_LPT32  4u

#if 0
#define PHY_PWM_CHANNEL_1		0U
#define PHY_PWM_CHANNEL_2		1U
#define PHY_PWM_CHANNEL_3		2U
#define PHY_PWM_CHANNEL_4		3U
#define PHY_PWM_CHANNEL_5		4U
#define PHY_PWM_CHANNEL_6		5U
#define PHY_PWM_CHANNEL_7		6U
#define PHY_PWM_CHANNEL_8		7U
#define PHY_PWM_CHANNEL_9		4U
#define PHY_PWM_CHANNEL_10		5U
#define PHY_PWM_CHANNEL_11		6U
#define PHY_PWM_CHANNEL_12		7U
#endif

#define PHY_PWM_CHANNEL_ATM_CH1		0u
#define PHY_PWM_CHANNEL_ATM_CH2		1u
#define PHY_PWM_CHANNEL_ATM_CH3		2u
#define PHY_PWM_CHANNEL_ATM_CH4		3u
#define PHY_PWM_CHANNEL_GPTM0_CH1	4u
#define PHY_PWM_CHANNEL_GPTM0_CH2	5u
#define PHY_PWM_CHANNEL_GPTM0_CH3	6u  //非48pin才有
#define PHY_PWM_CHANNEL_GPTM0_CH4	7u	//非48pin才有
#define PHY_PWM_CHANNEL_GPTM1_CH1	8u
#define PHY_PWM_CHANNEL_GPTM1_CH2	9u
#define PHY_PWM_CHANNEL_GPTM1_CH3	10u
#define PHY_PWM_CHANNEL_GPTM1_CH4	11u
#define PHY_PWM_CHANNEL_GPTM2_CH1	12u
#define PHY_PWM_CHANNEL_GPTM2_CH2	13u
#define PHY_PWM_CHANNEL_GPTM2_CH3	14u  //非48pin才有
#define PHY_PWM_CHANNEL_GPTM2_CH4	15u  //非48pin才有
#define PHY_PWM_CHANNEL_LP32_CH1	16u
#define PHY_PWM_CHANNEL_LP32_CH2	17u
#define PHY_PWM_CHANNEL_LP32_CH3	18u //非48pin才有
#define PHY_PWM_CHANNEL_LP32_CH4	19u //非48pin才有

#define PWM_PYH_TOTAL_CHANNEL 20u

#include "pwm_manage_cfg.h"
//#include "pwm.h"


void pwm_manage_atm_init(void);
void pwm_manage_gptm0_init(void);
void pwm_manage_gptm1_init(void);
void pwm_manage_gptm2_init(void);
void pwm_manage_lpt32_init(void);

void pwm_manage_init(void);
void pwm_manage_deinit(void);

void pwm_manage_goto_sleep(void);
void pwm_manage_goto_wakeup(void);

void pwm_set_duty(u8 base_id, u8 channel_id,u16 duty);
void pwm_disable(u8 base_id, u8 channel_id);
void pwm_enable(u8 base_id, u8 channel_id);


#endif

