#include "common_include.h"
/*-------------------------------------------------------------------------
* Function Name  : bsp_GPIO_Init
* Description    :
* Input          : None
* Output         : None
* Return         : None
* onther         :
--------------------------------------------------------------------------*/
void BSP_GPIO_Init(void)
{
    //BD433 电源控制
    stc_port_pin_config_t stc_port_pin_config1_00 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1, 0, &stc_port_pin_config1_00 );
   // 
   //stc_port_pin_config_t stc_port_pin_config2_27 = { .enOutputFunction      = PortOutputResourceGPIO,
   //     .enOutputDrive         = PortOutputDriveA,
   //     .enPullResistor        = PortPullResistorNone,
   //     .enInputLevel          = PortInputLevelCmosA,
   //     .bInputEnable          = FALSE,
   //     .bNoiseFilterEnable    = TRUE,
   //     .enGpioDirection       = PortGpioOutput,
   // .enGpioInitOutputLevel = PortGpioLow};
   // Port_SetPinConfig( 2, 27, &stc_port_pin_config2_27 );
    
    // AirbagLed   AIR_BAG（+）BitSW_IN
    stc_port_pin_config_t stc_port_pin_config2_28 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioInput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 2, 28, &stc_port_pin_config2_28 );
    

    Port_EnableInput();
    //oilPressure
    stc_port_pin_config_t stc_port_pin_config0_15 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = TRUE,
        .bNoiseFilterEnable    = FALSE,
        .enGpioDirection       = PortGpioInput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 0, 15, &stc_port_pin_config0_15 );
    Port_EnableInput();
    //ALT
    stc_port_pin_config_t stc_port_pin_config0_16 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = TRUE,
        .bNoiseFilterEnable    = FALSE,
        .enGpioDirection       = PortGpioInput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 0, 16, &stc_port_pin_config0_16 );
    Port_EnableInput();
    //IIC SDA
    stc_port_pin_config_t stc_port_pin_config1_09 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 1, 9, &stc_port_pin_config1_09 );
    //IIC SCL
    stc_port_pin_config_t stc_port_pin_config1_08 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 1, 8, &stc_port_pin_config1_08 );
    //Drive Mode
    stc_port_pin_config_t stc_port_pin_config0_22 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        //.enPullResistor        = PortPullResistorUp,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = TRUE,
        .bNoiseFilterEnable    = FALSE,
        .enGpioDirection       = PortGpioInput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 2, 19, &stc_port_pin_config0_22 );
    Port_EnableInput();
    //APOWER
    stc_port_pin_config_t stc_port_pin_config1_19 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1, 19, &stc_port_pin_config1_19 );
    //段码屏IO初始化
    //BUL_CSB
        stc_port_pin_config_t stc_port_pin_config2_00 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,0, &stc_port_pin_config2_00 );
    //BUL_SCL
        stc_port_pin_config_t stc_port_pin_config1_31 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1,31, &stc_port_pin_config1_31 );
    //BUL_SD
        stc_port_pin_config_t stc_port_pin_config1_30 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1,30, &stc_port_pin_config1_30 );
    //BUR_CSB
        stc_port_pin_config_t stc_port_pin_config1_29 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1, 29, &stc_port_pin_config1_29 );
    //BUR_SCL
        stc_port_pin_config_t stc_port_pin_config1_28 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1,28, &stc_port_pin_config1_28 );
    //BUR_SD
        stc_port_pin_config_t stc_port_pin_config1_27 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1,27, &stc_port_pin_config1_27 );  
    //LCD_SEG
        stc_port_pin_config_t stc_port_pin_config2_01 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,1, &stc_port_pin_config2_01 );
    //LCD_COM
        stc_port_pin_config_t stc_port_pin_config1_26 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 1,26, &stc_port_pin_config1_26 ); 
    //BD8379_CLK
    stc_port_pin_config_t stc_port_pin_config2_05 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,5, &stc_port_pin_config2_05 );
    //BD8379_LATCH
    stc_port_pin_config_t stc_port_pin_config2_08 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,8, &stc_port_pin_config2_08 );  
    //BD8379_OE
    stc_port_pin_config_t stc_port_pin_config2_04 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,4, &stc_port_pin_config2_04 ); 
    //BD8379_RST
    stc_port_pin_config_t stc_port_pin_config2_07 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,7, &stc_port_pin_config2_07 ); 
    //BD8379_SEROUT
    stc_port_pin_config_t stc_port_pin_config2_06 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,6, &stc_port_pin_config2_06 );
    //30电 电源 绿色报警灯 
    stc_port_pin_config_t stc_port_pin_config0_00 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 0,0, &stc_port_pin_config0_00 ); 
    //15电 电源 绿色报警灯 
    // stc_port_pin_config_t stc_port_pin_config1_15 = { .enOutputFunction      = PortOutputResourceGPIO,
    //     .enOutputDrive         = PortOutputDriveA,
    //     .enPullResistor        = PortPullResistorNone,
    //     .enInputLevel          = PortInputLevelCmosA,
    //     .bInputEnable          = FALSE,
    //     .bNoiseFilterEnable    = TRUE,
    //     .enGpioDirection       = PortGpioOutput,
    // .enGpioInitOutputLevel = PortGpioHigh};
    // Port_SetPinConfig( 1,15, &stc_port_pin_config1_15); 
    //LDW WHITE
    stc_port_pin_config_t stc_port_pin_config2_10 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 2,10, &stc_port_pin_config2_10);
    //LDW GREEN
    stc_port_pin_config_t stc_port_pin_config2_11 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 2,11, &stc_port_pin_config2_11 );  
    //LDW YELLOW
    stc_port_pin_config_t stc_port_pin_config2_09 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 2,9, &stc_port_pin_config2_09 );   
    //AUTO  WHITE
    stc_port_pin_config_t stc_port_pin_config0_09 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 0,9, &stc_port_pin_config0_09 ); 
    //AUTO  YELLOW 
    stc_port_pin_config_t stc_port_pin_config0_13 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 0,13, &stc_port_pin_config0_13 ); 
    //AUTO  GREEN 
    stc_port_pin_config_t stc_port_pin_config0_14 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig(0,14, &stc_port_pin_config0_14);  
    //DriveMode电 电源    
    stc_port_pin_config_t stc_port_pin_config1_18 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 1,18, &stc_port_pin_config1_18);
    //Buzzer 工作使能    
    stc_port_pin_config_t stc_port_pin_config1_02 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioLow};
    Port_SetPinConfig( 1,2, &stc_port_pin_config1_02);    
    //P档位硬线输出    
    stc_port_pin_config_t stc_port_pin_config2_26 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,26, &stc_port_pin_config2_26);
    //R档位硬线输出    
    stc_port_pin_config_t stc_port_pin_config2_14 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,14, &stc_port_pin_config2_14);
    //N档位硬线输出    
    stc_port_pin_config_t stc_port_pin_config2_27 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,27, &stc_port_pin_config2_27);
    //D档位硬线输出    
    stc_port_pin_config_t stc_port_pin_config2_29 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig( 2,29, &stc_port_pin_config2_29);
    //燃油使能硬线输出    
    stc_port_pin_config_t stc_port_pin_config2_12 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig(2,12, &stc_port_pin_config2_12);
    //液晶屏背光電源使能    
    stc_port_pin_config_t stc_port_pin_config2_13 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig(2,13, &stc_port_pin_config2_13);
   //VOICE功放电路驱动  
    stc_port_pin_config_t stc_port_pin_config1_23 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig(1,23, &stc_port_pin_config1_23);
   //IO模拟背光调节输出   
    stc_port_pin_config_t stc_port_pin_config1_04 = { .enOutputFunction      = PortOutputResourceGPIO,
        .enOutputDrive         = PortOutputDriveA,
        .enPullResistor        = PortPullResistorNone,
        .enInputLevel          = PortInputLevelCmosA,
        .bInputEnable          = FALSE,
        .bNoiseFilterEnable    = TRUE,
        .enGpioDirection       = PortGpioOutput,
    .enGpioInitOutputLevel = PortGpioHigh};
    Port_SetPinConfig(1,4, &stc_port_pin_config1_04);
}



