bsp_usart.h 2.16 KB
/*
*********************************************************************************************************
*	                                  
*	模块名称 : 串口驱动模块    
*	文件名称 : 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 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