
#ifndef RTE_GPIO_H
#define RTE_GPIO_H

#include "TYW_stdint.h"
#include "GPIO.h"
#define    LCD_CSB1                          GPIO_OUT_PORT08_PIN07
#define    LCD_CSB2                          GPIO_OUT_PORT10_PIN01
#define    LCD_CSB1_DIR                      GPIO_DIR_PORT08_PIN07
#define    LCD_CSB2_DIR                      GPIO_DIR_PORT10_PIN01

#define    LCD_SCK1                          GPIO_OUT_PORT10_PIN11
#define    LCD_SCK2                          GPIO_OUT_PORT10_PIN00
#define    LCD_SCK1_DIR                      GPIO_DIR_PORT10_PIN11
#define    LCD_SCK2_DIR                      GPIO_DIR_PORT10_PIN00

#define    LCD_SDI1_OUT                      GPIO_OUT_PORT10_PIN09
#define    LCD_SDI1_INPUT                    GPIO_IN_PORT10_PIN09
#define    LCD_SDI1_DIR                      GPIO_DIR_PORT10_PIN09
#define    LCD_SDI2_OUT                      GPIO_OUT_PORT08_PIN09
#define    LCD_SDI2_INPUT                    GPIO_IN_PORT08_PIN09
#define    LCD_SDI2_DIR                      GPIO_DIR_PORT08_PIN09

#define    LCD_SDO1_OUT                      GPIO_OUT_PORT10_PIN10
#define    LCD_SDO1_INPUT                    GPIO_IN_PORT10_PIN10
#define    LCD_SDO1_DIR                      GPIO_DIR_PORT10_PIN10
#define    LCD_SDO2_OUT                      GPIO_OUT_PORT08_PIN10
#define    LCD_SDO2_INPUT                    GPIO_IN_PORT08_PIN10
#define    LCD_SDO2_DIR                      GPIO_DIR_PORT08_PIN10

#define    LCD_ERROUT1_OUT                   GPIO_OUT_PORT08_PIN08
#define    LCD_ERROUT1_INPUT                 GPIO_IN_PORT08_PIN08
#define    LCD_ERROUT1_DIR                   GPIO_DIR_PORT08_PIN08
#define    LCD_ERROUT2_OUT                   GPIO_OUT_PORT11_PIN02
#define    LCD_ERROUT2_INPUT                 GPIO_IN_PORT11_PIN02
#define    LCD_ERROUT2_DIR                   GPIO_DIR_PORT11_PIN02

#define    LCD_INHB_DIR                      GPIO_DIR_PORT11_PIN03
#define    LCD_INHB_INPUT                    GPIO_IN_PORT11_PIN03
#define    LCD_INHB_OUT                      GPIO_OUT_PORT11_PIN03

#define LINE_OUT_NEG_09 GPIO_OUT_PORT10_PIN04 //485_RE

#define ONE_START GPIO_OUT_PORT10_PIN14   //一键启动
#define ABC_OUT GPIO_OUT_PORT00_PIN04   //ABC轮动报警输出
#define BCDD_MCU GPIO_OUT_PORT10_PIN00   //脚撑

#define RELAY_VBAT_MCU GPIO_OUT_PORT10_PIN10 
#define RELAY_DC12V_MCU GPIO_OUT_PORT10_PIN09
#define RELAY_KEY_MCU GPIO_OUT_PORT10_PIN07
#define RELAY_LIGHTCONTROL_MCU GPIO_OUT_PORT10_PIN06 //光控大灯MCU

#define ZXSW_12V  GPIO_OUT_PORT11_PIN05 //转向12V
#define FULL_BEAM  GPIO_OUT_PORT09_PIN04 //远光
#define left_turn  GPIO_OUT_PORT09_PIN03 //左转
#define right_turn  GPIO_OUT_PORT09_PIN02 //右转

#define SW1  GPIO_IN_PORT09_PIN01   
#define SW2  GPIO_IN_PORT09_PIN00 
#define SW3  GPIO_IN_APORT00_PIN00   
#define SW4  GPIO_IN_APORT00_PIN01   
#define SW5  GPIO_IN_APORT00_PIN02   

#define SW6  GPIO_IN_APORT00_PIN03
#define SW7  GPIO_IN_APORT00_PIN04
#define SW8  GPIO_IN_APORT00_PIN05  

#define AD_B  GPIO_IN_APORT00_PIN06
#define DCF_Open GPIO_IN_APORT00_PIN07  //电磁阀开
#define ZXSW_AD GPIO_IN_APORT00_PIN08
#define DCF_Close GPIO_IN_APORT00_PIN09 //电磁阀关
#define DIS_AD GPIO_IN_APORT00_PIN10
#define Light_control_headlights GPIO_IN_APORT00_PIN11 //光控大灯
#define TX_OUT GPIO_OUT_PORT00_PIN08 //一线通TX输出



/*  ---------------------旧的-------------------------- */
// #define POWER_CTRL_KL30         GPIO_OUT_PORT10_PIN13
#define POWER_CTRL_KL15         GPIO_OUT_PORT10_PIN12
#define SW10 GPIO_IN_PORT10_PIN02
#define LINE_OUT_NEG_01 GPIO_OUT_PORT09_PIN06   //12V
#define LINE_OUT_NEG_02 GPIO_OUT_PORT09_PIN05   //BAT
#define LINE_OUT_NEG_03 GPIO_OUT_PORT09_PIN04   //BAT~
#define LINE_OUT_NEG_04 GPIO_OUT_PORT09_PIN03   //ACC1

#define LINE_FUEL_RES01 GPIO_OUT_PORT00_PIN13

#define LINE_FUEL_RES03 GPIO_OUT_PORT08_PIN10

#define LINE_FUEL_RES04 GPIO_OUT_PORT08_PIN11   //左转  输入
#define LINE_FUEL_RES02 GPIO_OUT_PORT08_PIN12   //右转 输入

#define GPIO_VSpeed_PWM_IN GPIO_IN_PORT10_PIN15

#define LED3 GPIO_OUT_APORT00_PIN10 //右转
#define LED4 GPIO_OUT_APORT00_PIN11 //左转
#define LINE_OUT_NEG_06 GPIO_OUT_PORT09_PIN01   //位置灯
#define LINE_jinguang GPIO_OUT_PORT10_PIN10 //近光
#define POWER_CTRL_KL30_Current GPIO_OUT_PORT10_PIN14   //蓝牙
//zh:

/******************************************************************************
函数接口
******************************************************************************/
void RTE_GPIO_30_Init(void);    // 30初始化
void GPIO_Sleep_Init(void);     //睡眠初始化

void RTE_GPIO_Init(void);
void RTE_GPIO_Wakeup_Init(void);
void RTE_GPIO_Sleep_Init(void);

#endif
