|
/******************************************************************************
|
* Copyright (C) 2014-2015 HangZhou SiZhu Co.,LTD.
|
*
|
*-----------------------------------------------------------------------------
|
* File: RS232.h
|
* Description: head file of RS232.c used to receive and send data
|
* Author: Lishoujian (867693272@qq.com)
|
* Date: Jan 8, 2015
|
*****************************************************************************/
|
|
/* ----------------------- Platform includes --------------------------------*/
|
|
#ifndef __RS232_H
|
#define __RS232_H
|
#include "sys.h"
|
#include "stm32f10x_dma.h"
|
|
void GPRS_RS232_Usart_Init(uint32 system_BaudRate);
|
//void UartSendCode(unsigned char *code) ;
|
void gprsuart_sendbyte(unsigned char dat);
|
#define GPRSRS232_TXD_EN_PIN_NUM GPIO_Pin_9
|
#define GPRSRS232_TXD_EN_PIN_GROUP GPIOA
|
#define GPRSRS232_RXD_EN_PIN_NUM GPIO_Pin_10
|
#define GPRSRS232_RXD_EN_PIN_GROUP GPIOA
|
#define UARTRS232NUM USART1
|
#define UARTRS232IRQ USART1_IRQn
|
|
#define DMA_RS232_TX_Channel DMA1_Channel4
|
#define DMA_RS232_TC DMA1_FLAG_TC4
|
#define DMA_RS232_RX_Channel DMA1_Channel5
|
#define DMA_RS232_RC DMA1_FLAG_TC5
|
|
#define GPRS_DATA_REC_OK 1
|
#define GPRS_DATA_REC_TOO_MUCH_ERROR 2
|
|
#define APB232_GPIO_GROUP RCC_APB2Periph_GPIOA
|
|
|
#define RX232_LENGTH 200
|
typedef struct rx_rs232t
|
{
|
u8 RS232_RX_TEMP_BUF[RX232_LENGTH];
|
u8 rx_data_buf[RX232_LENGTH];
|
u16 rec_buffer_cnt;
|
|
}RX_RS232_T;
|
|
extern RX_RS232_T rx_data_s_g;
|
#endif
|