This commit is contained in:
Mysteo91
2023-07-20 13:55:29 +03:00
parent 96e193a7f2
commit 8c73cea539
331 changed files with 120 additions and 455964 deletions

View File

@@ -0,0 +1,39 @@
//
// Created by Mysteo on 14.07.2023.
//
#ifndef READER_MAIN_PROG_UART_BRIDGE_HPP
#define READER_MAIN_PROG_UART_BRIDGE_HPP
#include "circular_buffer.hpp"
#include "usart.h"
class UartBridge{
public:
UartBridge(bool isOn, USART_TypeDef *uart1, USART_TypeDef *uart2, uint16_t baudRate1,
uint16_t baudRate2);
Circular_Buffer<uint8_t> *uart1Buf;
Circular_Buffer<uint8_t> *uart2Buf;
bool isTurnOn() const;
void setIsTurnOn(bool isTurnOn);
static volatile uint8_t dataFromUart1;
static volatile uint8_t dataFromUart2;
void init(void);
private:
protected:
void uartInit(UART_HandleTypeDef* huart);
bool turnOn;
UART_HandleTypeDef uart1Handle, uart2Handle;
public:
UART_HandleTypeDef* getHuart1() ;
UART_HandleTypeDef* getHuart2() ;
protected:
USART_TypeDef *uart1, *uart2;
};
#endif //READER_MAIN_PROG_UART_BRIDGE_HPP