#ifndef CONFIG_H #define CONFIG_H /* Thresholds for charging control */ /* Battery regulation corridor width (in mV). */ #define U_BAT_REGULATION_CORRIDOR 100 /* Initial charge battery voltage threshold (in mV). */ #define U_BAT_INITAL_FULL 28800 // stop charging if battery voltage reaches this threshold /* Transition to floating voltage levels after this time (in ms). */ #define INITIAL_CHARGE_HOLD_TIME 3600000 /* Duration of the transistion from initial charging to float (in ms). */ #define INITIAL_TO_FLOAT_TRANSITION_TIME 600000 /* Float charge battery voltage threshold (in mV). */ #define U_BAT_FLOAT_FULL 27600 // stop charging if battery voltage reaches this threshold /* Minimum voltage difference to U_bat that the solar panels must produce * before charging is resumed after it was switched off (in mV). */ #define SLEEP_SOLAR_EXCESS_VOLTAGE 1000 /* Minimum charge current required before charging is stopped to save power at * the charge pump (in mA). */ #define SLEEP_SOLAR_CURRENT 5 /* Maximum allowed microcontroller temperature (in units of 0.1 °C). If this * temperature is exceeded, charging is stopped. The load is kept on. Do not * set this too high as the heat has to propagate from the power MOSFETs. */ #define INTERNAL_TEMPERATURE_LIMIT 500 /* Resume operation below this temperature (in units of 0.1 °C). */ #define INTERNAL_TEMPERATURE_RECOVERY 450 /* Thresholds for load control */ /* Voltage above which the load is turned on (in mV). */ #define U_BAT_LOAD_ON 27000 /* Voltage below which the load is turned off (in mV). */ #define U_BAT_LOAD_OFF 24000 /* Current at which the overload protection triggers (in mA). */ #define LOAD_CURRENT_LIMIT_MA 10000 /* Minimum voltage that the charge pump must produce above U_bat before any * power FET is switched on (in mV). */ #define MIN_CHARGE_PUMP_EXCESS_VOLTAGE 10000 /* The minimum time the load must be off before it can be switched on again (in ms). */ #define LOAD_ON_DELAY 10000 /* Generic configuration */ /* Time (in ms) to stay active in idle state before entering deep sleep. */ #define DEEPSLEEP_DELAY 1000 /* Deep sleep duration (in seconds). */ #define DEEPSLEEP_DURATION 10 #endif // CONFIG_H