B15F
Board 15 Famulus Edition
Public Member Functions | Static Public Attributes | List of all members
USART Class Reference

Public Member Functions

void openDevice (std::string device)
 
void closeDevice (void)
 
void clearInputBuffer (void)
 
void clearOutputBuffer (void)
 
void flushOutputBuffer (void)
 
void printStatistics (void)
 
void writeByte (uint8_t b)
 
void writeInt (uint16_t d)
 
uint8_t readByte (void)
 
uint16_t readInt (void)
 
int read_timeout (uint8_t *buffer, uint16_t offset, uint8_t len, uint32_t timeout)
 
int write_timeout (uint8_t *buffer, uint16_t offset, uint8_t len, uint32_t timeout)
 
void writeBlock (uint8_t *buffer, uint16_t offset, uint8_t len)
 
bool readBlock (uint8_t *buffer, uint16_t offset)
 
uint32_t getBaudrate (void)
 
uint8_t getTimeout (void)
 
void setBaudrate (uint32_t baudrate)
 
void setTimeout (uint8_t timeout)
 

Static Public Attributes

constexpr static uint8_t CRC7_POLY = 0x91
 
constexpr static uint8_t MAX_BLOCK_SIZE = 64
 
constexpr static uint8_t BLOCK_END = 0x80
 

Detailed Description

Definition at line 16 of file usart.h.

Member Function Documentation

◆ clearInputBuffer()

void USART::clearInputBuffer ( void  )

Verwirft Daten, die bereits im Puffer liegen, aber noch nicht gelesen wurden

Exceptions
USARTException

Definition at line 39 of file usart.cpp.

◆ clearOutputBuffer()

void USART::clearOutputBuffer ( void  )

Verwirft Daten, die bereits im Puffer liegen, aber noch nicht gesendet wurden

Exceptions
USARTException

Definition at line 46 of file usart.cpp.

◆ closeDevice()

void USART::closeDevice ( void  )

Schließt die USART Schnittstelle

Exceptions
USARTException

Definition at line 32 of file usart.cpp.

◆ flushOutputBuffer()

void USART::flushOutputBuffer ( void  )

Schreibt Daten, die bereits im Puffer liegen, aber noch nicht gesendet wurden

Exceptions
USARTException

Definition at line 53 of file usart.cpp.

◆ getBaudrate()

uint32_t USART::getBaudrate ( void  )

Liefert die eingestellte Baudrate Änderungen werden erst nach einem open() wirksam

Definition at line 306 of file usart.cpp.

◆ getTimeout()

uint8_t USART::getTimeout ( void  )

Liefert den eingestellten Timeout (in Dezisekunden) Änderungen werden erst nach einem open() wirksam

Definition at line 311 of file usart.cpp.

◆ openDevice()

void USART::openDevice ( std::string  device)

Öffnet die USART Schnittstelle

Parameters
deviceLinux-Gerätepfad
Exceptions
USARTException

Definition at line 3 of file usart.cpp.

◆ printStatistics()

void USART::printStatistics ( void  )

Gibt Anzahl an erfolgreichen und fehlgeschlagenen Block-Übertragungen an

Definition at line 60 of file usart.cpp.

◆ readByte()

uint8_t USART::readByte ( void  )

Empfängt ein Byte über die USART Schnittstelle

Exceptions
USARTException

Definition at line 210 of file usart.cpp.

◆ readInt()

uint16_t USART::readInt ( void  )

Empfängt ein Integer über die USART Schnittstelle

Exceptions
USARTException

Definition at line 229 of file usart.cpp.

◆ setBaudrate()

void USART::setBaudrate ( uint32_t  baudrate)

Setzt die Baudrate Änderungen werden erst nach einem open() wirksam

Definition at line 316 of file usart.cpp.

◆ setTimeout()

void USART::setTimeout ( uint8_t  timeout)

Setzt den Timeout (in Dezisekunden) Änderungen werden erst nach einem open() wirksam

Definition at line 321 of file usart.cpp.

◆ writeByte()

void USART::writeByte ( uint8_t  b)

Sendet ein Byte über die USART Schnittstelle

Parameters
bdas zu sendende Byte
Exceptions
USARTException

Definition at line 67 of file usart.cpp.

◆ writeInt()

void USART::writeInt ( uint16_t  d)

Sendet ein Integer über die USART Schnittstelle

Parameters
bdas zu sendende Byte
Exceptions
USARTException

Definition at line 81 of file usart.cpp.


The documentation for this class was generated from the following files: