2026-07-25 12:39:32 +02:00
|
|
|
internal import CPlaydate
|
|
|
|
|
|
|
|
|
|
extension System {
|
2026-09-18 12:45:39 +02:00
|
|
|
/// Battery and power supply state. Wraps `PDPowerStatus`.
|
2026-07-25 12:39:32 +02:00
|
|
|
public struct PowerStatus: OptionSet, Sendable {
|
|
|
|
|
public let rawValue: UInt32
|
|
|
|
|
public init(rawValue: UInt32) { self.rawValue = rawValue }
|
|
|
|
|
|
|
|
|
|
public static let charging = PowerStatus(rawValue: UInt32(kPDPowerStatusCharging.rawValue))
|
|
|
|
|
public static let usb = PowerStatus(rawValue: UInt32(kPDPowerStatusUsb.rawValue))
|
2026-09-18 12:45:39 +02:00
|
|
|
/// Powered through the corner screw pads.
|
2026-07-25 12:39:32 +02:00
|
|
|
public static let screws = PowerStatus(rawValue: UInt32(kPDPowerStatusScrews.rawValue))
|
|
|
|
|
}
|
|
|
|
|
}
|