Files
pvs/cvicenie_5/Uart.h
2025-11-13 14:42:47 +01:00

29 lines
452 B
C++

#ifndef __UART_H
#define __UART_H
#include "mbed.h"
// class Led
class Uart
{
private:
void rxInterrupt();
public:
//! Constructor
Uart(PinName rx, PinName tx, int baud);
//! Destructor
~Uart();
bool isCharReceived();
char getReceivedChar();
void writeChar(char c);
UnbufferedSerial* getSerial();
private:
UnbufferedSerial serial;
volatile char received_character;
volatile bool received;
};
#endif