knx
ETS configurable knx-stack
Platform Class Referenceabstract

#include <platform.h>

Inheritance diagram for Platform:
[legend]

Public Member Functions

virtual ~Platform ()
 
virtual uint32_t currentIpAddress ()
 
virtual uint32_t currentSubnetMask ()
 
virtual uint32_t currentDefaultGateway ()
 
virtual void macAddress (uint8_t *data)
 
virtual uint32_t uniqueSerialNumber ()
 
virtual void restart ()=0
 
virtual void fatalError ()=0
 
virtual void setupMultiCast (uint32_t addr, uint16_t port)
 
virtual void closeMultiCast ()
 
virtual bool sendBytesMultiCast (uint8_t *buffer, uint16_t len)
 
virtual int readBytesMultiCast (uint8_t *buffer, uint16_t maxLen)
 
virtual int readBytesMultiCast (uint8_t *buffer, uint16_t maxLen, uint32_t &src_addr, uint16_t &src_port)
 
virtual bool sendBytesUniCast (uint32_t addr, uint16_t port, uint8_t *buffer, uint16_t len)
 
virtual void setupUart ()
 
virtual void closeUart ()
 
virtual int uartAvailable ()
 
virtual size_t writeUart (const uint8_t data)
 
virtual size_t writeUart (const uint8_t *buffer, size_t size)
 
virtual int readUart ()
 
virtual size_t readBytesUart (uint8_t *buffer, size_t length)
 
virtual bool overflowUart ()
 
virtual void flushUart ()
 
virtual void setupSpi ()
 
virtual void closeSpi ()
 
virtual int readWriteSpi (uint8_t *data, size_t len)
 
virtual uint8_t * getEepromBuffer (uint32_t size)
 
virtual void commitToEeprom ()
 
virtual uint8_t * getNonVolatileMemoryStart ()
 
virtual size_t getNonVolatileMemorySize ()
 
virtual void commitNonVolatileMemory ()
 
virtual uint32_t writeNonVolatileMemory (uint32_t relativeAddress, uint8_t *buffer, size_t size)
 
virtual uint32_t readNonVolatileMemory (uint32_t relativeAddress, uint8_t *buffer, size_t size)
 
virtual uint32_t writeNonVolatileMemory (uint32_t relativeAddress, uint8_t value, size_t repeat)
 
NvMemoryType NonVolatileMemoryType ()
 
void NonVolatileMemoryType (NvMemoryType type)
 
virtual size_t flashPageSize ()
 
void registerFlashCallbacks (FlashCallbackSize callbackFlashSize, FlashCallbackRead callbackFlashRead, FlashCallbackWrite callbackFlashWrite, FlashCallbackCommit callbackFlashCommit)
 
FlashCallbackSize callbackFlashSize ()
 
FlashCallbackRead callbackFlashRead ()
 
FlashCallbackWrite callbackFlashWrite ()
 
FlashCallbackCommit callbackFlashCommit ()
 

Protected Member Functions

virtual size_t flashEraseBlockSize ()
 
virtual uint8_t * userFlashStart ()
 
virtual size_t userFlashSizeEraseBlocks ()
 
virtual void flashErase (uint16_t eraseBlockNum)
 
virtual void flashWritePage (uint16_t pageNumber, uint8_t *data)
 
void loadEraseblockContaining (uint32_t relativeAddress)
 
int32_t getEraseBlockNumberOf (uint32_t relativeAddress)
 
virtual void writeBufferedEraseBlock ()
 
void bufferEraseBlock (int32_t eraseBlockNumber)
 

Protected Attributes

NvMemoryType _memoryType = Eeprom
 
uint8_t * _eraseblockBuffer = nullptr
 
int32_t _bufferedEraseblockNumber = -1
 
bool _bufferedEraseblockDirty = false
 
FlashCallbackSize _callbackFlashSize = nullptr
 
FlashCallbackRead _callbackFlashRead = nullptr
 
FlashCallbackWrite _callbackFlashWrite = nullptr
 
FlashCallbackCommit _callbackFlashCommit = nullptr
 

Detailed Description

Definition at line 31 of file platform.h.

Constructor & Destructor Documentation

◆ ~Platform()

virtual Platform::~Platform ( )
inlinevirtual

Definition at line 34 of file platform.h.

Member Function Documentation

◆ bufferEraseBlock()

void Platform::bufferEraseBlock ( int32_t  eraseBlockNumber)
protected

Definition at line 402 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ callbackFlashCommit()

FlashCallbackCommit Platform::callbackFlashCommit ( )

Definition at line 447 of file platform.cpp.

Here is the caller graph for this function:

◆ callbackFlashRead()

FlashCallbackRead Platform::callbackFlashRead ( )

Definition at line 439 of file platform.cpp.

Here is the caller graph for this function:

◆ callbackFlashSize()

FlashCallbackSize Platform::callbackFlashSize ( )

Definition at line 435 of file platform.cpp.

Here is the caller graph for this function:

