#ifndef __RS232_H
|
#define __RS232_H
|
|
#include "define_all.h"
|
|
// #include "upper_computer.h"
|
#define RX232_LENGTH 250
|
|
#define UARTRS232NUM USART3
|
#define UARTRS232IRQ USART3_IRQn
|
|
#define DMA_RS232_TX_Channel DMA1_Stream3
|
#define DMA_RS232_TC DMA_FLAG_TCIF3
|
#define DMA_RS232_RX_Channel DMA1_Stream1
|
#define DMA_RS232_RC DMA_FLAG_TCIF1
|
|
#define APB232_GPIO_GROUP RCC_APB2Periph_GPIOB
|
|
#define UARTUTRNUM USART1
|
#define UARTUTRIRQ USART1_IRQn
|
#define APBUTR_GPIO_GROUP RCC_APB2Periph_GPIOA
|
|
#define DMA_UART1_RX_Channel DMA2_Stream2
|
|
// typedef struct rx_rs232t
|
//{
|
// u8 RS232_RX_TEMP_BUF[RX232_LENGTH];
|
// u16 rec_buffer_cnt;
|
|
//}RX_RS232_T;
|
|
void GPRS_Usart_Init(uint32 system_BaudRate);
|
void GPRS_UartSendCode(char *code);
|
void gprsuart_sendbyte(uint8_t Byte);
|
|
void UTR_Uart_Init(uint32 system_BaudRate);
|
void UTR_sendbyte(unsigned char dat);
|
|
void UTR_Send_Data(uint8 *buf, uint16 len);
|
void UartDebugFun(char *str);
|
|
extern unsigned char UTR_rec_buff[RX232_LENGTH];
|
extern unsigned char UTR_rec_cnt;
|
extern unsigned char UTR_rec_finish_flag;
|
// extern RX_RS232_T rx_data_s_g;
|
#endif
|