Rail Controller Service¶
- group Rail Controller Service
Driver for controlling power rails and monitoring consumption.
Note
The application that consumes this service should subscribe to faults (like overcurrent events) to ensure they are caught quickly.
- group Types
Structures and Enums for rail status monitoring.
Defines
-
RAIL_CONTROLLER_SERVICE_ID¶
-
RAIL_CONTROLLER_EVENT_FAULT_DETECTED¶
-
RAIL_CONTROLLER_EVENT_OVERCURRENT_DETECTED¶
-
RAIL_CONTROLLER_EVENT_UNDERVOLTAGE_DETECTED¶
-
RAIL_CONTROLLER_EVENT_OVERVOLTAGE_DETECTED¶
-
RAIL_CONTROLLER_EVENT_RAIL_FAULT_DETECTED¶
Enums
-
enum rail_controller_id_t¶
Values:
-
enumerator RAIL_CONTROLLER_FAULT_DETECTED¶
Published when a critical fault is detected. Payload: rail_controller_t (Snapshot at time of failure)
-
enumerator RAIL_CONTROLLER_OVERCURRENT_DETECTED¶
Published when an overcurrent is detected on a single rail. Payload: rail_t (Snapshot at time of failure)
-
enumerator RAIL_CONTROLLER_UNDERVOLTAGE_DETECTED¶
Published when an undervoltage event is detected on a single rail. Payload: rail_t (Snapshot at time of failure)
-
enumerator RAIL_CONTROLLER_OVERVOLTAGE_DETECTED¶
Published when an overvoltage event is detected on a single rail. Payload: rail_t (Snapshot at time of failure)
-
enumerator RAIL_CONTROLLER_FAULT_DETECTED¶
-
enum rail_status_t¶
Operational health status of a power rail.
Values:
-
enumerator RAIL_STATUS_OK¶
Rail is operating nominally.
-
enumerator RAIL_STATUS_DISABLED¶
Rail is intentionally disabled.
-
enumerator RAIL_STATUS_OVERCURRENT¶
Rail was shut down due to current limit violation.
-
enumerator RAIL_STATUS_UNDERVOLTAGE¶
Rail voltage is below expected threshold
-
enumerator RAIL_STATUS_OVERVOLTAGE¶
-
enumerator RAIL_STATUS_FAULT¶
<Rail voltage is above expected threshold Generic fault or hardware failure
-
enumerator RAIL_STATUS_OK¶
-
struct rail_t¶
- #include <rail_controller.h>
Snapshot for a specific power rail.
Returned by rail_controller_get_rail for system monitoring.
-
struct rail_controller_t¶
- #include <rail_controller.h>
Container for all power rail state.
Holds snapshots for all rails and initialization status. Must be initialized with rail_controller_init before use.
-
RAIL_CONTROLLER_SERVICE_ID¶
- group Public API
External interface for interacting with the Rail Controller Service.
Functions
-
void rail_controller_init(rail_controller_t *manager)¶
Initialize the Rail Controller hardware.
Configures GPIO pins for load switches as outputs (defaulting to OFF) and initializes any I2C/ADC interfaces required for current monitoring.
Note
This function is idempotent.
- Parameters:
[controller] – The rail controller
-
void rail_controller_enable(rail_controller_t *manager, power_rail_t rail)¶
Turn ON a specific power rail.
Note
This function returns immediately. The rail voltage may take some time to stabilize.
- Parameters:
rail – [in] The unique ID of the rail to enable (defined in eps_config.h).
controller – [in] The rail controller
-
void rail_controller_disable(rail_controller_t *manager, power_rail_t rail)¶
Turn OFF a specific power rail.
- Parameters:
rail – [in] The unique ID of the rail to disable.
controller – [in] The rail controller
-
void rail_controller_init(rail_controller_t *manager)¶