◆ callbackFlashWrite()

FlashCallbackWrite Platform::callbackFlashWrite ( )

Definition at line 443 of file platform.cpp.

Here is the caller graph for this function:

◆ closeMultiCast()

void Platform::closeMultiCast ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 94 of file platform.cpp.

Here is the caller graph for this function:

◆ closeSpi()

void Platform::closeSpi ( )
virtual

Reimplemented in LinuxPlatform, and ArduinoPlatform.

Definition at line 21 of file platform.cpp.

Here is the caller graph for this function:

◆ closeUart()

void Platform::closeUart ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 54 of file platform.cpp.

◆ commitNonVolatileMemory()

void Platform::commitNonVolatileMemory ( )
virtual

Definition at line 180 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ commitToEeprom()

void Platform::commitToEeprom ( )
virtual

Reimplemented in LinuxPlatform, Esp32IdfPlatform, CC1310Platform, Stm32Platform, SamdPlatform, RP2040ArduinoPlatform, EspPlatform, and Esp32Platform.

Definition at line 149 of file platform.cpp.

Here is the caller graph for this function:

◆ currentDefaultGateway()

uint32_t Platform::currentDefaultGateway ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 78 of file platform.cpp.

Here is the caller graph for this function:

◆ currentIpAddress()

uint32_t Platform::currentIpAddress ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 68 of file platform.cpp.

Here is the caller graph for this function:

◆ currentSubnetMask()

uint32_t Platform::currentSubnetMask ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 73 of file platform.cpp.

Here is the caller graph for this function:

◆ fatalError()

virtual void Platform::fatalError ( )
pure virtual

Implemented in LinuxPlatform, Esp32IdfPlatform, CC1310Platform, and ArduinoPlatform.

Here is the caller graph for this function:

◆ flashErase()

void Platform::flashErase ( uint16_t  eraseBlockNum)
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 138 of file platform.cpp.

Here is the caller graph for this function:

◆ flashEraseBlockSize()

size_t Platform::flashEraseBlockSize ( )
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 117 of file platform.cpp.

Here is the caller graph for this function:

◆ flashPageSize()

size_t Platform::flashPageSize ( )
virtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 122 of file platform.cpp.

Here is the caller graph for this function:

◆ flashWritePage()

void Platform::flashWritePage ( uint16_t  pageNumber,
uint8_t *  data 
)
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 141 of file platform.cpp.

Here is the caller graph for this function:

◆ flushUart()

void Platform::flushUart ( )
virtual

Reimplemented in RP2040ArduinoPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 65 of file platform.cpp.

◆ getEepromBuffer()

uint8_t * Platform::getEepromBuffer ( uint32_t  size)
virtual

Reimplemented in LinuxPlatform, Esp32IdfPlatform, CC1310Platform, Stm32Platform, SamdPlatform, RP2040ArduinoPlatform, EspPlatform, and Esp32Platform.

Definition at line 144 of file platform.cpp.

Here is the caller graph for this function:

◆ getEraseBlockNumberOf()

int32_t Platform::getEraseBlockNumberOf ( uint32_t  relativeAddress)
protected

Definition at line 378 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNonVolatileMemorySize()

size_t Platform::getNonVolatileMemorySize ( )
virtual

Definition at line 166 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNonVolatileMemoryStart()

uint8_t * Platform::getNonVolatileMemoryStart ( )
virtual

Definition at line 152 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadEraseblockContaining()

void Platform::loadEraseblockContaining ( uint32_t  relativeAddress)
protected

Definition at line 362 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ macAddress()

void Platform::macAddress ( uint8_t *  data)
virtual

Reimplemented in LinuxPlatform, RP2040ArduinoPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 83 of file platform.cpp.

Here is the caller graph for this function:

◆ NonVolatileMemoryType() [1/2]

NvMemoryType Platform::NonVolatileMemoryType ( )

Definition at line 8 of file platform.cpp.

◆ NonVolatileMemoryType() [2/2]

void Platform::NonVolatileMemoryType ( NvMemoryType  type)

Definition at line 13 of file platform.cpp.

◆ overflowUart()

bool Platform::overflowUart ( )
virtual

Reimplemented in RP2040ArduinoPlatform.

Definition at line 60 of file platform.cpp.

◆ readBytesMultiCast() [1/2]

int Platform::readBytesMultiCast ( uint8_t *  buffer,
uint16_t  maxLen 
)
virtual

Reimplemented in LinuxPlatform, LibretinyPlatform, and EspPlatform.

Definition at line 107 of file platform.cpp.

Here is the caller graph for this function:

◆ readBytesMultiCast() [2/2]

int Platform::readBytesMultiCast ( uint8_t *  buffer,
uint16_t  maxLen,
uint32_t &  src_addr,
uint16_t &  src_port 
)
virtual

Reimplemented in RP2040ArduinoPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 112 of file platform.cpp.

Here is the call graph for this function:

◆ readBytesUart()

