/*--------------------------------------------------------------------------
Header file for ADC.
--------------------------------------------------------------------------*/

#ifndef __CCU_H__
#define __CCU_H__

void CCU_SetMode(unsigned char nChannel,unsigned char nMode);
unsigned int CCU_GetResult(unsigned char nChannel, unsigned char  nMode);
void CCU_Start(unsigned char);
void CCU_EnableIE(unsigned char nChannel);
#define d_CCU_EN_CH0 (1 <<4)
#define d_CCU_EN_CH1 (1 <<5)
#define d_CCU_EN_CH2 (1 <<6)
#define d_CCU_EN_CH3 (1 <<7)

#define d_CCU_MODE_DISBALE        0x00
#define d_CCU_MODE_NO_OUTPUT      0x01
#define d_CCU_MODE_MODE0          0x02
#define d_CCU_MODE_MODE1 					0x03
#define d_CCU_MODE_RISING 				0x04
#define d_CCU_MODE_FALLING 				0x05
#define d_CCU_MODE_BOTH 					0x06
#define d_CCU_MODE_REGISTER		 	  0x07
#define d_CCU_MODE_SINGLE_HI  		0x08
#define d_CCU_MODE_SINGLE_LOW 		0x09
#define d_CCU_MODE_SINGLE_HI_LOW  0x0A
#define d_CCU_MODE_SINGLE_LOW_HI  0x0B
#define d_CCU_MODE_CONTINUE_HI    0x0C
#define d_CCU_MODE_CONTINUE_LOW   0x0D
#define d_CCU_MODE_CONTINUE_HI_LOW 0x0E
#define d_CCU_MODE_CONTINUE_LOW_HI 0x0F

#define d_CCU_CLOCK_1_1     (0x00 << 0x05)
#define d_CCU_CLOCK_1_2     (0x01 << 0x05)
#define d_CCU_CLOCK_1_4     (0x02 << 0x05)
#define d_CCU_CLOCK_1_6     (0x03 << 0x05)
#define d_CCU_CLOCK_1_8     (0x04 << 0x05)
#define d_CCU_CLOCK_1_12    (0x05 << 0x05)
#define d_CCU_CLOCK_1_24    (0x06 << 0x05)

#endif
