2025-02-26 09:59:15 +00:00
|
|
|
|
#ifndef HD_GPIO_H_
|
|
|
|
|
#define HD_GPIO_H_
|
|
|
|
|
|
|
|
|
|
#include "ch32v30x.h"
|
|
|
|
|
|
|
|
|
|
/* <20><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define J1_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J1_PwrCtrl_GPIO_PIN GPIO_Pin_7
|
|
|
|
|
#define J2_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J2_PwrCtrl_GPIO_PIN GPIO_Pin_8
|
|
|
|
|
#define J3_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J3_PwrCtrl_GPIO_PIN GPIO_Pin_9
|
|
|
|
|
#define J4_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J4_PwrCtrl_GPIO_PIN GPIO_Pin_10
|
|
|
|
|
#define J5_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J5_PwrCtrl_GPIO_PIN GPIO_Pin_11
|
|
|
|
|
#define J6_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J6_PwrCtrl_GPIO_PIN GPIO_Pin_12
|
|
|
|
|
#define J7_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J7_PwrCtrl_GPIO_PIN GPIO_Pin_13
|
|
|
|
|
#define J8_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J8_PwrCtrl_GPIO_PIN GPIO_Pin_14
|
|
|
|
|
#define J9_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define J9_PwrCtrl_GPIO_PIN GPIO_Pin_15
|
|
|
|
|
|
|
|
|
|
/* <20><>ģ<D7BF>鹩<EFBFBD><E9B9A9>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define GPIO_PwrCtrl_GPIO_PROT GPIOE
|
|
|
|
|
#define GPIO_PwrCtrl_GPIO_PIN GPIO_Pin_3
|
|
|
|
|
|
|
|
|
|
/* <20><>ģ<D7BF><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> */
|
|
|
|
|
#define GPIO_PwrKey_GPIO_PROT GPIOE
|
|
|
|
|
#define GPIO_PwrKey_GPIO_PIN GPIO_Pin_2
|
|
|
|
|
|
|
|
|
|
/* ι<><CEB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define WDI_GPIO_PROT GPIOC
|
|
|
|
|
#define WDI_GPIO_PIN GPIO_Pin_13
|
|
|
|
|
|
2025-03-12 07:00:12 +00:00
|
|
|
|
/* LED<45><44><EFBFBD><EFBFBD> */
|
2025-04-02 10:02:25 +00:00
|
|
|
|
#define LED_GPIO_PROT GPIOC
|
|
|
|
|
#define LED_GPIO_PIN GPIO_Pin_9
|
|
|
|
|
|
|
|
|
|
/* 485<38><35>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define J0De_GPIO_PROT GPIOC
|
|
|
|
|
#define J0De_GPIO_PIN GPIO_Pin_8
|
|
|
|
|
#define J1De_GPIO_PROT GPIOC
|
|
|
|
|
#define J1De_GPIO_PIN GPIO_Pin_8
|
|
|
|
|
#define J2De_GPIO_PROT GPIOC
|
|
|
|
|
#define J2De_GPIO_PIN GPIO_Pin_7
|
|
|
|
|
#define J3De_GPIO_PROT GPIOC
|
|
|
|
|
#define J3De_GPIO_PIN GPIO_Pin_7
|
|
|
|
|
#define J4De_GPIO_PROT GPIOC
|
|
|
|
|
#define J4De_GPIO_PIN GPIO_Pin_6
|
|
|
|
|
#define J5De_GPIO_PROT GPIOC
|
|
|
|
|
#define J5De_GPIO_PIN GPIO_Pin_6
|
|
|
|
|
#define J6De_GPIO_PROT GPIOD
|
|
|
|
|
#define J6De_GPIO_PIN GPIO_Pin_15
|
|
|
|
|
#define J7De_GPIO_PROT GPIOD
|
|
|
|
|
#define J7De_GPIO_PIN GPIO_Pin_15
|
|
|
|
|
#define J8De_GPIO_PROT GPIOD
|
|
|
|
|
#define J8De_GPIO_PIN GPIO_Pin_14
|
|
|
|
|
#define J9De_GPIO_PROT GPIOD
|
|
|
|
|
#define J9De_GPIO_PIN GPIO_Pin_13
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD>ƴ<EFBFBD>mcu<63><75>λ */
|
|
|
|
|
#define ctrlSlave_GPIO_PROT GPIOD
|
|
|
|
|
#define ctrlSlave_GPIO_PIN GPIO_Pin_0
|
|
|
|
|
|
2025-03-12 07:00:12 +00:00
|
|
|
|
|
2025-02-26 09:59:15 +00:00
|
|
|
|
#define GPIOTypeDef GPIO_TypeDef
|
|
|
|
|
#define GPIOPin uint16_t
|
|
|
|
|
|
|
|
|
|
/* Bit_SET and Bit_RESET enumeration */
|
|
|
|
|
typedef enum {
|
|
|
|
|
GPIO_RESET = 0,
|
|
|
|
|
GPIO_SET
|
|
|
|
|
}BitOperation;
|
|
|
|
|
|
2025-04-02 10:02:25 +00:00
|
|
|
|
#define write GPIO_SET
|
|
|
|
|
#define read GPIO_RESET
|
2025-02-26 09:59:15 +00:00
|
|
|
|
|
2025-04-02 10:02:25 +00:00
|
|
|
|
uint8_t mcu_GPIO_Init(void);
|
|
|
|
|
|
|
|
|
|
void PwrCtrl_GPIO_Init(void);
|
|
|
|
|
void Android_GPIO_Init(void);
|
|
|
|
|
void WDI_GPIO_Init(void);
|
|
|
|
|
void LED_GPIO_Init(void);
|
|
|
|
|
void Host485De_GPIO_Init(void);
|
|
|
|
|
void Slave485De_GPIO_Init(void);
|
|
|
|
|
void ctrlSlave_GPIO_Init(void);
|
2025-02-26 09:59:15 +00:00
|
|
|
|
|
|
|
|
|
void HD_GPIO_Write(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin, BitOperation BitVal);
|
|
|
|
|
uint8_t HD_InputGPIO_Read(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin);
|
|
|
|
|
uint8_t HD_OutputGPIO_Read(GPIOTypeDef *GPIOx, GPIOPin GPIO_Pin);
|
|
|
|
|
|
|
|
|
|
#endif
|