size_t Platform::readBytesUart ( uint8_t *  buffer,
size_t  length 
)
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 29 of file platform.cpp.

◆ readNonVolatileMemory()

uint32_t Platform::readNonVolatileMemory ( uint32_t  relativeAddress,
uint8_t *  buffer,
size_t  size 
)
virtual

Definition at line 251 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readUart()

int Platform::readUart ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 34 of file platform.cpp.

Here is the caller graph for this function:

◆ readWriteSpi()

int Platform::readWriteSpi ( uint8_t *  data,
size_t  len 
)
virtual

Reimplemented in LinuxPlatform, and ArduinoPlatform.

Definition at line 24 of file platform.cpp.

◆ registerFlashCallbacks()

void Platform::registerFlashCallbacks ( FlashCallbackSize  callbackFlashSize,
FlashCallbackRead  callbackFlashRead,
FlashCallbackWrite  callbackFlashWrite,
FlashCallbackCommit  callbackFlashCommit 
)

Definition at line 420 of file platform.cpp.

Here is the call graph for this function:

◆ restart()

◆ sendBytesMultiCast()

bool Platform::sendBytesMultiCast ( uint8_t *  buffer,
uint16_t  len 
)
virtual

◆ sendBytesUniCast()

bool Platform::sendBytesUniCast ( uint32_t  addr,
uint16_t  port,
uint8_t *  buffer,
uint16_t  len 
)
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 102 of file platform.cpp.

Here is the caller graph for this function:

◆ setupMultiCast()

void Platform::setupMultiCast ( uint32_t  addr,
uint16_t  port 
)
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, LibretinyPlatform, EspPlatform, Esp32Platform, and Esp32IdfPlatform.

Definition at line 91 of file platform.cpp.

Here is the caller graph for this function:

◆ setupSpi()

void Platform::setupSpi ( )
virtual

Reimplemented in LinuxPlatform, and ArduinoPlatform.

Definition at line 18 of file platform.cpp.

Here is the caller graph for this function:

◆ setupUart()

void Platform::setupUart ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32Platform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 57 of file platform.cpp.

Here is the caller graph for this function:

◆ uartAvailable()

int Platform::uartAvailable ( )
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 49 of file platform.cpp.

◆ uniqueSerialNumber()

uint32_t Platform::uniqueSerialNumber ( )
virtual

◆ userFlashSizeEraseBlocks()

size_t Platform::userFlashSizeEraseBlocks ( )
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 133 of file platform.cpp.

Here is the caller graph for this function:

◆ userFlashStart()

uint8_t * Platform::userFlashStart ( )
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 128 of file platform.cpp.

Here is the caller graph for this function:

◆ writeBufferedEraseBlock()

void Platform::writeBufferedEraseBlock ( )
protectedvirtual

Reimplemented in SamdPlatform, RP2040ArduinoPlatform, and LibretinyPlatform.

Definition at line 384 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeNonVolatileMemory() [1/2]

uint32_t Platform::writeNonVolatileMemory ( uint32_t  relativeAddress,
uint8_t *  buffer,
size_t  size 
)
virtual

Definition at line 205 of file platform.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeNonVolatileMemory() [2/2]

uint32_t Platform::writeNonVolatileMemory ( uint32_t  relativeAddress,
uint8_t  value,
size_t  repeat 
)
virtual

Definition at line 330 of file platform.cpp.

Here is the call graph for this function:

◆ writeUart() [1/2]

size_t Platform::writeUart ( const uint8_t *  buffer,
size_t  size 
)
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 39 of file platform.cpp.

◆ writeUart() [2/2]

size_t Platform::writeUart ( const uint8_t  data)
virtual

Reimplemented in RP2040ArduinoPlatform, LinuxPlatform, Esp32IdfPlatform, and ArduinoPlatform.

Definition at line 44 of file platform.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _bufferedEraseblockDirty

bool Platform::_bufferedEraseblockDirty = false
protected

Definition at line 144 of file platform.h.

◆ _bufferedEraseblockNumber

int32_t Platform::_bufferedEraseblockNumber = -1
protected

Definition at line 143 of file platform.h.

◆ _callbackFlashCommit

FlashCallbackCommit Platform::_callbackFlashCommit = nullptr
protected

Definition at line 150 of file platform.h.

◆ _callbackFlashRead

FlashCallbackRead Platform::_callbackFlashRead = nullptr
protected

Definition at line 148 of file platform.h.

◆ _callbackFlashSize

FlashCallbackSize Platform::_callbackFlashSize = nullptr
protected

Definition at line 147 of file platform.h.

◆ _callbackFlashWrite

FlashCallbackWrite Platform::_callbackFlashWrite = nullptr
protected

Definition at line 149 of file platform.h.

◆ _eraseblockBuffer

uint8_t* Platform::_eraseblockBuffer = nullptr
protected

Definition at line 142 of file platform.h.

◆ _memoryType

NvMemoryType Platform::_memoryType = Eeprom
protected

Definition at line 130 of file platform.h.


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