41 lines
984 B
C
41 lines
984 B
C
#ifndef _usart4_H
|
|
#define _usart4_H
|
|
#include "bsp.h"
|
|
#include "general_type.h"
|
|
#include "stm32l1xx_usart.h"
|
|
#include <math.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
#if defined ( __CC_ARM )
|
|
#pragma anon_unions
|
|
#endif
|
|
|
|
#define USART4_MAX_RECV_LEN 1 //最大接收缓存字节数
|
|
#define USART4_MAX_SEND_LEN 512 //最大发送缓存字节数
|
|
void USART4_Configuration(u32 baund);
|
|
void Usart4_ReceiveBuff_Clear(void);
|
|
void u4_printf(char* fmt,...);
|
|
u8 USART4_Recieve_Ide(void);
|
|
void timer4_init(void);
|
|
void TIM4_Set(unsigned char sta);
|
|
typedef struct STRUCT_USART4_Fram //数据帧结构体
|
|
{
|
|
char Usart4_RX_BUF[USART4_MAX_RECV_LEN];
|
|
union
|
|
{
|
|
__IO u16 InfAll;
|
|
struct
|
|
{
|
|
__IO u16 FramLength :15; // 14:0
|
|
__IO u16 FramFinishFlag :1; // 15
|
|
}InfBit;
|
|
};
|
|
|
|
}Usart4_Fram_Record_Struct;
|
|
|
|
//extern Usart4_Fram_Record_Struct Usart4_Fram_Record_Structs;
|
|
|
|
#endif
|
|
|