24 lines
643 B
C++
24 lines
643 B
C++
#include "KnxWorker.hpp"
|
|
#include "esp32_idf_platform.h"
|
|
#include "knx_facade.h"
|
|
#include "knx/bau07B0.h"
|
|
#include "knx/group_object.h"
|
|
|
|
#define MASK_VERSION 0x07B0
|
|
|
|
Esp32IdfPlatform knxPlatform(UART_NUM_1); // Use UART_NUM_1, change if needed
|
|
Bau07B0 knxBau(knxPlatform);
|
|
KnxFacade<Esp32IdfPlatform, Bau07B0> knx(knxBau);
|
|
|
|
KnxWorker::KnxWorker() {}
|
|
|
|
void KnxWorker::init() {
|
|
knxPlatform.knxUartPins(38, 37); // Set RX=16, TX=17
|
|
knxPlatform.knxUartBaudRate(19200); // Set baud rate (can be changed to other values like 9600, 38400, etc.)
|
|
knxPlatform.setupUart();
|
|
|
|
}
|
|
|
|
void KnxWorker::toggleProgMode() {
|
|
knx.toggleProgMode();
|
|
} |