39 lines
949 B
C
39 lines
949 B
C
#ifndef __CAT_H__
|
|
#define __CAT_H__
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#define GPIO_RCC_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE() //使能端口A时钟
|
|
|
|
#define CAT_POW_Pin GPIO_PIN_4
|
|
#define CAT_POW_GPIO_Port GPIOA
|
|
|
|
#define CAT_RST_Pin GPIO_PIN_5
|
|
#define CAT_RST_GPIO_Port GPIOA
|
|
|
|
#define CAT_RUN_Pin GPIO_PIN_6
|
|
#define CAT_RUN_GPIO_Port GPIOA
|
|
|
|
#define CAT_NET_Pin GPIO_PIN_7
|
|
#define CAT_NET_GPIO_Port GPIOA
|
|
|
|
#define POWER_KEY(x) HAL_GPIO_WritePin(CAT_POW_GPIO_Port, CAT_POW_Pin, (GPIO_PinState)x) //PA15控制电源IO
|
|
#define POWER_STA HAL_GPIO_ReadPin(CAT_RUN_GPIO_Port, CAT_RUN_Pin) //读取电平状态,可以判断开关机状态
|
|
#define NET_STA HAL_GPIO_ReadPin(CAT_NET_GPIO_Port, CAT_NET_Pin) //读取电平状态,可以判断注册网络状态
|
|
|
|
#define CAT1_printf u3_printf
|
|
|
|
|
|
void catGpioInit(void);
|
|
void catReset(void);
|
|
|
|
void u3PassiveEvent(uint8_t *, uint16_t);
|
|
|
|
void activeEvents(void);
|
|
|
|
|
|
#endif /*__DMA_H__*/
|
|
|
|
|