70367f53ca
- Created CMakeLists.txt for the OpenKNX IDF component, ensuring dependencies on OpenKNX and TPUart submodules. - Implemented Arduino compatibility header for basic functions like millis, delay, pinMode, and digitalRead. - Developed EspIdfPlatform class for network interface management and multicast communication. - Added EtsMemoryLoader for loading ETS memory snapshots and managing associations. - Introduced TpuartUartInterface for UART communication with methods for reading, writing, and managing callbacks. - Implemented arduino_compat.cpp for Arduino-like functionality on ESP-IDF. - Created source files for platform and memory loader implementations. - Updated submodules for knx, knx_dali_gw, and tpuart. Signed-off-by: Tony <tonylu@tony-cloud.com>
59 lines
871 B
C
59 lines
871 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifndef DEC
|
|
#define DEC 10
|
|
#endif
|
|
|
|
#ifndef HEX
|
|
#define HEX 16
|
|
#endif
|
|
|
|
#ifndef INPUT
|
|
#define INPUT 0x0
|
|
#endif
|
|
|
|
#ifndef OUTPUT
|
|
#define OUTPUT 0x1
|
|
#endif
|
|
|
|
#ifndef INPUT_PULLUP
|
|
#define INPUT_PULLUP 0x2
|
|
#endif
|
|
|
|
#ifndef INPUT_PULLDOWN
|
|
#define INPUT_PULLDOWN 0x3
|
|
#endif
|
|
|
|
#ifndef LOW
|
|
#define LOW 0x0
|
|
#endif
|
|
|
|
#ifndef HIGH
|
|
#define HIGH 0x1
|
|
#endif
|
|
|
|
#ifndef CHANGE
|
|
#define CHANGE 2
|
|
#endif
|
|
|
|
#ifndef FALLING
|
|
#define FALLING 3
|
|
#endif
|
|
|
|
#ifndef RISING
|
|
#define RISING 4
|
|
#endif
|
|
|
|
using uint = unsigned int;
|
|
|
|
uint32_t millis();
|
|
uint32_t micros();
|
|
void delay(uint32_t millis);
|
|
void delayMicroseconds(unsigned int howLong);
|
|
void pinMode(uint32_t pin, uint32_t mode);
|
|
void digitalWrite(uint32_t pin, uint32_t value);
|
|
uint32_t digitalRead(uint32_t pin);
|
|
typedef void (*voidFuncPtr)(void);
|
|
void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode); |