forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

周巍
2024-04-11 91ef77c00ed797b1048c5187f416e351e646a009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
/******************************************************************************
 * 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