/******************************************************************************
;  *   	@MCU				 : MC51F003A4
;  *   	@Create Date         : 2020.01.02
;  *   	@Author/Corporation  : Martin/SinoMCU
;  *   	@晟矽微技术支持QQ群   : 814641858
;  *    @晟矽微官方论坛       : http://bbs.sinomcu.com/
;  *   	@Copyright           : 2020 SINOMCU Corporation,All Rights Reserved.
;  *----------------------Abstract Description---------------------------------
;  *			          定义                              		
******************************************************************************/

#ifndef PWM0_LIB_H__
#define PWM0_LIB_H__

#include "MC51F003A4_COMMON.h"

#define PWM0_EN         0x80
#define PWM0_IE_ADDR    0x10
#define PWM0_OE_ADDR    0x10

#define PWM0_POL_HIGH   0
#define PWM0_POL_LOW    1

#define PWM0_OE_DISABLE    0
#define PWM0_OE_ENABLE    0x10

#define PWM0_CLK_DIV_1       0
#define PWM0_CLK_DIV_2     0x01
#define PWM0_CLK_DIV_4     0x02
#define PWM0_CLK_DIV_8     0x03
#define PWM0_CLK_DIV_16    0x04
#define PWM0_CLK_DIV_32    0x05
#define PWM0_CLK_DIV_64    0x06
#define PWM0_CLK_DIV_128   0x07

typedef struct
{
    uint8_t PWM0_OE;                //PWM0输出使能
    uint8_t PWM0_polarity;          //极性选择
    uint8_t PWM0_clock_division;               //频率
    uint8_t PWM0_interrupt;          //中断允许	ENABLE,DISABLE
    uint8_t PWM0_interrupt_priority; //中断优先级 DEF_HIGH,DEF_LOW
} PWM0_InitTypeDef;

void PWM0_Init(PWM0_InitTypeDef *PWM0);
void PWM0_Out_Bit_Set(uint8_t state);
void PWM0_T_Set(uint8_t num);
void PWM0_D_Set(uint8_t num);



#endif

/**************************** end of file *********************************************/
