bsp_usart.h
2.24 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
*********************************************************************************************************
*
* 模块名称 : 串口驱动模块
* 文件名称 : bsp_usart.h
* 版 本 : V2.0
* 说 明 : 头文件
*
* Copyright (C), 2010-2011, 安富莱电子 www.armfly.com
*
*********************************************************************************************************
*/
#ifndef __BSP_USART_H
#define __BSP_USART_H
#include "bsp.h"
#define COM1 1
#define COM2 2
#define COM3 3
#define COM4 4
#define COM5 5
#define COM6 6
#define CAN 7
//队列数据缓存区大小
#define UART_BUF_LEN 0x3ff
#define BJF 1
#define TEK 0
extern short LandMarkID;
typedef struct
{
unsigned char RxBuf[UART_BUF_LEN+1]; //接收队列数据缓存区
unsigned char TxBuf[UART_BUF_LEN+1]; //发送队列数据缓存区
volatile unsigned short RxBuf_In; //接收队列入列位置
volatile unsigned short RxBuf_Out; //接收队列出列位置
volatile unsigned short TxBuf_In; //发送队列入列位置
volatile unsigned short TxBuf_Out; //发送队列出列位置
}UartStruct;
typedef struct
{
float angular_velocity_x;
float angular_velocity_y;
float angular_velocity_z;
float linear_acceleration_x;
float linear_acceleration_y;
float linear_acceleration_z;
float angular_roll;
float angular_pitch;
float angular_yaw;//角度
short angular_x;
short angular_y;
int angular_count;
}Imu_msg;
extern Imu_msg imu_msg;
extern void UartSend(unsigned char UartID,unsigned char *buff,unsigned int length);
extern void Init_LightSensor(void);
extern void uart_init(u32 bound);
extern void Uart_Printf(unsigned char UartID, const char *fmt,...);
extern void SetZigbee_BaudRate_38400(void);
extern void ProcessDataFormUart1(void);
extern void ProcessDataFormUartCard(void);
extern void ProcessDataFormUartSlam(void);
extern void ProcessDataFormUartGoya(void);
extern void ProcessDataFormUartQR(void);
extern void RFID_Process_TEK(unsigned char *buff,unsigned short len,unsigned short userDataLen);
extern void RFID_Process_BJF(unsigned char *buff,unsigned short len,unsigned short userDataLen);
extern unsigned int ReadUart(unsigned char UartID,unsigned char *buff,unsigned int length);
extern void WriteUart(unsigned char UartID,unsigned char *buff,unsigned int length);
#endif