/*
 * API_Device_Init.h
 *
 *  Created on: 2012-3-27
 *      Author: arno.qi
 */

#ifdef        GLOBALS_API_DEV
    #define   EXTERN_API_DEV
    
#else
    #define   EXTERN_API_DEV     extern
#endif

#ifndef API_DEVICE_INIT_H_
#define API_DEVICE_INIT_H_

    #define     NormalChip               0x80
    #define     SpecialChip              0x00
    #define     InitDIRECT               0          
    #define     InitIVBR                 0xFF
    #define     InitCPMUPROT             0x26
    #define     InitCPMUCLKS             0x87
    #define     InitCPMUREFDIV           0x40
    #define     InitCPMUSYNR             0x47 //0X47 4M;  8M 0X43
    #define     InitCPMUPOSTDIV          0x00
    #define     InitCPMUPLL              0
    #define     InitPUCR                 0x40
    #define     InitCPMUCOP              0x07 
    #define     Enable                   1
    #define     Disable                  0
    #define     WaitRun                  0
    #define     null                     0
    #define     one                      1
    #define     ClearFlag                1
    #define     clear                    0
    #define     True                     1
    #define     false                    0
    #define     PushDown                 0
    #define     UpSpring                 1
    #define     BusClock                 32000000 //16777216
    #define     SafetyVeh                10 *64
    #define     Prio1                    1 
    #define     Prio2                    2  
    #define     Prio3                    3  
    #define     Prio4                    4  
    #define     Prio5                    5   
    #define     Prio6                    6 
    #define     Prio7                    7          
    
    #define     PushDown                 0
    #define     UpSpring                 1 
    
    #define     Auto                     1 
     
    #define     pSTB                     PTP_PTP1 
   
    /*#define     pSBRInput                PT1AD_PT1AD2  //Êó±ê-    
    #define     pSBLInput                PT1AD_PT1AD1  //Êó±ê+
    
    
    #define     P22_V7_BY1               PTV_PTV7
    #define     P21_V6_BY2               PTV_PTV6
    #define     P20_V5_OMID              PTV_PTV5
    #define     P19_V4_OFUll             PTV_PTV4
    #define     P16_V3_OPOW              PTV_PTV3
    #define     P15_V2_OP1               PTV_PTV2
    #define     P14_V1_OP2               PTV_PTV1
    #define     P13_V0_OP3               PTV_PTV0
    
    #define     P12_U7_OP4               PTU_PTU7
    #define     P11_U6_OP5               PTU_PTU6
    #define     P10_U5_OP6               PTU_PTU5
    #define     P9_U4_ON1                PTU_PTU4
    #define     P6_U3_ON2                PTU_PTU3
    #define     P5_U2_ON3                PTU_PTU2
    
    #define     P99_AD6_ON4              PT1AD_PT1AD6
    #define     P98_AD5_ON5              PT1AD_PT1AD5
    #define     P97_AD4_ON6              PT1AD_PT1AD4

    #define     P96_AD3_IPOW             PT1AD_PT1AD3*/
    
    /*******************************************************
    * INPUT
    *******************************************************/
    #define     pSB1                     PT1AD_PT1AD1
    #define     pSB2                     PT1AD_PT1AD2
    

    #define     LED_P1                   1
    #define     LED_P2                   2
    #define     LED_P3                   3
    #define     LED_P4                   4
    #define     LED_P5                   5
    #define     LED_P6                   6
    #define     Full                     7
    #define     Mid                      8
    
    #define     LED_N1                   11
    #define     LED_N2                   12
    #define     LED_N3                   13
    #define     LED_N4                   14
    #define     LED_N5                   15
    #define     LED_N6                   16
    
    #define     LED_all                  20
    
    
    
    
    

                     
    EXTERN_API_DEV     void    Api_Sys_Init(void);
    EXTERN_API_DEV     void    Api_Clock_Init(void);
    EXTERN_API_DEV     void    Api_IO_init(void);
    
#endif /* API_DEVICE_INIT_H_ */
