/*
 * UartBase.h
 *
 *  Created on: Feb 4, 2020
 *      Author: abody
 */
#ifndef F4LL_CPP_UARTBASE_H_
#define F4LL_CPP_UARTBASE_H_

#include <platform/usart_ll.h>
#include <f4ll_cpp/dmahelper.h>

namespace f4ll_cpp {

class UartBase
{
public:
	UartBase() = delete;
protected:
	UartBase(USART_TypeDef *uart, DMA_TypeDef *dma, uint32_t stream_rx, uint32_t stream_tx);
	void SetupTransmit(void *buffer, uint16_t length);
	void SetupReceive(void *buffer, uint16_t length);

	USART_TypeDef *m_uart;
	DmaHelper m_rxDma;
	DmaHelper m_txDma;
};

}	// f4ll_cpp

#endif /* F4LL_CPP_UARTBASE_H_ */
