12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef EC800_H
- #define EC800_H
- #include "gd32f10x.h"
- #define EC800M_PER_PIN GPIO_PIN_1
- #define EC800M_PER_GPIO_PORT GPIOC
- #define EC800M_PER_GPIO_CLK RCU_GPIOC
- #define EC800M_RST_PIN GPIO_PIN_8
- #define EC800M_RST_GPIO_PORT GPIOB
- #define EC800M_RST_GPIO_CLK RCU_GPIOB
- #define COMn 3U
- #define COM_EC800 USART0 //USART1 EC800
- #define COM_EC800_CLK RCU_USART0
- #define COM_EC800_TX_PIN GPIO_PIN_9
- #define COM_EC800_RX_PIN GPIO_PIN_10
- #define COM_EC800_GPIO_PORT GPIOA
- #define COM_EC800_GPIO_CLK RCU_GPIOA
- #define COM_EC800_IT_HANDLER USART0_IRQn
- #define COM_EC800_BAUDRATE 115200
- #define UART0_RX_LEN (512)
-
- extern uint8_t UART0_RX_BUF[UART0_RX_LEN];
- extern uint8_t UART0_RX_STAT;
- void gd_com_init();
- void dma_config(void);
- void gd_EC800M_pin_init(void);
- void gd_pull_EC800M_pwr_up(void);
- void gd_pull_EC800M_pwr_down(void);
- void gd_pull_EC800M_rst_up(void);
- void gd_pull_EC800M_rst_down(void);
- void EC800MPwoerOn(void);
- void EC800MWaitReady();
- void EC800MSetPDP();
- void dma_config_change(char *dmaBuffer,uint32_t bufferSize);
- int read_bin_txt();
- #endif
|