mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Extends the platforms with additional uart methods.
This commit is contained in:
parent
03f55f5503
commit
f5724c64d1
@ -103,6 +103,11 @@ size_t ArduinoPlatform::readBytesUart(uint8_t *buffer, size_t length)
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ArduinoPlatform::flushUart()
|
||||||
|
{
|
||||||
|
return _knxSerial->flush();
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef KNX_NO_SPI
|
#ifndef KNX_NO_SPI
|
||||||
void ArduinoPlatform::setupSpi()
|
void ArduinoPlatform::setupSpi()
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@ class ArduinoPlatform : public Platform
|
|||||||
virtual size_t writeUart(const uint8_t* buffer, size_t size);
|
virtual size_t writeUart(const uint8_t* buffer, size_t size);
|
||||||
virtual int readUart();
|
virtual int readUart();
|
||||||
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
||||||
|
virtual void flushUart();
|
||||||
|
|
||||||
//spi
|
//spi
|
||||||
#ifndef KNX_NO_SPI
|
#ifndef KNX_NO_SPI
|
||||||
|
@ -57,6 +57,14 @@ void Platform::closeUart()
|
|||||||
void Platform::setupUart()
|
void Platform::setupUart()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
bool Platform::overflowUart()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Platform::flushUart()
|
||||||
|
{}
|
||||||
|
|
||||||
uint32_t Platform::currentIpAddress()
|
uint32_t Platform::currentIpAddress()
|
||||||
{
|
{
|
||||||
return 0x01020304;
|
return 0x01020304;
|
||||||
|
@ -62,6 +62,8 @@ class Platform
|
|||||||
virtual size_t writeUart(const uint8_t* buffer, size_t size);
|
virtual size_t writeUart(const uint8_t* buffer, size_t size);
|
||||||
virtual int readUart();
|
virtual int readUart();
|
||||||
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
virtual size_t readBytesUart(uint8_t* buffer, size_t length);
|
||||||
|
virtual bool overflowUart();
|
||||||
|
virtual void flushUart();
|
||||||
|
|
||||||
// SPI
|
// SPI
|
||||||
virtual void setupSpi();
|
virtual void setupSpi();
|
||||||
|
@ -85,6 +85,11 @@ void RP2040ArduinoPlatform::knxUartPins(pin_size_t rxPin, pin_size_t txPin)
|
|||||||
_txPin = txPin;
|
_txPin = txPin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RP2040ArduinoPlatform::overflowUart() {
|
||||||
|
SerialUART* serial = dynamic_cast<SerialUART*>(_knxSerial);
|
||||||
|
return serial->overflow();
|
||||||
|
}
|
||||||
|
|
||||||
void RP2040ArduinoPlatform::setupUart()
|
void RP2040ArduinoPlatform::setupUart()
|
||||||
{
|
{
|
||||||
SerialUART* serial = dynamic_cast<SerialUART*>(_knxSerial);
|
SerialUART* serial = dynamic_cast<SerialUART*>(_knxSerial);
|
||||||
|
@ -68,6 +68,8 @@ public:
|
|||||||
// uart
|
// uart
|
||||||
void knxUartPins(pin_size_t rxPin, pin_size_t txPin);
|
void knxUartPins(pin_size_t rxPin, pin_size_t txPin);
|
||||||
void setupUart();
|
void setupUart();
|
||||||
|
virtual bool overflowUart();
|
||||||
|
|
||||||
|
|
||||||
// unique serial number
|
// unique serial number
|
||||||
uint32_t uniqueSerialNumber() override;
|
uint32_t uniqueSerialNumber() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user