2026-07-25 12:39:32 +02:00
|
|
|
internal import CPlaydate
|
|
|
|
|
|
|
|
|
|
extension System {
|
|
|
|
|
/// Battery and power supply state.
|
|
|
|
|
public struct PowerStatus: OptionSet, Sendable {
|
|
|
|
|
public let rawValue: UInt32
|
|
|
|
|
public init(rawValue: UInt32) { self.rawValue = rawValue }
|
|
|
|
|
|
2026-07-25 12:55:53 +02:00
|
|
|
/// The battery is charging.
|
2026-07-25 12:39:32 +02:00
|
|
|
public static let charging = PowerStatus(rawValue: UInt32(kPDPowerStatusCharging.rawValue))
|
2026-07-25 12:55:53 +02:00
|
|
|
/// Power is supplied over USB.
|
2026-07-25 12:39:32 +02:00
|
|
|
public static let usb = PowerStatus(rawValue: UInt32(kPDPowerStatusUsb.rawValue))
|
2026-07-25 12:55:53 +02:00
|
|
|
/// Power is supplied through the accessory screw terminals.
|
2026-07-25 12:39:32 +02:00
|
|
|
public static let screws = PowerStatus(rawValue: UInt32(kPDPowerStatusScrews.rawValue))
|
|
|
|
|
}
|
|
|
|
|
}
|