You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
2.4 KiB
42 lines
2.4 KiB
//#############################################################################################################################################################################################################
|
|
#ifndef _INC_USART_COM_H_
|
|
#define _INC_USART_COM_H_
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
//#include "stm32f4xx.h"
|
|
#include <inttypes.h>
|
|
////#include <string.h>
|
|
#include "System.h"
|
|
//#include "CUST_GPIO.h"
|
|
//#include "TIMERS.h"
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#define F_CPU 16000000UL
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#ifdef _CPU_ATMEGA328PB_ //Maybe move this
|
|
#include "m328pb_defs.h"
|
|
#endif // #ifdef _CPU_ATMEGA328PB_
|
|
#ifdef _CPU_ATMEGA2560_
|
|
#include "m2560_defs.h"
|
|
#endif // _CPU_ATMEGA2560_
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
typedef struct {
|
|
//USART_TypeDef *USART;
|
|
//DMA_Stream_TypeDef *DMATX;
|
|
|
|
volatile uint16_t TxBufCount;
|
|
//uint16_t TxPacketSize;
|
|
uint16_t TxSendedCount;
|
|
volatile uint16_t RxBufCount;
|
|
|
|
uint16_t InterFrameTimeoutTicks;
|
|
|
|
volatile uint8_t TxComplete;
|
|
volatile uint8_t RxError;
|
|
volatile uint8_t RxComplete;
|
|
|
|
} USART_HANDLER_TYPE;
|
|
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#endif //_INC_USART_COM_H_
|
|
//#############################################################################################################################################################################################################
|