#ifndef MY_HEADER_H
#define MY_HEADER_H

#include <stdio.h>
#include <string.h>

#include <math.h>
#include "CMSDK_CM0.h"
#include "ENS1_TIMER.h"
#define TRUE 1
#define FALSE 0

/*typedef enum
{
    true=1, false=0
}bool;*/
typedef enum {CHANNEL_0 = 0,CHANNEL_1,CHANNEL_2,CHANNEL_3} CHANNEL_NUM;
typedef enum {ALT_FUNC0=0,ALT_FUNC1=1,ALT_FUNC2=2,ALT_FUNC3=3  } GPIO_AltFuncSel;
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus ,IOStatus;
typedef enum {DISABLE = 0, ENABLE } FunctionalState;
typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
typedef enum {LOW_LEVEL = 0, HIGH_LEVEL = !LOW_LEVEL} LEVELStatus;
typedef enum {OUTPUT = 0, INPUT = !OUTPUT} I_O_SELECT;
typedef enum {oversamp_16 = 0, oversamp_13=!oversamp_16} OverSampModeSel;
typedef enum 
{
	GPIO_PU = 0x00,			//上拉
	GPIO_PD = 0x01,			//下拉
	GPIO_NOPULL = 0x02		//无上下拉
}GPIO_PUPD_TypeDef;

//输出速度选择枚举
typedef enum 
{
	OUTPUT_FAST = 0x00,		//快速
	OUTPUT_SLOW = 0x01		//慢速
}OUTPUT_SPEED_TypeDef;

//输出模式选择枚举
typedef enum
{
	GPIO_OType_PP = 0x00,	//推挽输出
	GPIO_OType_OD = 0x01	//开漏输出
}GPIOOType_TypeDef;

//驱动强度选择枚举
typedef enum 
{
	PDRV_4mA = 0x00,		//输出驱动强度4mA
	PDRV_8mA,				//输出驱动强度8mA
	PDRV_14mA,				//输出驱动强度14mA
	PDRV_16mA 				//输出驱动强度16mA
}OUTPUT_PDRV_TypeDef;		


typedef enum {
	GPIO_0=0,
	GPIO_1=1,
	GPIO_2=2,
	GPIO_3=3,
	GPIO_4=4,
	GPIO_5=5,
	GPIO_6=6,
	GPIO_7=7,
	GPIO_8=8,
	GPIO_9=9,
	GPIO_10=10,
	GPIO_11=11,
	GPIO_12=12,
	GPIO_13=13,
	GPIO_14=14,
	GPIO_15=15,
	GPIO_16=16,
	GPIO_17=17,
	GPIO_18=18,
	GPIO_19=19,
	GPIO_20=20,
	GPIO_21=21,
	GPIO_22=22,
	GPIO_23=23,
}GPIO_NUM;

#endif
