#ifndef __DEVICEGPIOINIT_H
|
#define __DEVICEGPIOINIT_H
|
|
#include "define_all.h"
|
|
typedef enum
|
{
|
CS_1 = 0U,
|
CS_2,
|
} CS_TYPED_T;
|
#define FM25V02_CS_LOW(__CS_TYPE__) \
|
do \
|
{ \
|
if (__CS_TYPE__ == CS_1) \
|
{ \
|
FM25V02_CS1_L; \
|
FM25V02_CS2_H; \
|
} \
|
else \
|
{ \
|
FM25V02_CS2_L; \
|
FM25V02_CS1_H; \
|
} \
|
} while (0)
|
#define FM25V02_CS_HIGH \
|
do \
|
{ \
|
FM25V02_CS1_H; \
|
FM25V02_CS2_H; \
|
} while (0)
|
|
// Fram Flash CS SPI¶Ë¿Ú
|
#define Fram_Flash_SPI_SCL_PIN_NUM GPIO_Pin_7 // spi_cLk
|
#define Fram_Flash_SPI_SCL_GROUP GPIOC
|
|
#define Fram_Flash_SPI_MISO_PIN_NUM GPIO_Pin_8 // spi_miso
|
#define Fram_Flash_SPI_MISO_PIN_GROUP GPIOC
|
|
#define Fram_Flash_SPI_MOSI_PIN_NUM GPIO_Pin_9 // spi_mosi
|
#define Fram_Flash_SPI_MOSI_PIN_GROUP GPIOC
|
|
#define FRAM_CS1_NUM GPIO_Pin_6 // e2p_cs1
|
#define FRAM_CS1_GROUP GPIOC
|
#define FM25V02_CS1_H GPIO_SetBits(FRAM_CS1_GROUP, FRAM_CS1_NUM)
|
#define FM25V02_CS1_L GPIO_ResetBits(FRAM_CS1_GROUP, FRAM_CS1_NUM)
|
|
#define FRAM_CS2_NUM GPIO_Pin_14 // e2p_cs2
|
#define FRAM_CS2_GROUP GPIOC
|
#define FM25V02_CS2_H GPIO_SetBits(FRAM_CS2_GROUP, FRAM_CS2_NUM)
|
#define FM25V02_CS2_L GPIO_ResetBits(FRAM_CS2_GROUP, FRAM_CS2_NUM)
|
|
#define E2P_VCC_EN_NUM GPIO_Pin_11
|
#define E2P_VCC_EN_GROUP GPIOC
|
#define E2P_VCC_ON GPIO_ResetBits(E2P_VCC_EN_GROUP, E2P_VCC_EN_NUM)
|
#define E2P_VCC_OFF GPIO_SetBits(E2P_VCC_EN_GROUP, E2P_VCC_EN_NUM)
|
|
// LCDµçÔ´¿ØÖƹܽÅ
|
#define LCD_POWER_CON_NUM GPIO_Pin_0
|
#define LCD_POWER_CON_GROUP GPIOF
|
#define LCD_Power_ON GPIO_SetBits(LCD_POWER_CON_GROUP, LCD_POWER_CON_NUM)
|
#define LCD_Power_OFF GPIO_ResetBits(LCD_POWER_CON_GROUP, LCD_POWER_CON_NUM)
|
|
// LCD IIC
|
#define LCD_SDA_PIN_NUM GPIO_Pin_3 // LCD_SDA
|
#define LCD_SDA_PIN_GROUP GPIOD
|
#define LCD_SDA_H GPIO_SetBits(LCD_SDA_PIN_GROUP, LCD_SDA_PIN_NUM)
|
#define LCD_SDA_L GPIO_ResetBits(LCD_SDA_PIN_GROUP, LCD_SDA_PIN_NUM)
|
|
#define LCD_SCL_PIN_NUM GPIO_Pin_2 // LCD_SCL
|
#define LCD_SCL_PIN_GROUP GPIOD
|
#define LCD_SCL_H GPIO_SetBits(LCD_SCL_PIN_GROUP, LCD_SCL_PIN_NUM)
|
#define LCD_SCL_L GPIO_ResetBits(LCD_SCL_PIN_GROUP, LCD_SCL_PIN_NUM)
|
|
#define LCD_SCL_READ GPIO_ReadInputDataBit(LCD_SCL_PIN_GROUP, LCD_SCL_PIN_NUM)
|
#define LCD_SDA_READ GPIO_ReadInputDataBit(LCD_SDA_PIN_GROUP, LCD_SDA_PIN_NUM)
|
|
#define LCD_RD_CLK_PIN_NUM GPIO_Pin_5 // LCD_RD
|
#define LCD_RD_CLK_PIN_GROUP GPIOD
|
#define LCD_CS_PIN_NUM GPIO_Pin_4 // LCD_CS
|
#define LCD_CS_PIN_GROUP GPIOD
|
|
// power EXport
|
#define POWER_EX_EN_PIN_NUM GPIO_Pin_13
|
#define POWER_EX_EN_PIN_GROUP GPIOB
|
#define powerEX_ON GPIO_SetBits(POWER_EX_EN_PIN_GROUP, POWER_EX_EN_PIN_NUM)
|
#define powerEX_OFF GPIO_ResetBits(POWER_EX_EN_PIN_GROUP, POWER_EX_EN_PIN_NUM)
|
|
#define POWER_9V_EN_PIN_NUM GPIO_Pin_14
|
#define POWER_9V_EN_PIN_GROUP GPIOB
|
#define power9V_ON GPIO_SetBits(POWER_9V_EN_PIN_GROUP, POWER_9V_EN_PIN_NUM)
|
#define power9V_OFF GPIO_ResetBits(POWER_9V_EN_PIN_GROUP, POWER_9V_EN_PIN_NUM)
|
|
#define POWER_12V_EN_PIN_NUM GPIO_Pin_15
|
#define POWER_12V_EN_PIN_GROUP GPIOB
|
#define power12V_ON GPIO_SetBits(POWER_12V_EN_PIN_GROUP, POWER_12V_EN_PIN_NUM) // PAout(6) = 1;
|
#define power12V_OFF GPIO_ResetBits(POWER_12V_EN_PIN_GROUP, POWER_12V_EN_PIN_NUM) // PAout(6) = 0;
|
|
#define OUTPUT1_EN_PIN_NUM GPIO_Pin_11
|
#define OUTPUT1_EN_PIN_GROUP GPIOB
|
#define OUTPUT1_EN_ON GPIO_SetBits(OUTPUT1_EN_PIN_GROUP, OUTPUT1_EN_PIN_NUM)
|
#define OUTPUT1_EN_OFF GPIO_ResetBits(OUTPUT1_EN_PIN_GROUP, OUTPUT1_EN_PIN_NUM)
|
|
#define OUTPUT2_EN_PIN_NUM GPIO_Pin_12
|
#define OUTPUT2_EN_PIN_GROUP GPIOB
|
#define OUTPUT2_EN_ON GPIO_SetBits(OUTPUT2_EN_PIN_GROUP, OUTPUT2_EN_PIN_NUM)
|
#define OUTPUT2_EN_OFF GPIO_ResetBits(OUTPUT2_EN_PIN_GROUP, OUTPUT2_EN_PIN_NUM)
|
|
// RS485¹Ü½Å
|
#define RS485_SYNC_PIN_NUM GPIO_Pin_2
|
#define RS485_SYNC_PIN_GROUP GPIOE
|
#define RS485_SYNC_READ GPIO_ReadInputDataBit(RS485_SYNC_PIN_GROUP, RS485_SYNC_PIN_NUM)
|
|
#define LOW_PWR_INT_PIN_NUM GPIO_Pin_2
|
#define LOW_PWR_INT_PIN_GROUP GPIOB
|
#define LOW_PWR_READ GPIO_ReadInputDataBit(LOW_PWR_INT_PIN_GROUP, LOW_PWR_INT_PIN_NUM)
|
|
#define UNDER_PWR_INT_PIN_NUM GPIO_Pin_3
|
#define UNDER_PWR_INT_PIN_GROUP GPIOB
|
#define UNDER_PWR_READ GPIO_ReadInputDataBit(UNDER_PWR_INT_PIN_GROUP, UNDER_PWR_INT_PIN_NUM)
|
|
#define ALARM_LINE_PIN_NUM GPIO_Pin_13
|
#define ALARM_LINE_PIN_GROUP GPIOA
|
#define ALARM_LINE_READ GPIO_ReadInputDataBit(ALARM_LINE_PIN_GROUP, ALARM_LINE_PIN_NUM)
|
|
#define LITH_BAT_LOW_PWR_PIN_NUM GPIO_Pin_0
|
#define LITH_BAT_LOW_PWR_PIN_GROUP GPIOD
|
#define LITH_BAT_LOW_PWR_PIN_READ GPIO_ReadInputDataBit(LITH_BAT_LOW_PWR_PIN_GROUP, LITH_BAT_LOW_PWR_PIN_NUM)
|
|
#define ALKA_BAT_M_PIN_NUM GPIO_Pin_0
|
#define ALKA_BAT_M_PIN_GROUP GPIOH
|
|
#define LITH_BAT_M_PIN_NUM GPIO_Pin_6
|
#define LITH_BAT_M_PIN_GROUP GPIOF
|
|
#define ALKA_TEST_EN_PIN_NUM GPIO_Pin_4
|
#define ALKA_TEST_EN_PIN_GROUP GPIOF
|
#define ALKA_TEST_ON GPIO_SetBits(ALKA_TEST_EN_PIN_GROUP, ALKA_TEST_EN_PIN_NUM)
|
#define ALKA_TEST_OFF GPIO_ResetBits(ALKA_TEST_EN_PIN_GROUP, ALKA_TEST_EN_PIN_NUM)
|
|
#define LITH_TEST_EN_PIN_NUM GPIO_Pin_3
|
#define LITH_TEST_EN_PIN_GROUP GPIOF
|
#define LITH_TEST_ON GPIO_SetBits(LITH_TEST_EN_PIN_GROUP, LITH_TEST_EN_PIN_NUM)
|
#define LITH_TEST_OFF GPIO_ResetBits(LITH_TEST_EN_PIN_GROUP, LITH_TEST_EN_PIN_NUM)
|
|
#define HWID0_PIN_NUM GPIO_Pin_5
|
#define HWID0_PIN_GROUP GPIOF
|
#define HWID0_READ GPIO_ReadInputDataBit(HWID0_PIN_GROUP, HWID0_PIN_NUM)
|
#define HWID0_H GPIO_SetBits(HWID0_PIN_GROUP, HWID0_PIN_NUM)
|
#define HWID0_L GPIO_ResetBits(HWID0_PIN_GROUP, HWID0_PIN_NUM)
|
|
#define EX_PWR_EN_PIN_NUM GPIO_Pin_3
|
#define EX_PWR_EN_PIN_GROUP GPIOG
|
#define EX_PWR_EN_H GPIO_SetBits(EX_PWR_EN_PIN_GROUP, EX_PWR_EN_PIN_NUM)
|
#define EX_PWR_EN_L GPIO_ResetBits(EX_PWR_EN_PIN_GROUP, EX_PWR_EN_PIN_NUM)
|
#define EX_PWR_EN_READ GPIO_ReadInputDataBit(EX_PWR_EN_PIN_GROUP, EX_PWR_EN_PIN_NUM)
|
|
#define LIMIT_TRIG_PIN_NUM GPIO_Pin_13
|
#define LIMIT_TRIG_PIN_GROUP GPIOC
|
#define LIMIT_TRIG_READ GPIO_ReadInputDataBit(LIMIT_TRIG_PIN_GROUP, LIMIT_TRIG_PIN_NUM)
|
|
// °´¼ü¹Ü½Å
|
#define KEY1_PIN_NUM GPIO_Pin_9
|
#define KEY1_PIN_GROUP GPIOE
|
|
#define KEY2_PIN_NUM GPIO_Pin_15
|
#define KEY2_PIN_GROUP GPIOF
|
|
#define KEY3_PIN_NUM GPIO_Pin_14
|
#define KEY3_PIN_GROUP GPIOF
|
|
#define KEY1_PRESS GPIO_ReadInputDataBit(KEY1_PIN_GROUP, KEY1_PIN_NUM)
|
#define KEY2_PRESS GPIO_ReadInputDataBit(KEY2_PIN_GROUP, KEY2_PIN_NUM)
|
#define KEY3_PRESS GPIO_ReadInputDataBit(KEY3_PIN_GROUP, KEY3_PIN_NUM)
|
|
// RS485¹Ü½Å
|
#define RS485_RE_EN_PIN_NUM GPIO_Pin_14
|
#define RS485_RE_EN_PIN_GROUP GPIOA
|
#define RS485_RE_H GPIO_SetBits(RS485_RE_EN_PIN_GROUP, RS485_RE_EN_PIN_NUM)
|
#define RS485_RE_L GPIO_ResetBits(RS485_RE_EN_PIN_GROUP, RS485_RE_EN_PIN_NUM)
|
|
#define RS485_TXD_EN_PIN_NUM GPIO_Pin_1
|
#define RS485_TXD_EN_PIN_GROUP GPIOB
|
#define RS485_RXD_EN_PIN_NUM GPIO_Pin_0
|
#define RS485_RXD_EN_PIN_GROUP GPIOB
|
|
#define RS485_POWER_EN_PIN_NUM GPIO_Pin_15
|
#define RS485_POWER_EN_PIN_GROUP GPIOA
|
#define RS485_POWER_ON GPIO_SetBits(RS485_POWER_EN_PIN_GROUP, RS485_POWER_EN_PIN_NUM)
|
#define RS485_POWER_OFF GPIO_ResetBits(RS485_POWER_EN_PIN_GROUP, RS485_POWER_EN_PIN_NUM)
|
|
// RS232¹Ü½Å
|
#define GPRSRS232_TXD_EN_PIN_NUM GPIO_Pin_4
|
#define GPRSRS232_TXD_EN_PIN_GROUP GPIOE
|
#define GPRSRS232_RXD_EN_PIN_NUM GPIO_Pin_3
|
#define GPRSRS232_RXD_EN_PIN_GROUP GPIOE
|
|
// ÉÏλ»ú485Òý½Å
|
#define UTRXD_RE_EN_PIN_NUM GPIO_Pin_10
|
#define UTXRD_RE_EN_PIN_GROUP GPIOA
|
#define UTRXD_RE_H GPIO_SetBits(UTXRD_RE_EN_PIN_GROUP, UTRXD_RE_EN_PIN_NUM)
|
#define UTRXD_RE_L GPIO_ResetBits(UTXRD_RE_EN_PIN_GROUP, UTRXD_RE_EN_PIN_NUM)
|
|
#define UTXD_EN_PIN_NUM GPIO_Pin_9
|
#define UTXD_EN_PIN_GROUP GPIOA
|
#define URXD_EN_PIN_NUM GPIO_Pin_8
|
#define URXD_EN_PIN_GROUP GPIOA
|
|
// motor
|
#define Motor_A_PIN_NUM GPIO_Pin_8
|
#define Motor_A_PIN_GROUP GPIOB
|
#define Motor_A_EN_H GPIO_SetBits(Motor_A_PIN_GROUP, Motor_A_PIN_NUM)
|
#define Motor_A_EN_L GPIO_ResetBits(Motor_A_PIN_GROUP, Motor_A_PIN_NUM)
|
|
#define Motor_B_PIN_NUM GPIO_Pin_9
|
#define Motor_B_PIN_GROUP GPIOB
|
#define Motor_B_EN_H GPIO_SetBits(Motor_B_PIN_GROUP, Motor_B_PIN_NUM)
|
#define Motor_B_EN_L GPIO_ResetBits(Motor_B_PIN_GROUP, Motor_B_PIN_NUM)
|
|
#define Motor_OP_PIN_NUM GPIO_Pin_6
|
#define Motor_OP_PIN_GROUP GPIOB
|
#define Motor_OP_PIN_READ GPIO_ReadInputDataBit(Motor_OP_PIN_GROUP, Motor_OP_PIN_NUM)
|
|
#define Motor_CL_PIN_NUM GPIO_Pin_7
|
#define Motor_CL_PIN_GROUP GPIOB
|
#define Motor_CL_PIN_READ GPIO_ReadInputDataBit(Motor_CL_PIN_GROUP, Motor_CL_PIN_NUM)
|
|
// rtc
|
#define RTC_SDA_PIN_NUM GPIO_Pin_3
|
#define RTC_SDA_PIN_GROUP GPIOD
|
#define RTC_CLK_PIN_NUM GPIO_Pin_2
|
#define RTC_CLK_PIN_GROUP GPIOD
|
|
#define RTC_INT_PIN_NUM GPIO_Pin_6
|
#define RTC_INT_PIN_GROUP GPIOD
|
|
// LF PULSE
|
#define LOWPLUSE_PIN_NUM GPIO_Pin_3
|
#define LOWPLUSE_PIN_GROUP GPIOH
|
#define PULSE_LINE_READ GPIOH_ReadInputDataBit(LOWPLUSE_PIN_NUM)
|
|
// GPRS
|
#define GPIO_GPRS_POWER_PIN_NUM GPIO_Pin_7 //**£¨+3V8_PWR_ON/OFF£©
|
#define GPIO_GPRS_POWER_PIN_GROUP GPIOE
|
#define GPRS_POWER_ON GPIO_SetBits(GPIO_GPRS_POWER_PIN_GROUP, GPIO_GPRS_POWER_PIN_NUM)
|
#define GPRS_POWER_OFF GPIO_ResetBits(GPIO_GPRS_POWER_PIN_GROUP, GPIO_GPRS_POWER_PIN_NUM)
|
|
#define GPRS_PWR_EN_PIN_NUM GPIO_Pin_6 //**£¨GPRS_PWR_EN£©
|
#define GPRS_PWR_EN_PIN_GROUP GPIOE
|
#define GPRS_POWER_EN_H GPIO_SetBits(GPRS_PWR_EN_PIN_GROUP, GPRS_PWR_EN_PIN_NUM)
|
#define GPRS_POWER_EN_L GPIO_ResetBits(GPRS_PWR_EN_PIN_GROUP, GPRS_PWR_EN_PIN_NUM)
|
|
// ¿ª¸Ç
|
#define UNCAP_INT_PIN_NUM GPIO_Pin_1
|
#define UNCAP_INT_PIN_GROUP GPIOD
|
#define UNCAP_INT_READ GPIO_ReadInputDataBit(UNCAP_INT_PIN_GROUP, UNCAP_INT_PIN_NUM)
|
#define UNCAP_INT_L GPIO_ResetBits(UNCAP_INT_PIN_GROUP, UNCAP_INT_PIN_NUM)
|
|
// force open
|
#define FORCE_OPEN_INT_PIN_NUM GPIO_Pin_12
|
#define FORCE_OPEN_INT_PIN_GROUP GPIOC
|
#define FORCE_OPEN_INT_READ GPIO_ReadInputDataBit(FORCE_OPEN_INT_PIN_GROUP, FORCE_OPEN_INT_PIN_NUM)
|
|
// ½èµç
|
#define BORROW_PWR_EN_PIN_NUM GPIO_Pin_2
|
#define BORROW_PWR_EN_PIN_NUM_GROUP GPIOG
|
#define BORROW_PWR_EN_PIN_H GPIO_SetBits(BORROW_PWR_EN_PIN_NUM_GROUP, BORROW_PWR_EN_PIN_NUM)
|
#define BORROW_PWR_EN_NUM_L GPIO_ResetBits(BORROW_PWR_EN_PIN_NUM_GROUP, BORROW_PWR_EN_PIN_NUM)
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
void BAT_io_dec_init(void);
|
void BAT_ADC_IO_init(void);
|
void POWER_EX_GPIO_Init(void);
|
void OUTPUT_EN_GPIO_Init(void);
|
void Alka_INT_init(void);
|
void Fram_Flash_GPIO_Init(void);
|
|
void LCD_Power_Init(void);
|
void LCD_GPIO_Init(void);
|
void LCD_GPIO_sleep_mode(void);
|
void GPIO_C_7_INIT_OUT0(void);
|
void GPIO_C_7_INIT(void);
|
void GPIO_IPD_Init(void);
|
|
void Key_GPIO_Init(void);
|
void RS485_GPIO_Init(void);
|
void RS485_GPIO_sleep_mode(void);
|
|
void GPRS_RS232_GPIO_Init(void);
|
void Upper_RS232_GPIO_Init(void);
|
void GPRS_RS232_GPIO_sleep_mode(void);
|
void Upper_RS232_GPIO_sleep_mode(void);
|
|
void LCD_Power_lowpower_init(void);
|
void Alarm_IO_init(void);
|
void RTC_GPIO_Init(void);
|
void RTCINT_GPIO_Init(void);
|
void Low_Pluse_GPIO_Init(void);
|
void Low_Pluse_ADC_GPIO_Init(void);
|
void Low_Pluse_GPIO_sleep_Init(void);
|
void SWITCH_GPIO_Init(void);
|
void HWID_GPIO_Init(void);
|
void GPRS_POWER_Init(void);
|
void POWER_3V8_Init(void);
|
void All_NO_USE_GPIO_sleep_mode(void);
|
void Force_Open_GPIO_Init(void);
|
void Motor_GPIO_Init(void);
|
void Motor_GPIO_Init_sleep_mode(void);
|
|
void UNCAP_GPIO_Init(void);
|
|
void LIMIT_TRIG_config(void);
|
void EX_PWR_EN_GPIO_Init(void);
|
void BORROW_PWR_EN_Init(void);
|
|
#endif
|