gpio: update config to use only one gpio for ATX PSU
All checks were successful
Build ESP32 BMC Firmware / build (push) Successful in 59s

This commit is contained in:
2026-03-12 15:28:20 +01:00
parent c6f4d26c58
commit ccf4569969
6 changed files with 25 additions and 143 deletions

View File

@@ -47,7 +47,7 @@
// ============================================================================
// Number of user-configurable GPIOs
#define BMC_GPIO_COUNT 16
#define BMC_GPIO_COUNT 1
// GPIO pin definitions with names and default modes
typedef struct {
@@ -60,54 +60,18 @@ typedef struct {
} bmc_gpio_def_t;
// Predefined GPIO assignments
#define BMC_GPIO_POWER_ON GPIO_NUM_4
#define BMC_GPIO_POWER_OFF GPIO_NUM_5
#define BMC_GPIO_RESET GPIO_NUM_6
#define BMC_GPIO_STATUS_LED GPIO_NUM_7
#define BMC_GPIO_PWR_GOOD GPIO_NUM_15
#define BMC_GPIO_TEMP_ALERT GPIO_NUM_16
#define BMC_GPIO_FAN_CTRL GPIO_NUM_17
#define BMC_GPIO_USER_1 GPIO_NUM_18
#define BMC_GPIO_USER_2 GPIO_NUM_21
#define BMC_GPIO_USER_3 GPIO_NUM_35
#define BMC_GPIO_USER_4 GPIO_NUM_36
#define BMC_GPIO_USER_5 GPIO_NUM_37
#define BMC_GPIO_USER_6 GPIO_NUM_38
#define BMC_GPIO_USER_7 GPIO_NUM_47
#define BMC_GPIO_USER_8 GPIO_NUM_48
#define BMC_GPIO_POWER GPIO_NUM_37
// Default GPIO configuration table
static const bmc_gpio_def_t bmc_gpio_defaults[BMC_GPIO_COUNT] = {
// Power control outputs
{ BMC_GPIO_POWER_ON, "POWER_ON", GPIO_MODE_OUTPUT, 0, false, false},
{ BMC_GPIO_POWER_OFF, "POWER_OFF", GPIO_MODE_OUTPUT, 0, false, false},
{ BMC_GPIO_RESET, "RESET", GPIO_MODE_OUTPUT, 0, true, false}, // Active-low reset
{BMC_GPIO_STATUS_LED, "STATUS_LED", GPIO_MODE_OUTPUT, 0, false, false},
// Status inputs
{ BMC_GPIO_PWR_GOOD, "PWR_GOOD", GPIO_MODE_INPUT, 0, false, false},
{BMC_GPIO_TEMP_ALERT, "TEMP_ALERT", GPIO_MODE_INPUT, 0, true, false}, // Active-low alert
// PWM output
{ BMC_GPIO_FAN_CTRL, "FAN_CTRL", GPIO_MODE_OUTPUT, 0, false, false},
// User-configurable GPIOs
{ BMC_GPIO_USER_1, "USER_1", GPIO_MODE_INPUT, 0, false, false},
{ BMC_GPIO_USER_2, "USER_2", GPIO_MODE_INPUT, 0, false, false},
{ BMC_GPIO_USER_3, "USER_3", GPIO_MODE_INPUT, 0, false, false},
{ BMC_GPIO_USER_4, "USER_4", GPIO_MODE_INPUT, 0, false, false},
{ BMC_GPIO_USER_5, "USER_5", GPIO_MODE_INPUT, 0, false, true}, // Input-only on ESP32-S3
{ BMC_GPIO_USER_6, "USER_6", GPIO_MODE_INPUT, 0, false, true}, // Input-only on ESP32-S3
{ BMC_GPIO_USER_7, "USER_7", GPIO_MODE_INPUT, 0, false, true}, // Input-only on ESP32-S3
{ BMC_GPIO_USER_8, "USER_8", GPIO_MODE_INPUT, 0, false, true}, // Input-only on ESP32-S3
{BMC_GPIO_POWER, "POWER", GPIO_MODE_OUTPUT, 1 /* AC power ON */, true, false},
};
// ============================================================================
// Power Control Timing
// ============================================================================
#define BMC_POWER_ON_PULSE_MS 100
#define BMC_POWER_OFF_PULSE_MS 5000
#define BMC_RESET_PULSE_MS 100
#define BMC_RESET_PULSE_MS 200
#define BMC_POWER_GOOD_DELAY_MS 2000
// ============================================================================