i-k-bus-board/firmware/platformio.ini
Ryan Malloy 1464fcabe6 Refactor: extract KLineTransport and IbusHandler from IbusEsp32
Split the monolithic IbusEsp32 class into composable layers:
- KLineTransport: UART, GPIO ISR, ring buffers, idle detection
- IbusHandler: BMW I/K-Bus FSM, source filtering, packet callback
- IbusEsp32: thin facade preserving the original API

Library renamed from IbusEsp32 to AutoWire. Existing sniffer
sketch (main.cpp) requires zero changes. All 3 ESP32 environments
build cleanly (esp32dev, esp32-c3, esp32-s3).
2026-02-13 05:41:39 -07:00

52 lines
1.2 KiB
INI

; BMW I/K-Bus Interface — ESP32 + PC817 Optocoupler
; Based on muki01/I-K_Bus (MIT), ported for ESP32 with R2=220 fix
[platformio]
default_envs = esp32dev
[env]
platform = espressif32
framework = arduino
monitor_speed = 115200
upload_speed = 921600
lib_deps =
build_flags =
-DIBUS_DEBUG
-DIBUS_RX_BUFFER_SIZE=256
-DIBUS_TX_BUFFER_SIZE=128
-DIBUS_IDLE_TIMEOUT_US=1500
-DIBUS_PACKET_GAP_MS=10
; --- ESP32 (classic, dual-core) ---
; GPIO 16/17 are UART2 defaults, free on most devkits
[env:esp32dev]
board = esp32dev
build_flags =
${env.build_flags}
-DIBUS_RX_PIN=16
-DIBUS_TX_PIN=17
-DIBUS_LED_PIN=2
-DIBUS_UART_NUM=1
; --- ESP32-C3 (single-core RISC-V) ---
; GPIO 4/5 are general-purpose; GPIO 8 is onboard LED on most C3 devkits
[env:esp32-c3]
board = esp32-c3-devkitm-1
build_flags =
${env.build_flags}
-DIBUS_RX_PIN=4
-DIBUS_TX_PIN=5
-DIBUS_LED_PIN=8
-DIBUS_UART_NUM=1
; --- ESP32-S3 (dual-core, USB native) ---
; GPIO 15/16 free on S3-DevKitM; GPIO 48 is RGB LED
[env:esp32-s3]
board = esp32-s3-devkitm-1
build_flags =
${env.build_flags}
-DIBUS_RX_PIN=15
-DIBUS_TX_PIN=16
-DIBUS_LED_PIN=48
-DIBUS_UART_NUM=1