--some updates

This commit is contained in:
Mysteo
2023-07-14 19:21:22 +03:00
parent 5c26bb8dff
commit 5f7dcde4af
21 changed files with 22075 additions and 406 deletions

39
Core/Inc/uart_bridge.hpp Normal file
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;
static UART_HandleTypeDef uart1Handle, uart2Handle;
public:
UART_HandleTypeDef* getHuart1() ;
UART_HandleTypeDef* getHuart2() ;
protected:
USART_TypeDef *uart1, *uart2;
};
#endif //READER_MAIN_PROG_UART_BRIDGE_HPP