Ken Van Hoeylandt 26c17986c6
GPIO refactored (#495)
* **Refactor**
  * GPIO subsystem moved to a descriptor-based model for per-pin ownership and runtime pin management; many platform drivers now acquire/release descriptors.
  * Device trees and drivers now use GPIO phandle-style pin specifications across all boards and all drivers.

* **Behavior**
  * Device list now encodes per-device status (ok/disabled); boot will skip disabled devices accordingly.

* **Deprecation**
  * Legacy GPIO HAL marked deprecated and replaced with descriptor-based interfaces.

* **Chores**
  * Bindings and platform configs updated to the new GPIO pin-spec format.
2026-02-11 20:34:54 +01:00

31 lines
963 B
C

#pragma once
#include <stddef.h>
struct Device;
/** Signals the intended state of a device. */
enum DtsDeviceStatus {
/** Device should be constructed, added and started. */
DTS_DEVICE_STATUS_OKAY,
/** Device should be constructed and added, but not started. */
DTS_DEVICE_STATUS_DISABLED
};
/**
* Holds a device pointer and a compatible string.
* The device must not be constructed, added or started yet.
* This is used by the devicetree code generator and the application init sequence.
*/
struct DtsDevice {
/** A pointer to a device. */
struct Device* device;
/** The compatible string contains the identifier of the driver that this device is compatible with. */
const char* compatible;
/** The intended state of the device. */
const enum DtsDeviceStatus status;
};
/** Signals the end of the device array in the generated dts code. */
#define DTS_DEVICE_TERMINATOR { NULL, NULL, DTS_DEVICE_STATUS_DISABLED }