Files
SpotMicroESP32-Leika/esp32/include/global.h
T
2026-01-31 21:15:08 +01:00

52 lines
1.1 KiB
C

#pragma once
#include <sdkconfig.h>
#include <esp_system.h>
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/rtc.h"
#ifndef ESP_PLATFORM_NAME
#define ESP_PLATFORM_NAME "ESP32"
#endif
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/rtc.h"
#ifndef ESP_PLATFORM_NAME
#define ESP_PLATFORM_NAME "ESP32-S2"
#endif
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#ifndef ESP_PLATFORM_NAME
#define ESP_PLATFORM_NAME "ESP32-C3"
#endif
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/rtc.h"
#ifndef ESP_PLATFORM_NAME
#define ESP_PLATFORM_NAME "ESP32-S3"
#endif
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#ifndef SDA_PIN
#define SDA_PIN 21
#endif
#ifndef SCL_PIN
#define SCL_PIN 22
#endif
#ifndef I2C_FREQUENCY
#define I2C_FREQUENCY 100000UL
#endif
// Optional SD card mounting via SDMMC (1-bit mode for ESP32-S3-CAM)
// Pin definitions - override in build flags if needed
#ifndef SD_CMD_PIN
#define SD_CMD_PIN GPIO_NUM_38
#endif
#ifndef SD_CLK_PIN
#define SD_CLK_PIN GPIO_NUM_39
#endif
#ifndef SD_DATA_PIN
#define SD_DATA_PIN GPIO_NUM_40
#endif