-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoardConfig.h
More file actions
56 lines (45 loc) · 2.24 KB
/
Copy pathBoardConfig.h
File metadata and controls
56 lines (45 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H
// Board identification and pin configuration
#ifdef BOARD_SUPERMINI
#define BOARD_NAME "ESP32-S3-DevKitC-1 (SuperMini)"
#define BOARD_TYPE_SUPERMINI
#elif defined(BOARD_XIAO)
#define BOARD_NAME "XIAO ESP32S3"
#define BOARD_TYPE_XIAO
#else
#define BOARD_NAME "ESP32-S3 (Unknown)"
#define BOARD_TYPE_SUPERMINI // Default fallback
#endif
// Pin definitions (currently identical for both boards)
#define HX711_DATA_PIN 5 // GPIO5 - HX711 Data pin
#define HX711_CLOCK_PIN 6 // GPIO6 - HX711 Clock pin
#define TOUCH_TARE_PIN 4 // GPIO4 - Touch sensor for tare (T0)
#define TOUCH_SLEEP_PIN 3 // GPIO3 - Touch sensor for sleep functionality
#define BATTERY_PIN 7 // GPIO7 - Battery voltage monitoring (ADC1_CH6)
#define I2C_SDA_PIN 8 // GPIO8 - I2C Data pin for display
#define I2C_SCL_PIN 9 // GPIO9 - I2C Clock pin for display
#define BUZZER_PIN 2 // GPIO2 - Piezo sounder, non-inverted half. Free, non-strapping on ESP32-S3.
#define BUZZER_PIN_INV 1 // GPIO1 - inverted half (differential/BTL drive). Adjacent to GPIO2 for easy wiring. 255 = single-ended.
// Brownout A/B test: 1 = differential/BTL (loud, GPIO1+GPIO2 antiphase, ~2x swing & current);
// 0 = single-ended (GPIO1 held at GND, GPIO2 drives) ~half the current — NO rewiring needed.
// Flip to 0 and reflash; if the beep-time crashes stop, the cause is electrical (add a series resistor).
#define BUZZER_DIFFERENTIAL 1
#define BUZZER_LEDC_CHANNEL 0 // LEDC channel for the piezo (LEDC is otherwise unused)
#define BUZZER_RESONANT_HZ 4200 // 27mm disc resonant frequency (loudest tone)
// Board-specific configurations
#ifdef BOARD_TYPE_SUPERMINI
#define FLASH_SIZE_MB 4
#define BOARD_DESCRIPTION "ESP32-S3 SuperMini with 4MB Flash"
#elif defined(BOARD_TYPE_XIAO)
#define FLASH_SIZE_MB 8
#define BOARD_DESCRIPTION "XIAO ESP32S3 with 8MB Flash"
#endif
// Common ESP32-S3 features available on both boards
#define HAS_WIFI true
#define HAS_BLUETOOTH true
#define HAS_PSRAM true
#define HAS_TOUCH_SENSOR true
#define ADC_RESOLUTION 12 // 12-bit ADC
#define PWM_RESOLUTION 8 // 8-bit PWM
#endif // BOARD_CONFIG_H